EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: tony3d on January 17, 2014, 03:25:27 pm

Title: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 03:25:27 pm
Hi Guys,  Why am I getting this speed up at the beginning of the cycle? I'm using the standard sweep Sketch from the IDE. The servos are the ones packed in the Maker Shed Ultimate Microcontroller pack.
 
 (http://i46.photobucket.com/albums/f132/2001as/IMG_3381.mp4)
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: mlapaglia on January 17, 2014, 03:28:36 pm
How much current is the servo drawing? Could it be more than the arduino can supply?
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 03:38:24 pm
How much current is the servo drawing? Could it be more than the arduino can supply?

It's doing the same thing on Batteries.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 04:29:39 pm
Anybody else?
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: Sam__ on January 17, 2014, 05:15:59 pm
If you're definitely running the right sketch, on the right arduino. Then it could be a faulty servo?

Maybe double check everything by re-uploading the sketch or using a different servo, or using a different PWM pin.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: fcb on January 17, 2014, 05:59:53 pm
Can you 'scope the supply pin (look for anomalies, like a dip as previous poster suggested), or the control pulse (is the problem with the servo or the 'duino).
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 06:15:21 pm
I have tried the two servos that came in the kit, and they both do the same thing. It also does it on any of the PWM pins.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 06:29:20 pm
If you're definitely running the right sketch, on the right arduino. Then it could be a faulty servo?

Maybe double check everything by re-uploading the sketch or using a different servo, or using a different PWM pin.

The sketch is the one that came in the sample of the Arduino software. It's the one in Examples, Servo, Sweep. I'm running it on an official Uno.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: pickle9000 on January 17, 2014, 06:37:19 pm
Try running this one. It's not a sweeper its a pot based one.

http://arduino.cc/en/Tutorial/Knob (http://arduino.cc/en/Tutorial/Knob)

This will allow you so see if the output is consistent over the entire range. If it isn't (meaning it jumps at weird places) change the output pin and try again.

Troubleshooting is part of the game so be patient and enjoy it. It's simply a puzzle to be solved.

Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 07:06:52 pm
Try running this one. It's not a sweeper its a pot based one.

http://arduino.cc/en/Tutorial/Knob (http://arduino.cc/en/Tutorial/Knob)

This will allow you so see if the output is consistent over the entire range. If it isn't (meaning it jumps at weird places) change the output pin and try again.

Troubleshooting is part of the game so be patient and enjoy it. It's simply a puzzle to be solved.
Ok, I tried this circuit, and sketch. If I scale back the servo, and change the 179 degrees to 165 the operation is smooth, but of course the rotation is not 180. If I go as high as 168, and turn the pot I get almost to the end, and it glides further on it own, stops, but wants to keep going.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 07:24:37 pm
These two videos shows what I mean. The one that runs up, and back is set at 166, the other is set at 168, and you can see it continue to spin, and you can hear it grinding at the end of it's travel. I just want to make sure the Arduino board itself is ok.

http://s46.photobucket.com/user/2001as/media/IMG_3384.mp4.html (http://s46.photobucket.com/user/2001as/media/IMG_3384.mp4.html)

http://s46.photobucket.com/user/2001as/media/IMG_3385.mp4.html (http://s46.photobucket.com/user/2001as/media/IMG_3385.mp4.html)
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: Cdngreybeard on January 17, 2014, 07:55:21 pm
Goto the Arduino website and read about how the servo library works.  It explains what causes servo grinding and how it may be resolved.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: Neverther on January 17, 2014, 07:56:51 pm
To me it sounds just like the servo is not meant to turn the full 180, and it is pretty normal with cheap servos.
Feedback pot inside the servo going full scale -> jump in the end as the desired output is greater than feedback.

It is also possible the servo has some movement outside the "0" range of that library.
I found out that atleast MG946 had travel beyond that as I controlled it directly with the 16bit timer.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 08:08:56 pm
Here's the spec Sheet.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 09:06:16 pm
I powered the servo from my bench top power supply feeding it 5 volts, and set the amps to 1 amp. Hooked a common ground to the Arduino board, and fed the control signal from every PWM pin on the board, and still the same results.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: MatCat on January 17, 2014, 09:17:36 pm
Looks to me like one issue is trying to sweep it too fast, what size servo is that, 26G?  Even little 9G servos can peak at 1A just moving, let alone what happens if you hit the stop area.  As previously stated too not all servos are going to move 180, often most servos only go 150 to 160.  Some servos if you force it past the physical stop point can cause weird drift issues because they no longer can find a fixed center.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 09:24:29 pm
This makes sense. So you think my Arduino board is ok then? Everything else I have tried has worked fine.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 09:49:19 pm
Looks to me like one issue is trying to sweep it too fast, what size servo is that, 26G?  Even little 9G servos can peak at 1A just moving, let alone what happens if you hit the stop area.  As previously stated too not all servos are going to move 180, often most servos only go 150 to 160.  Some servos if you force it past the physical stop point can cause weird drift issues because they no longer can find a fixed center.

The servo size is an 8G!
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 17, 2014, 11:39:48 pm
Has anyone else used the servo's from Radio Shack's Ultimate Micro-controller Pack with similar results? I'm thinking that these really can't go past 166 degrees. Every other  thing I have tried with this board is working fine.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: MatCat on January 18, 2014, 02:03:27 am
166 degrees is pretty standard for the majority of servos, trust me, my business is electronics for RC Aircraft so I know a bit about servos hehe.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 18, 2014, 02:51:31 am
166 degrees is pretty standard for the majority of servos, trust me, my business is electronics for RC Aircraft so I know a bit about servos hehe.

Ok thanks. I'm pretty new to Arduino so I need all the help I can get.
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: pickle9000 on January 18, 2014, 03:51:15 am
Wow, you did excellent, I just got home and thought I have look to see if I could help and problem solved, nice. The videos where excellent that's always a good way of explaining. Best of all no jiggle cam.



 
Title: Re: Why Is My Arduino Servo Behaving Like this?
Post by: tony3d on January 18, 2014, 07:11:12 am
Wow, you did excellent, I just got home and thought I have look to see if I could help and problem solved, nice. The videos where excellent that's always a good way of explaining. Best of all no jiggle cam.



 

Thanks to all you guys, I think we got it resolved. I'm just glad my Arduino board is ok. This PWM stuff is really interesting. Think I'll put my scope on the output of one of those PWM pins, and watch the square waves expand, and contract. Be fun to get a visual representation of what's going on.