Setting Servo speeds and Initialization Script Tutorial

Final Thoughts.

There are a few controls found in EZ-Buider that have "Init" command tabs built in to the controls, as seen below...

HT16K33 8x8 Animator.

User-inserted image

MPU9150 4 in 1 sensor.

User-inserted image

These "Init" commands can be run straight from the control by clicking the "Init" tabs when needed, but they can also be run using the controls "Cheat Sheet" commands found in script editors...

User-inserted image

Hopefully, the examples given in this tutorial will give you a good idea of what initialization scripts do, what they can be used for, and how to use them.

Happy building.

Tutorial created on 3rd October 2015


ARC Pro

Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.

#1  

What I have found is that when I set to ServoSpeed(D3,0) , and then add position Servo(D3, 90) and finally ServoSpeed(D3, 4), servo D3 runs as fast as it can to get into startup position. I also found that if I insert ServoSpeed(D3, 4) in the line before Servo(D3, 90) it moves slowly to startup position. The tutorial says not to set final speed until after setting position or you will have a problem. What am I missing?

#2  

Sorry for the last comment.  It was sent by accident.

I tried to submit it in the tutorial but I got an error message and could't send it.

The tutorial I was reading is above  "Setting servo speeds and Initialization Script Tutorial"

I am sending the information here so I don't need another thread.

I am having problems with my initiation script.  I have found that when I set  ServoSpeed(D3, 0) , and then add position Servo(D3, 90) and finally ServoSpeed(D3, 4), servo D3 runs as fast as it can to get to position given by Servo(D3, 90) startup position. I also found that if I insert ServoSpeed(D3, 4) in the line before Servo(D3, 90) it moves the correct slow speed to Servo(D3, 90) position.

The tutorial says not to set final speed until after setting position or you will have a problem. What am I missing?

PRO
Synthiam
#3   — Edited

I believe what the tutorial is trying to convey is initialization of a servo position. That means the very first time a servo is moved or set into position

a servo doesn’t have a position when power is applied. There’s no way to slowly transition to the initialization position because there is no previous position. so, you must set a position first, which initializes the servo and then set the speed. Once the speed is set, it’ll always have that speed for moving until speed is specified again.

The first initialization of servos will always move quick as they can to the specified position. It’s annoying, but it’s how servos work.

Now, if you’re hardcore and want to get around that issue. You can look up my hack on adding adc position monitoring. That way, you can know the position the servo is in and initialize at that position. Then, set the speed. There would not be any jumping if you did that

heres the plugin which has the video and details: https://synthiam.com/Products/Manual/PWM-Servo-Feedback-ADC-18047

#4  

Is there a problem with adding ServoSpeed(D3. 4) code in the line before Servo(D3. 90) line .

If I do this, it doesn’t jerk into D3 position. D3 controls up and down movement of the head of the robot. Without the control the heavy robot head slams int position D3.  I am afraid over time I will damage the servo and robot body. This is a five foot Robot called max.  He weighs about 70 lbs.  t will soon post a picture.

PRO
Synthiam
#5  

I’m surprised that works, but if it does then yeah go for it. Really if anything does work, keep doing it:)  as the phrase goes, don’t fix it if it ain’t broke

PRO
USA
#6  

Quote:

Now, if you’re hardcore and want to get around that issue. You can look up my hack on adding adc position monitoring. That way, you can know the position the servo is in and initialize at that position. Then, set the speed. There would not be any jumping if you did that
I want to revisit this on my robot heads. They could uses an init, that could read head positions from the dynamixels, then move them to a beginning state. Not sure how I missed this use case!

#7  

Quote:

I’m surprised that works, but if it does then yeah go for it. Really if anything does work, keep doing it:) as the phrase goes, don’t fix it if it ain’t broke
Yeah, I thought servo speed only worked after an initial servo movement.  Never fully understood why, but just dealt with it.  The new HD servos make it easy because they pretty much hold their last position when shut down.  On robots without HD servos, I have a "safe" position I try to remember to go to before shutting down as long as I get to it before the battery dies.

If it is working now, great, just be sure you are testing after first power up and not just running the script after you have already moved the servos before trusting it.

Alan