Programing to Move multiple motor moves together -- Need Help
ColinAldine
Posts: 1
Currently Im able to moves each servo separately,
but when i replay the recorded action,
how do i moves all servo together?
i.e. Moves Servo 1 -> Moves Servo 2 -> save position ->
--> replay -> Moves Servo 1 and Servo 2 "at the same time"
Anyone got any idea to moving multiple servo together?
but when i replay the recorded action,
how do i moves all servo together?
i.e. Moves Servo 1 -> Moves Servo 2 -> save position ->
--> replay -> Moves Servo 1 and Servo 2 "at the same time"
Anyone got any idea to moving multiple servo together?
Comments
Brandon C.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
No purchase necessary. See back panel for more details.
Tired of the same old robot brains? not enough processing power? Get the Propeller Robot Module now!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
DO
PULSOUT Servo1 X
PULSOUT Servo2 Y
PULSOUT Servo3 Z
GOSUB CheckSensors
PAUSE 10 ' adjust to remove jerkiness from servo movement - the whole loop should take 20 milliseconds
LOOP
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Servo Boss, a 12 channel servo tester kit from Gadget Gangster.
Brandon C.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
No purchase necessary. See back panel for more details.
Tired of the same old robot brains? not enough processing power? Get the Propeller Robot Module now!!
More than "sorta".
The BS2 takes about 250 uS + the pulse width time to execute a PULSOUT command. If the average pulse width time is 1.5 mS that gives 1.75 mS per PULSOUT command. For one servo that would leave 18.25 mS for the program to do other things before needing to send another PULSOUT.
With four servos there will be only 13 milliseconds for the program to do other things while maintaining a 50 hz frame rate. A simple program could drive 10 servos at the same time, while a complex program may not be able to drive even one servo smoothly. It's all about how long the program loop takes, each servo added will increase the loop time by 1.75 mS + whatever support code (if any) is added for that servo. When the loop gets over 20 mS long you may start noticing less smoothness.
One thing to look out for is PAUSE commands. Even the standard PAUSE 20 you find in the examples is really too long of a pause, it should be PAUSE 18 to keep the frame rate close to 50 hz. The more time the loop takes, the less time the PAUSE command should be.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Servo Boss, a 12 channel servo tester kit from Gadget Gangster.
Ron
Your program could read I/O and sensors, calculate what you want the motors to do, and pulsout to the servos. You can set your loop up to run 50 times per second and use loop counting for a timer. For example if you want to go forward for 3 seconds you can pulsout for forward for 150 counts through the loop. This way you can control 8 servos and still have the frame rate the servos were designed for.
RogerN