Welcome to Synthiam!

Program robots using technologies created from industry experts. EZ-Builder is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.
Get Started

Asked — Edited
Resolved Resolved by Steve G!

Writing Script For Multiple Servos At The Same Time

Don't laugh too hard...I'm a noob learning how servos work for the first time.
I am just learning how to script with EZBuilder manually...
Working with an inMOOV robotic arm/hand.

I have a script that moves 5 servos - 1 at a time for each finger.
The script looks like this...
SetServoMin(D0,1)
SetServoMax(D0,160)
SetServoMin(D1,1)
SetServoMax(D1,160)
SetServoMin(D2,1)
SetServoMax(D2,160)
SetServoMin(D3,1)
SetServoMax(D3,160)
SetServoMin(D4,1)
SetServoMax(D4,160)
Servo(D0,1)
Sleep(500)
Servo(D0,160)
Sleep(500)
Servo(D0,1)
Sleep(500)
Servo(D0,160)
Sleep(500)
Servo(D0,1)
Sleep(500)
Servo(D0,160)
Sleep(500)
Servo(D0,1)
Sleep(500)
Servo(D1,1)
Sleep(500)
Servo(D1,160)
Sleep(500)
Servo(D1,1)
Sleep(500)
Servo(D1,160)
Sleep(500)
Servo(D1,1)
Sleep(500)
Servo(D1,160)
Sleep(500)
Servo(D1,1)
sleep(500)
Servo(D2,1)
Sleep(500)
Servo(D2,160)
Sleep(500)
Servo(D2,1)
Sleep(500)
Servo(D2,160)
Sleep(500)
Servo(D2,1)
Sleep(500)
Servo(D2,160)
Sleep(500)
Servo(D2,1)
Sleep(500)
Servo(D3,1)
Sleep(500)
Servo(D3,160)
Sleep(500)
Servo(D3,1)
Sleep(500)
Servo(D3,160)
Sleep(500)
Servo(D3,1)
Sleep(500)
Servo(D3,160)
Sleep(500)
Servo(D3,1)
Sleep(500)
Servo(D4,1)
Sleep(1000)
Servo(D4,160)
Sleep(1000)
Servo(D4,1)
Sleep(500)
Servo(D4,160)
Sleep(500)
Servo(D4,1)
Sleep(500)
Servo(D4,160)
Sleep(500)
Servo(D4,1)
Sleep(500)

How can I get all 5 servos to move at the same time? Is there a way to execute 5 commands at the same time from the same script on the same line?
Can someone give me a short example? I want the robot to close his hand and then open his hand...or maybe open two fingers while 3 are closed.

Any help would be appreciated so I can see how this might be accomplished.
Thanks!
BobJ

United Kingdom
#15  
@WBS, in that case, have you looked at using multiple scripts and ControlCommands? Look at the latest Ping Roam script of mine (in the cloud) for an example of this. Multiple scripts or sub-routines called by a main script (or the sub routines). It made it even easier to make changes or use the same section of code multiple times.
#16  
@Rich
Thanks. I wondered about that. That was going to be the next thing I looked at to see how all that was usually done. I'll start with your example. Does seem like a good way to isolate program sections for reuse. Also perhaps a way to introduce "scope" into the whole thing.
#17  
@bobjacon This is how I did my finger servos.... I used screws like guitar tuning pegs... I can adjust tension simply by turning any one of the screws...
User-inserted image
#18  
Richard R,
What a GREAT idea! Can you point me to a source as to where someone can find screws like that? I don't even know what to call them but that would solve that problem pretty well.

BobJ
#19  
@bobjacon Ha, ha.... #4 x 3/8 wood screws from the Home Depot.... you need some crazy glue as you wrap the braided line around the screws... This will keep it from slipping when you turn the screw...
#20  
Richard R,

LOL!

You had me thinking that there was a small screw with a hole through it like tuning peg available someplace!

However, thanks for describing what you mean...it will do the same thing!
BobJ