I have a speed problem with the mini servo controller in
pololu mode… I set the servo speed to “1” when I send
the command to the servo, it does not move at the slow
speed I wanted for the first time. For the first time, it will
zoom at whatever the current default speed is in the servo controller
then during subsequent commands it would slow it down to the correct speed
What am I doing wrong?
Does this only happen when you send the first position command to a servo after turning on or resetting the servo controller?
For example: if you turn on your servo controller, send a position command to a servo (which will move there at top-speed), then set the servo speed to low and send a new position command I bet it will move there slowly on the first try. If you turn on your servo controller, set a servo to a slow speed, then send it a position command, if the servo is not already at that position it may move there at high speed and there isn’t much to do about it.
The servo controller sends position commands to the servo, and the servo moves to the commanded position as fast as it can, but normal hobby servos don’t feed any information back to the controller. The (neat) way Pololu servo controllers slow down the motion of standard hobby servos is by dividing up the difference between the current servo position and the new requested position, and sending lots of intermediate position commands over time. The problem is that when you’ve just started up the servo controller and it hasn’t sent any position commands yet, it has no idea what position the servos are actually in, so it assumes the servo is at it’s neutral starting position and starts sending position commands near there. If your servo isn’t actually at its neutral position it will move there very quickly.
If you really can’t have your servos moving fast for the first command, you could try commanding them back to their neutral positions at the end of your program, or manually moving them near there before starting up the controller. I hope that will still work with your project.
P.S. By the way, I’m making a big assumption about your problem here, if this doesn’t actually sound like what you’re seeing (i.e. if you change the speed in the middle of your program, after sending a servo positon command, and you still get fast motion the first time after that) please post your code and we’ll have a look.
Yes I believe this is the cause…
However I am wondering if the following logic for the servo controller
If a first command is for a particular channel is detected AND it is a SetSpeed command
then assume Mid position and divide up the time… If the servo is in the wrong position
wont it be at least Slower than in full speed?
In reduced speed mode the servo controller sweeps the target position of the servo slowly, and when you send the first position command the target point starts in the middle of the servo range by default. If the servo isn’t already very near the target point when the signal starts up it will rush to that point as fast as it can.
If it reaches the (slowly moving) target position while the controller is still sweeping it towards a final goal then the servo will slowly track with it.
Standard servos don’t support the ability to move at configurable speeds, so the servo controller has to simulate this by sweeping the servo through positions at a fixed rate, as nexisnet has said. If the servo is not where the servo controller thinks it is, the effect is that the first signal sent to the servo will make it move to the initial position at full speed (the servo doesn’t know how to move any slower on its own).