Quote:
Originally posted by Fares
hey guys , we are pretty new to this and we are trying to gear down one of our servos . We are not pretty sure how to do that , and i have been trying to use Robogui to do it but it doesn't seem to do anything or i guess i am not doing the right thing what is the code to gear down the servo, we 've been looking around and we don't know what the maximum number is and the lowest number etc... if you guys are able to help that will be great.
|
Servos are a controlled by specifying a "target position", and sending a series of PWM pulses to "jerk" it toward that position. As the actual PWM signals to the servo are generated by separate circuitry in the RC and are NOT under your control, you CAN'T simply reduce the number of PWM pulses to slow it down.
There are still two primary ways I can think of off the top of my head to slow down servo travel:
1) GEAR IT DOWN (for real) on the servo output with gears!

For every 2:1 geardown, you get 1/2 the speed. The disadvantage is that you also reduce the total end to end travel by the same amount.
2) "Walk" the servo slowly in software, by gradually incrementing and sending a new "target position value" over MANY loops.
Example: Assume the servo is at position 100 now (range is 0-255) and wish to end up at position 200. If you increment the output position value by ONE each loop it will take you 100 loops, or roughly 2.5 seconds to get there. If you wish faster travel simply increment by a larger amount per loop. For slower travel, take several loops to increment the output by one with an additional "factor counter" variable.
Fractional increments can also be done this way... For example: For every three loops, increment the desired target position by two.
In all cases, once done you keep resending the final target position value for each loop thereafter.
Does this make sense to you?
- Keith