Loading...
Pages: [1]   Go Down
Author Topic: Servo movement speed  (Read 531 times)
0 Members and 1 Guest are viewing this topic.
Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi gang...

Servo movement speed seems to be an intrinsic characteristic of the model of servo.

So, if I want to slow the movement, I guess I have to cheat. I could calculate, for example, the number of degrees to move and then use some simple loop delay approach. On the face of it that would work, but calibration will be a pain in the @$$.

Are there any standard techniques for controlling the speed of a servo?
Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

New Jersey
Offline Offline
Edison Member
*
Karma: 26
Posts: 2450
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Are there any standard techniques for controlling the speed of a servo?

Not that I know of - all I've seen is your suggested delay loop, or derivatives of blink without delay.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 282
Posts: 15442
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Are there any standard techniques for controlling the speed of a servo?

Not built into the servo library. Using simple time delays as you describe will work if you are using just one servo and there is nothing else in the main sketch that needs servicing faster then the use of the blocking delay() statements. If you use millis() for tracking elapsed time you can avoid the blocking action of delay() and control the speed of many servos as well as assuring your main loop cycle time is fast enough to handle all else you are doing. See the blink without delay sketch example for how that method can be applied.

 There has been a poster (or two?) that said they are working on modifying the servo library (or writing a new one) to use a optional velocity value for the servo.write() command. That would be very useful.

Lefty
Logged

Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks guys
Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

0
Offline Offline
Tesla Member
***
Karma: 58
Posts: 6766
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You might check the below discussion.

http://arduino.cc/forum/index.php/topic,61586.0.html
Logged

Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
GOOGLE ADVANCED FORUM SEARCH BELOW!  
Go to:  http://www.google.com/advanced_search?hl=en
put in key search words,
use site or domain:  http://arduino.cc/forum
or in a google search box put key words site:http://arduino.cc/forum

Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks zk....

If anyone's interested here's why I want to control the speed. I set myself a rather academic exercise, to move a laser pointer along a wall at constant linear speed. Of course with constant angular speed, the linear speed increases at the sides. The incremental angle dtheta subtends a smaller distance along the wall when it's normal than it does at the sides.

If my calculus is right, for constant linear speed I get that

dtheta/dt = k cos2theta

With theta = 0 (beam normal to wall), cos theta is 1 and dtheta/dt is maxed, and it decreases towards the side.

(Even if the maths* is wrong I know qualitatively that the angular speed needs to be maxed when the beam is normal to the wall and decreases towards the sides  smiley-razz)

* or math singular depending on where you live...
« Last Edit: December 08, 2012, 11:33:48 pm by JimboZA » Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

0
Offline Offline
Tesla Member
***
Karma: 58
Posts: 6766
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Old Georgia Tech football game cheer: "dy..., dx..., to hell with that, we want sex!"
Logged

Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
GOOGLE ADVANCED FORUM SEARCH BELOW!  
Go to:  http://www.google.com/advanced_search?hl=en
put in key search words,
use site or domain:  http://arduino.cc/forum
or in a google search box put key words site:http://arduino.cc/forum

Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm guessing you didn't major in poetry....   smiley-wink
Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

Offline Offline
Edison Member
*
Karma: 5
Posts: 1167
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can write a script in an array to control the speed every 70ms.
http://arduino.cc/forum/index.php/topic,85335.45.html
Reply #48

See the example code.  Use Excel to calculate 1/speed that you want.
The same script will drive a geared stepper motor which would be just as smooth.
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Pages: [1]   Go Up
Print
 
Jump to: