Electronics > Electronics

Calibrating Servo control

(1/3) > >>

hazzer123:
I have just created a servo motor program for a PIC and am just wondering, what is the best way to calibrate the pulse widths to an angle. Is it simply by measuring them with a protractor and noting down the pulse width required? All servos are slightly different arent they?

Also, is the angle directly proportional to the pulsewidth?

Thanks

nanob0t:

--- Quote from: hazzer123 on April 30, 2007, 01:50:57 PM ---Also, is the angle directly proportional to the pulsewidth?

--- End quote ---

Yes, the angle is proportional to pulsewidth.   If a 1.5ms pulse is neutral on the servo, anything less would bring it closer to 0 degrees, while anything higher would bring it closer to 180 degrees.  If you had a 180 degree servo.

In terms of finding this information, look at the data sheet or the information of that line of servos.  It should have a short clip on what is neutral, and what is max/min angles, etc.  From there, it's algebra to figure it out.

I can help you with the math if you don't know how to do it.

nanob0t:
A question I have that I might as well spit out since this is servo topic.

Can I control a servo using a PWM on a microcontroller?  Is this possible?

I need to know if it's possible, if it needs bunches of math in order to solve it, I can do that easy.  I just need to know if I have to buy a servo controller or if I can control my servos with my own microcontroller.

I am starting to make a robot by myself.  I'm building aside from the funding I get from companies, so I don't have a really great budget.  I am designing a tiny robot.  If I can get a chassic built and a tiny robot built that is very inexpensive, I plan to be able to change it into wonderous things a mass produce them.  Then I can have millions of tiny robots cleaning this house or something.  In all the projects I have done, the companies have always made me use DC motors, instead I'd like to use continuous rotation servos, but I don't want a huge servo controller on the thing.

Thanks

JonHylands:
If you're using two servos per robot, then you can easily control them using hardware PWM depending on which microcontroller you are using. The AVR microcontrollers (specifically the ATmega line) are quite capable of this.

- Jon

nanob0t:

--- Quote from: JonHylands on April 30, 2007, 02:58:40 PM ---If you're using two servos per robot, then you can easily control them using hardware PWM depending on which microcontroller you are using. The AVR microcontrollers (specifically the ATmega line) are quite capable of this.

- Jon

--- End quote ---

What about a PIC with a few installed PWMs?

I'm getting a couple sampled that have PWMs, because I want to get started soon   :)