Pages: [1]   Go Down
Author Topic: Soft start and stop  (Read 410 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

New to Arduino and loving it.  Has anyone tackled how to speed up and slow down a servo as it nears a certain position to give it a soft start/stop?  I've been running a loop to increase the delay as it passes a certain position.  Just wondered if this was the most efficient or if there is a fancy formula I'm not aware of.
Logged

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

New to Arduino and loving it.  Has anyone tackled how to speed up and slow down a servo as it nears a certain position to give it a soft start/stop?  I've been running a loop to increase the delay as it passes a certain position.  Just wondered if this was the most efficient or if there is a fancy formula I'm not aware of.

Not likely. The arduino cannot know the exact position of a servo while it's actually moving as there is no feedback of position given back to the arduino, and different servos move at different speeds and any specific servo's speed will be effected by the mechanical load that it is trying to move. So at best if you observe your specific servo's speed you could perhaps come up with a worst case speed for a give amount of commanded change of position and wait that long before issuing another position command.

Lefty
Logged

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

This is possible.  First calculate the actual speed when going from end to end.  Then write a function to move 1 degree at a time less than that speed.  Move the first few degrees slower, then just under the max, then slower again.
Logged

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

Skype Brighteyes3333
(262) 696-9619

Pages: [1]   Go Up
Jump to: