Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Servo Speed / Pololu Servo Controller

Status
Not open for further replies.

beakie

New Member
I want to be able to calculate what parameters I would need to pass to make the pololu servo controller take N milliseconds to move angle A with an HS-5645MG servo.

https://www.electro-tech-online.com/custompdfs/2012/09/ssc03a_guide.pdf



The servo specification states:

SPECS: Speed: 0.23 sec/60° at 4.8V
Speed: 0.18 sec/60° at 6.0V

I am running it at 5v... so we can use 0.23 sec/60° at 4.8V in my calculations.



The controller takes between 0 - 127 as a speed parameter.

(From Pololu Manual)
With a speed of 1, the pulse width changes at 50 microsecond per second; the maximum speed of 6.35ms per second is achieved with a speed setting of 127


Are the following statements all true?

Passing 127 will make it move 60° in 0.23 seconds.
Passing 127 will make it move 30° in 0.115 seconds.
Passing 64 will make it move 60° in 0.116 seconds.


Is the rate of speed change linear (like I assume)?
 
Something is fishy:

(From Pololu Manual)
With a speed of 1, the pulse width changes at 50 microsecond per second; the maximum speed of 6.35ms per second is achieved with a speed setting of 127

The bold seconds, I believe mean seconds of arc. i.e. 60 seconds in a degree. so 60 degrees has 3600 seconds.

My problem is that 50 uS/second of arc is FASTER than 6.35 mS/Second of arc.
 
It is a faster pulse... but does that mean a slower moving servo?
 
Last edited:
My calcs are

60'*60"/1'*50e-6s*1 = 0.18 s; 60 degrees at speed 1 which is the fastest time to move 60 degrees.

30'*60"/1'*50e-6s*127 = 0.18 s
The slowest 30'*60"/1'*50e-6s*127 = 22.82 s

the 60"/1' is a conversion to make the units come out right; 60 sec/1 min of arc.

and thus I think 64 will give you 60*60*50e-6 s*64 or 11.52 seconds

Now, it's also possible that 0 is really 1. and 63 is really (63+1)/128 or 1/2 the max speed but i doubt it because you don't want to do divides.

It also makes sense for a speed of zero to be stopped.
 
My guess is that a value of 1 gives 20 seconds, 2 = 10 seconds, 3= 5 seconds etc.

Why not just try it and see?

Edit, a value of zero turns the feature off and the pulse changes immediately.

Mike.
 
Last edited:
I typed this reply earlier but forgot to press post and so it's out of turn with my last post. That's what happens when you switch computers midday.

The speed that the manual is referring to is the speed that the pulse width changes. For a servo to go from one extreme to the other requires the pulse to change from 1mS to 2mS (or vice versa). The Pololu module can change this instantly in which case the servo will move at 0.23 sec/60° or, it can change it slowly. With a speed setting of 1 it changes at 50uS per second and so to change 1mS will take 1/0.05 = 20 seconds.

Mike.
 
Command 1: Set Speed (1 data byte)
This command allows you to set the speed at which the servo moves. If the speed is set to 0
(default), the output pulse will instantly change to the set position. If the speed value is
nonzero, the pulse changes gradually from the old position to the new position. With a speed of 1,
the pulse width changes at 50 microseconds per second; the maximum speed of 6.35 ms per second is
achieved with a speed setting of 127.

Now, i kind of get it after I read the datasheet.

0 is instantaneous.

So, if the pulse width is 0.25 to 2.75 ms

and: With a speed of 1, the pulse width changes at 50 microseconds per second; the maximum speed of 6.35 ms per second is
achieved with a speed setting of 127.

So, it's really the slew rate. i.e. 6.25 ms/s 6.25 ms is greater than the maximum pulse with, but the 6.25 ms is 6.25 ms/s or a RATE and it is the fastest rate that the servo can move.
 
Thanks peeps. This is what I needed!

Now the question is... how do I implement the idea of load into the calculations. Any idea where this information might be?

It's not in the datasheet...
 
The related stuff comes from the specs:

Operating Speed (4.8V): 0.23sec/60° at no load
Operating Speed (6.0V): 0.18sec/60° at no load
Stall Torque (4.8V): 143oz/in. (10.3kg.cm)
Stall Torque (6.0V): 168 oz/in. (12.1kg.cm)

With a servo, your not concerned with measuring Torque, but you ARE concerned with having enough of it. These servo's are for angular positioning.

Torque is somewhat of an easy concept. Let's take a breaker bar on a tire lug nut. Typical lug nuts are torqued at about 50 ft-lbs. That's 50 lbs of force a foot away or 25 lbs of force 2' away. The force distance relationship holds.
 
So...

Lets say I have a servo with an arm attached... and I were to attempt to change the servo, lifting the arm upwards.

Any weight in the hand of the arm would not change the efficiency of the servo? The arm WILL be lifting at the same rate as it would with no extra weight... as long as the maximum torque value isn't exceeded???
 
Last edited:
That's what I thought.

So, If I were to code my own servo controller and wanted to add some code to consider load, then there must be something out there to detail what the effect of load would be, no?
 
In THIS SITUATION, I slightly disagree with Mr RB because slewing can be controlled with this controller.

If you say left 1 in per second and the item is a feather and then the item is pencil, nothing changes as long as the system can lift the pencil. The system will not be designed to lift a brick.

Horsepower actually is the value that affects how fast you can accelerate an object.

Torque is proportional to current in a motor. Speed is proportional to Voltage, well almost. An unloaded motor can be used as a tachometer. Speed is proportional to voltage. But when Vm = Vw-IwRw, the IR drop across the motor winding is significant. www.linear.com recently created a motor control that would measure the motor voltage during a short coast period.

You can measure the current to your servo, but it's doing lots of crazy things. It can definitely detect a stall.
 
That's what I thought.

So, If I were to code my own servo controller and wanted to add some code to consider load, then there must be something out there to detail what the effect of load would be, no?

Not really. Each model servo will be different for speed:load curves and they are different again when supplied with different PSU voltages (ie higher PSU voltages mean more torque and higher speed).

I've done a number of projects using servos under precise microcontroller control and there's no easy way you can make an arm move exactly the same with a heavy load as it does with a light load.

Regarding what K.I.S.S. said, if you use the controller to generate a slower change in duty cycle the servo will move at roughly the right speed, I have done this. However the position will be significantly behind where it should be if the load is high, and they often break out into instability if the load is high and undamped and you try to move the servo slowly under software control.

There is no way your software can know what the load actually is (with a normal servo). Some of the expensive "digital" servos might have a closed loop reporting system you can monitor under software but that would be an unusual feature and I have not senn nor worked with one of those servos.

One thing that does help a lot is to use a regulated PSU voltage to run the servo, this gives much better performance and repeatability of the servo for speed and load driving ability. The last thing I made had 3 Hitachi analogue servos powered by 3 LM317 adjustable voltage regulators, and the regulators helped to dial in the right speeds and accelerations for the individual servos.

However if yours is for an arm that will lift differing loads, and needs to move the same speed, I would suggest you look at the DC gearmotors with optical encoders (Pololu also have some) as you can control these by software and the optical encoder will give you the actual speed and posiiton.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top