Pages: [1]   Go Down
Author Topic: (another) issue with shaking servo motors  (Read 2205 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone,

When plugging some servos on the arduino, they shake a bit. I saw on many threads that it may come from giving few current but I use a stabilized power supply directly plugged on the motors. The reason may also be that I am exceeding servos mechanical limits, it is not what happends here because arduino sends something like 1750 us pulses. I also saw that there are some tricks about the arduino's clock but I can't remember where, does someone has an idea ?
My code to test this issue calls only one time "my_servo.write(...);" in the setup() function.

Thanks,
Mickael
Logged

0
Offline Offline
Sr. Member
****
Karma: 8
Posts: 394
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Since you use a seperate supply, have you made a good common ground connection?  What servo model?  Cheap servos can shake occasionaly.  More info can be useful.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you.
The servos and the arduino have a comon ground. The motors are HS-785HB : http://www.servocity.com/html/hs-785hb_3_5_rotations.html.
Does it from the 3.5 rotations ?
Logged

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12092
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I also saw that there are some tricks about the arduino's clock but I can't remember where, does someone has an idea ?

You can disable interrupts on timer0 (thus losing millis(), micros() and delay() functionality) by going:
Code:
  TIMSK0 = 0x00 ;

Since timer0 interrupts have a higher priority than timer1 interrupts (used by the Servo library),
this will reduce/eliminate occasional jitter on the Servo library outputs.
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh, thank you, it is a bit drastic but I think it is possible to not use these functions. I'm on another issue for now but I will give it a try.
Logged

UK
Offline Offline
Tesla Member
***
Karma: 121
Posts: 6980
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You really need to provide a much more narrowly focused description of the problem.

Is it possible that the servos get power before they get a signal from the Arduino?

...R
Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9560
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
When plugging some servos on the arduino, they shake a bit.

Assuming you are physically plugging in the servo wiring, any electrical noise generated on the servo wiring when connecting or disconnecting the wiring can cause erratic servo movement.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you
@Robin2 : yes there are powered on before the arduino send them a signal but the problem still exists after.
@zoomkat : my post was a bit confusing, I plug the servos one time and they shake each time I try the project.

Yesterday, I saw with another project that sending too much debugging text to the computer made the same thing (the servo is making squeaky noise). Removing all the function taking time solved the problem. I will try to remove unnecessary code and maybe disable the first timer to see what happend.
Logged

UK
Offline Offline
Tesla Member
***
Karma: 121
Posts: 6980
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would try starting the Arduino before powering the servo and see if that solves the problem. If it does I would add a circuit (a relay?) so that the Arduino only switches power to the servos after it has started.

...R
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you. Powering the Arduino before the motors didn't change anything but removing all time eating functions made the motors shaking less frequently and consequently. The erratic moves are not visible, I can just hear them. I consider the problem as solved.
Logged

UK
Offline Offline
Tesla Member
***
Karma: 121
Posts: 6980
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Interesting.  It seems as if some of the other code is preventing the Arduino from sending the proper signal to the servos. I must experiment with this when I get back to my servo project.

I wonder if the problem has anything to do with the 3.5 revolutions of the sail winch servos. Presumably they interpret the usual servo signal pulse (1ms to 2ms) as the extremes of 1260 degrees of motion compared with a "normal" servo that is only concerned with about 180 derees of motion. The sail servo would be much more sensitive to small variations in the pulse width.

I built a few model sailboats some years ago but at the time I couldn't afford a sail winch servo. I wasn't doing anything competitive.

...R
Logged

Pages: [1]   Go Up
Jump to: