servo smoothness
jcferguson
Posts: 86
Hi all,
Would the bs2sx make for a smoother servo pan than the bs2 due to the difference in pulsout values? Do I want as fine an adjustment as possible with the pulsout?
What about the pwmpal - how would this make for smoother/rougher panning than a stamp alone? The parallax servo controller?
I am looking for the smoothest pan possible as I am using servo to pan a camera - the servo is geared up so that I can get a full 360 degrees - and so the jerkyness is geared up too!
Thanks!
Carlos Ferguson
Would the bs2sx make for a smoother servo pan than the bs2 due to the difference in pulsout values? Do I want as fine an adjustment as possible with the pulsout?
What about the pwmpal - how would this make for smoother/rougher panning than a stamp alone? The parallax servo controller?
I am looking for the smoothest pan possible as I am using servo to pan a camera - the servo is geared up so that I can get a full 360 degrees - and so the jerkyness is geared up too!
Thanks!
Carlos Ferguson
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
within the servo world (which will cost less since I won't have to get the stepper drivers for 5 steppers!) what's the best combination in your view?
Thanks,
Carlos
check the specs on your servo. Some newer digital (and more expensive) servos have a smaller deadband and on some (even MORE expensive) the deadband is programmable.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (Larry) : 2/11/2007 9:49:35 PM GMT
I am using this code to test for smoothest way to pan servo - am I missing anything?:
' {$STAMP BS2sx}
' {$PBASIC 2.5}
SERVOVAR VAR WORD
INTERNAL VAR WORD
MOTION VAR WORD
DO
FOR MOTION = 16 TO 30 STEP 2 'try a range of pause times on this outer loop
DEBUG DEC (MOTION), CR 'print the pause time
FOR SERVOVAR = 1675 TO 2075 STEP 10
FOR INTERNAL = 1 TO 6 'pulse servo for 'internal' times at this value
GOSUB PULSE
NEXT
NEXT
FOR SERVOVAR = 2075 TO 1675 'back the other way
GOSUB PULSE
NEXT
NEXT
LOOP
PULSE: 'pulse servo, pause
PULSOUT 0, SERVOVAR
PAUSE MOTION
RETURN
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
It looks to me like the servo runs smoothly for a bit then chunks up for a few pulsouts then runs smooth... I wonder if this is caused by my pulsouts being at some other interval than 20us? So that it runs smoothly for a while until it skips a round due to incremental increase or decrease above or below 20us? Does the servo have some kind of internal clock for this 20us?
If so, I wonder if the pwmpal would be smoother due to better regulation of the pause time between pulses?
Carlos
Since your test code is simple and short, I would try a straight 20ms pause between servo pulses as a baseline. In the real world, this will probably give you a pulse every 21-23ms or so, taking into account the actual length of the pulse itself plus overhead on the Stamp for executing instructions. See what kind of results you get. For real programs, if you are generating the servo pulses from the Stamp, you will need to adjust the pause (and possibly have it be variable on each loop) depending on the overhead for other operations in the loop. See "Go to and Find Closest Object" in the Stamps in Class forum for a good example of the latter (that program calculcates the time for an echo on a Sonar, and adjusts the pause value after the servo pulse accordingly).
FYI -- I think you meant 20 milliseconds above; many readers would read "20us" as microseconds (millionths of a second).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
You might still want to baseline your servo though and see if you can improve your results... the knowledge will always come in useful and you might be able to live with the results and come out ahead.....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
One other consideration though, is size. I have about 3.5 inches width to work with, 3 inches height. I need to fit my pan/tilt, and camera in there. See picture of slot car track in parking garage like structure below.
My mechanism is attached too - I think it will make sense, one is the top view, that entire platform rotates and the tilt camera will be carried on the platform. As long as I can keep the platform less than 1.75" radius I should be ok! The shaft is attached rigidly to the plexiglass base (this is all a mock-up) and as the servo turns it swings the top wood around the shaft.
What about this idea (taken from some robotics site...). I put the small gear on the servo, large gear on the base, use an external 10 turn pot also running off the gear on the servo - this way I would get several turns of the servo in order to pan the platform? Better?
Thanks for the help!
Carlos
Gearing down? Might this help? I would think it would, but who knows, for these tiny little variations it might always be jerky?
Carlos