|
I have assembled this robot kit but it is not behaving as expected when I use the bundled software. For example, the controls for moving the camera left and right and up and down cause the opposite to happen, i.e. the left button causes the camera to move right.
I have looked at the mechanical setup and it seems to be okay. Note: I could still be wrong about this.
I started looking at the bundled software and a few things don't make sense to me. The servo motors in this kit are these
http://www.ee.ic.ac.uk/pcheung/t ... /sg90_datasheet.pdf
so a 1msec pulse = full left, 1.5msec = middle and 2.0msec = full right, based on a 50Hz period.
The first thing is that the PWM frequency which is set in the file turn.py is set to 60 which does not look to be correct?
Also, the logic of the turn left and turn right commands as shown below looks to be the opposite of what I would expect. To turn further left, it looks like the duration of the pulse is increased up to a maximum value. Based on the spec above, I would be expecting this to be the other way around?
elif 'l_le' in data: #Camera look left
if hoz_mid< look_left_max:
hoz_mid+=turn_speed
turn.ultra_turn(hoz_mid)
tcpCliSock.send('7'.encode())
elif 'l_ri' in data: #Camera look right
if hoz_mid> look_right_max:
hoz_mid-=turn_speed
turn.ultra_turn(hoz_mid)
tcpCliSock.send('8'.encode())
|
|