Servo control
rtmorris
Posts: 31
I have question about servo control (not continuous servo).· WAM says that a for next loop can contol the time that a servo holds a position.· I do agree with that, but isn't the real purpose of the loop to keep sending pulses until the servo can get the position desired.· For example lets say I did this:
counter var byte
for counter = 1 to 2
pulsout 14,1000
pause 20
next
The servo may not get to the 10 O'clock position, becuase the servo didn't get there before the pulses stopped, although it was trying.
Changing this·to
FOR Counter = 1 to 150
pulsout 14,1000
pause 20
next
Would allow the servo to get to the desired position, and once it got there, it would simply wait until the loop ended before the line following next is executed...so in a sence, the loop is controling time at a position, but the real purpose is getting the servo to the desired position to begin with.
DO I HAVE THIS RIGHT, OR AM I WAY OFF?
-Rob Morris
·
counter var byte
for counter = 1 to 2
pulsout 14,1000
pause 20
next
The servo may not get to the 10 O'clock position, becuase the servo didn't get there before the pulses stopped, although it was trying.
Changing this·to
FOR Counter = 1 to 150
pulsout 14,1000
pause 20
next
Would allow the servo to get to the desired position, and once it got there, it would simply wait until the loop ended before the line following next is executed...so in a sence, the loop is controling time at a position, but the real purpose is getting the servo to the desired position to begin with.
DO I HAVE THIS RIGHT, OR AM I WAY OFF?
-Rob Morris
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
My last words shall be - "NOT YET!!!"
I suppose the easiest way to answer your question is this.Once you send a "control" command (PULSOUT nn, etc) you have done all you can do to assist it in getting to the desired position. If you were to send it another command, regardless of what it is, it would only prolong the processs, presuming the servo would even recognize it.
Once it has REACHED that position, you need to refresh the signal on a regular basis (20 ms.) to keep it there. That can be repeated ad infinitum with no deleterious effect, to my knowledge.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
you said:
Once it has REACHED that position, you need to refresh the signal on a regular basis (20 ms.) to keep it there. That can be repeated ad infinitum with no deleterious effect, to my knowledge.
Wait...if I don't refresh every 20ms, are you saying that the servo would go back to center?
I tried this with the following
counter var byte
for counter = 1 to 150
pulsout 14,1000
pause 20
next
The servo does not have to be refreshed after this point every 20ms to stay there.
-Rob
Rob
position command sent every 20 ms or so or the servo will relax,
ie. if there is no torque on it it will stay in that position but is there
is torque on the servo, it will not maintain the position. Try it and see.
Tug on the output shaft. When you stop sending pulses, it will turn.
If you keep sending pulses it will resist turning, up to the capacity of
it's torque rating.
JohnP
Excellent response...this makes perfect sense.
-Rob