NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Basic Electronics » Digital servo issues!
March 13, 2012 by ThomasH |
Hi All, I recently purchased some digital servos () I've been having real troubles getting the servo to work! I've read the servo squirter tutorial and have even cut and paste the code, but my servo motor still doesn't respond. Using the following bit of code below, my servo just appears to move randomly! I have a separate wall power supply for the servo motor. Does anyone have any ideas? Is there a difference in control between analog and digital servos for the purposes of controlling it via the atemga168? Thanks! Tom.
|
---|---|
March 13, 2012 by ThomasH |
Sorry - I forgot to include the link to the digital servo. I may be useful to someone who is more knowledgeable that me! There are 2 links, but both are the same servo model (D90MG) http://www.geningrc.com/ProductsView.Asp?id=50 http://www.twig.com.au/store/product_info.php?products_id=139&osCsid=17eae35ad2bfa19ffb3c96e596d57b2f |
March 13, 2012 by JimFrederickson |
I think, at the very least, you will need to post the Manufacturer and Model of the Servos in question. A link to a location to find the spec-sheet would be helpful as well. |
March 13, 2012 by ThomasH |
Hi Jim, I hope the 2 links to the servo are sufficient. That's all I have. I don't have a data sheet or spec sheet other than those links. Thanks for your help! Tom. |
March 13, 2012 by ThomasH |
Hello again! I think I solved the issue. I didn't connect the 2 grounds of each of the power supplies together. I read this somewhere on the internet that the servo power supply and the microcontroller power supplier need to have a common ground. I do have another question though - why is this the case? Is this so the PWM signal (high and low) that the microcontroller produces has the same point of reference for both the microcontroller and servo? Tom. |
March 13, 2012 by Rick_S |
Hi Tom, Digital and analog hobby servo's both communicate the same way. So the servo squirter code should work. You stated that you used a separate power supply for the servo. While this is fine, you do have to tie the ground wire of the servo supply to the ground of your kit. I'm guessing you didn't do this since you didn't say you did. Without sharing a common ground, the signal from the nerdkit will be at a different potential than the servo and you will have issues. If you did share a common ground, take a couple of photo's of your setup and post them. We may see something you missed. One last thing. I noticed you are using OCR1A instead of OCR1B as in the servo squirter. While I'm sure you are aware, since you changed the code, this requires the signal wire from the servo to connect to pin 15 (PB1/OC1A) instead of pin 16 as in thier tutorial. Rick |
March 14, 2012 by Rick_S |
Tom, I was wondering. Did you have a chance to try the suggestions or did you got it working? Rick |
March 14, 2012 by ThomasH |
Hi Rick, I'm not sure if my previous post got through, but it did solve the problem. I didn't have a common ground! Must be a frequent newbie problem! Thanks for your help. Tom. |
March 15, 2012 by Rick_S |
Not a problem, glad it worked for you. Rick |
Please log in to post a reply.
Did you know that you can turn a $20 digital scale into a live weight sensor using our kit with a few extra parts? Learn more...
|