Servo Controller Help

I just bought my first 8-servo controller chip, and am having some problems with the data that needs to be sent. I have a single servo hooked up to RA0, and the LED’s behave correctly.

Here’s the packets I’m sending:
0x80 0x01 0x00 0x00 0x5f
which should set the range on #0 to 0x1f (the max)

0x80 0x01 0x02 0x00 0x7f
which should set #0 to it’s full position of 7f.

However, the servo doesn’t move. Do I have my packets/concept wrong?

Hello,

It looks like you understand the protocol correctly. Do you have servo power connected correctly? Do you have the protocol selection jumper removed?

You could also send an out-of-range absolute position command to see if the yellow LED comes on correctly.

Another possibility is that you inadvertently changed the servo numbers to which your servo controller responds. You could send a 0x80,0x02,0x00 packet to make sure the controller responds to servo numbers 0-7.

- Jan

I’m unable to get it to give an out of range error.

  1. The LED’s are good (serial input to low test)
  2. The # is correct (0x80 0x02 0x00 turns on R and Y, flashes green once, loops)
  3. The servo is powered (it twitches on powerup)
  4. The packets are going out (same control program as for the dual motor controller)
  5. The jumper is off.

When I power it up, the yellow LED comes on. When I send out the first packet (0x80 0x01 0x04 0x00 0x00 0x00) to attempt the out of range error, the yellow goes off, and the green flashes quickly during the serial traffic. The LED’s stay off after that though. In normal operation, is yellow supposed to come back on?

Travis

Hello,

The yellow LED should stay off during normal operation, but sending an absolute position of 0 should make it come on to indicate an out of range condition.

It sounds like you are sending the correct data and the LEDs are connected correctly, so you might check the integrity of your serial data. Do you have an oscilloscope or logic analyzer with which you can take a look at your serial data? You can look at the green LED, too, which should be echoing everything the servo controller sees.

Also, try sending your data at different baud rates and see if that makes any difference. Have you tried controlling servos other than number 0? Perhaps you have a bad solder connection somewhere relating to servo 0, or that pin on the microcontroller might have been hit by a static discharge.

- Jan

I wrote a small program to go through all the possible servo #'s, trying out of range (00) absolute values. None of them caused an out of range error. The out of range error should happen whether or not it’s soldered in or not, right?

The code to send the serial data is the exact same as the dual motor controller code, which works. I don’t have a scope or digital logic analyzer (which would probably diagnose the problem immediately, heh) to test the serial stream.

Do I need to call the Set Parameter command when starting? As I understand it, calling the absolute command (0x04) should be all I need to turn the motor on and move the position.

Is there any example code available? Any language will be fine.

Hello,

The yellow out-of-range warning LED should come on regardless of if the actual servo pins are soldered in correctly. I just wanted to know if any of the servo pins worked.

In PBASIC, you just need lines like:

SEROUT 15, 32, [$80,1,4,0,0,0]

(The 15 is the pin number on the BASIC Stamp, and the 32 sets the baud rate to 19200.)

Have you tried different baud rates yet? Also, are you connecting from a computer or from a microcontroller?

- Jan

Heh, wanted to let you know that I finally figured out what the problem was. I went on vacation, got back with a fresh view, and realized that the resistor off the computer’s serial line (going to the transistor) was 100k, not 10k like the schematic says to use. Once I replaced that it all worked as expected :slight_smile: