Asked — Edited
Resolved Resolved by Steve G!

How To Get Init Script To Go Slower Servo'S?

am looking when i power jd on the pose he wil take goes slow. as in the video he does it slow but not when the init script runs.

User-inserted image


ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

United Kingdom
#17  

@Steve S.

I'll try to explain it. You know how when you have a servo set to move at a certain speed, say ServoSpeed(D5,2), it will move at that speed no problem. Now close that project and open it again.

Without the servo speed init script, when you connect to the EZ-B the servos will twitch. No problem. But now, when you move that servo for the first time since connecting to the EZ-B, even with the servo set to "2", it will move at full speed. Move it again a second time and it will move at speed "2".

Setting the servos to "0" in a init script basically initalises the servo speed (like it moved the first time, mentioned above), then later in the same script, it sets the new speed (like it moves the second time, mentioned above). Now when you move that servo normally with a script, it will move at speed "2".

That's basicly it. I Think I explained that okay.:P

I hope that helps Steve.

PRO
Synthiam
#18  

Exactly as steve said - the servo does not know it's position until it is moved into a position. When you power on a robot, the software has no idea what position the servo is in because there is no feedback information. The servo jumps to position - which is why the learn section explains to always start your JD robot from lying on it's back and not having any objects around that it will knock over.

You can find out more how servos work using the activity in the learn section here: https://synthiam.com/Tutorials/Lesson/48?courseId=6

#19  

Thank you Steve G and D.J. for responding, If I remember correcting we were told to set the actual servo positions first , then the speeds during initialize?


servo(d1,80)
servo(d2,90)
servo(d3,38)
servo(d4,141)
servo(d5,76)
servospeed(d1,3)
servospeed(d2,5)
servospeed(d3,2)
servospeed(d4,2)
servospeed(d5,5)

I appreciate your help, thank you. Steve S

United Kingdom
#20  

No problem Steve. Glad it helped. You are right in what you are saying though as that's how I have always understood it, and how I write my scripts. Position first, then speed.

But in this instance it's not necessary as in the first part or the script where everything is 0 (see post #2) we are not setting a servo position, only speed. But in the second part we are asking for a position so as you say, it's position first then speed. Something like that anyway.;)

PRO
Belgium
#21  

steve S

yes the init works great with steve G script.