Motor to Servo

Can anyone tell me how i can program a Motor into a Servo Motor? Or ideas on how i can “manipulate” the motor into a servo motor?

thanks in advance. :smiley:

Do you mean you want to make a normal motor act like a servo? if so then u will also need a potentiometer and what u do is hook the pot up to whatever it is that must rotate and compare the value of that pot to where u want the motor facing then drive the motor until it reaches that point, i would recomend that u do this after the motor has bee geared down and u are comparing the overall displacement of the motor as this will be easier to implement.

If you mean turning a servo into a motor, that’s a hardware question. No amount of software can do that.

What I meant was making a motor act like a servo.

I’ll try that.

Thanks for the help :smiley:

You’ll need some sort of feedback to tell you what position the motor is in. Usually that’ll be a potentiometer. Then you’ll need to write a program to compare the measured position to the desired position, and drive the motor in the proper direction at the appropriate speed to get it to where you want it to go.

Search the forums for “PID Control” and you’ll find several discussions of the topic.

Edit: Search the forums for “PID Control” and you’ll also find out what it is.

Sorry for being such a newb at this, but what exactly does PID mean?

We’re doing this exact thing for the motor used to change the angle of the compression thing for the ball launcher, and I basically just did what was said above - I get readings from a potentiometer and stop the motor when the desired reading (AKA, the one that I want for the specific angle of launch) is equal to the current reading.

you will need to gear down the motor significantly, put a potentiometer on the shaft.
PID is basically a method of predicting how a motor will react in the future based on current changes. a simple thing you could do is just make the amount of power given to the motor propotional to the distance you are from your target potentiometer value.
this will probably work very well for a slow position application like this

PID stands for Proportional, Integral, Differential control. Basically put, since the motor has inertia, you cannot just stop the motor once you reach the position (unless you’re geared down a lot), because you’ll overshoot. I personally recommend using proportional and differential control, as we have not had much luck working with integral controllers. With just proportional control, you’ll tend to oscillate between two positions, but with differential control, you’ll begin to see the oscillations decrease.