Pololu servo controller setting neutral

Hello,

I have been using the 8 servo controller for a while now and all of the commands (setting position, speed, changing ID’s) work out well, but I’m confused on the set neutral command in the manual. I have been checking other forums and tried out other people’s code segments but none of the servos do anything when I send a “set_neutral”. It is supposed to move the servo but it just sits there. It would help if the manual was more specific, and I’m wondering what the point of it is and when the neutral positioning comes into play such as when the robot is turned on does it move to its neutrals, or when no more commands are sent it defaults to its neutral? Also, when writing the Serial commands, everyone else uses Serial.print("… “), but the controller only works if I use Serial.write(”…"). What’s the difference?

Thanks

What do you mean a reference point? Do you mean that the neutral position is the new “zero” position, and that everytime the robot is powered on it defaults to those positions? I don’t really see the use for it as every code someone has written has the set_neutral command always being run in the setup() section, and the move_to_position could do the same thing. Each of my servos isn’t exactly equal and some might need a 3000 pulse to move 180 degrees whereas another might need 3050. Setting a neutral for the legs stil doesn’t save me the overhead of having to indivually figure the pulse for each motor position because each one doesn’t move exactly the same.
My biggest problem is that my code is identical but setting neutrals does not do anything to the motor.

Thanks for the reply

That last part is a really good point. I just figured that the manual made a good point about setting symmetrical legs with neutrals and I would like to to use it. To make it a little clearer, the code for setting neutrals is almost identical to moving the servo except it takes in a different command number. My problem is that the code works fine for moving the servo but the second I switch to a different command it just sits there (the controller I mean, the servos work). I started to think something’s up with my arduino because ever since I purchased it, it has been causing problems.

The serial.print() function in Arduino sends the characters encoded in binary, whereas the serial.write() function sends the raw binary data. You can make both work but you need to make sure you send the correct data.

Setting the neutral position will move the servo to the newly defined neutral position and can be used as a reference point for the position commands. It is usefukl for calibration since servo motrs can have physial differences that you will need to take into account in your code otherwise.

It is possible that your servo is not set to ON. See command 0 in the manual to turn it ON. Also, Command 2 takes into account the defined neutral position and Command 0 can also set the range. If does not matte if you set the reference point every time you run your code, it can still be used as a reference point.

Of course, if you do not find these commands useful, you are not compelled to use them.