Serial 8 servo with python under ubuntu

Problem’s really hard to summarize in a title.

The Situation:
When I turn on power to the serial 8 servo controller, the yellow led turns on and stays on. When I send data to the controller the yellow led turns off for the time i’m sending data, then turns on again. None of the other LEDs ever do anything, and no servos move.
Sending data to /dev/ttyS0 through the terminal has the same effect, which occurs with the protocol selection jumper open or closed.

Specs:

  • Pololu 8 servo controller
  • 4.8V power supply, connected to the servo power pins, with the Vcc=Vs jumper closed
  • 1 MG995 servo attached to the servo 0 output pins
  • Ubuntu hardy
  • Python 2.5
  • Pyserial
  • The following python test script (slightly modified from Micro dual motor controller)
import serial  # import PySerial libraries

START_BYTE = '\xff'

#general purpose test function to write out the serial string
#on the serial port.
def ss(servo, pos):
         servo_num = servo + 16  # note that the port is always n+16
         s = '%c%c%c' % (START_BYTE, chr(servo_num), chr(pos))
         ser.write(s)
         print 'Moved Servo: %s to pos:%d' % (servo, pos)


ser = serial.Serial('/dev/ttyS0')  # set up the serial port using the default device (see note above)

#a little servo exercise

for p in range(0,7): #test each servo
 for i in range(0,255): #put it through the full range of values
  ss(p,i)

Thank you in advance for your help

Afromonkey0

Hello.

If your yellow LED is turning back on (and the servo controller is not in Pololu mode–are you sure your jumper is on?), it means the servo controller has reset, probably because of bad power. I think step one is getting your power setup better, which for now should include a separate power source for the servo controller.

There’s a similar recent thread at: Micro Serial 8 Servo Ctrl:Incremental position change?

- Jan

Thanks, i’ll try changing my power setup, and come back if the problem persists.
Wish me luck :slight_smile: