Precision/Servo-like DC Motor Control?

Hello All,

I'm trying to use a DC motor with servo-like controls, i.e., to specific a particular turn angle that will be reached, or to maintain constant rotation rate regardless of load. Typically, this requires using a PID feedback algorithm. A basic DC motor has no sensor that can drive a feedback system, but I've seen numerous posts online that seem to indicate that Arduino internals can serve this purpose.

Have any of you achieved precision control of a DC motor one way or another? What sensor/feedback system did you use? (I'm trying to drive rack and pinion steering.)

Many Thanks!

The Arduino can do the PID but you need a suitable feedback mechanism. Typically this will be a shaft encoder that will allow the Arduino to know what position the motor shaft is in. This can be an absolute encoder which produces a number that indicates the current position or a simpler quadrature encoder that gives pulses to let the Arduino know that the shaft has turned one step and in which direction. If you are turning multiple turns then you will need some kind of "home" indicator so the Arduino can determine wen the system is at some known position from which it can measure.

You can measure the rotation rate by measuring the back EMF from the motor. To do this, you have to measure the current drawn by the motor and subtract from the driving voltage the voltage drop due to resistance of the windings. Unfortunately, the winding resistance increases as the motor heats up. So this method isn't very accurate unless you also measure the winding resistance. This is possible, but gets complicated. So it is generally simpler to use a separate sensor to measure the motor rotation.

What sort of vehicle is this rack and pinion steering attached to? I'm not sure you need precision feedback from the motor since it's the position of the vehicle that needs the control. Turning the wheels to an exact angle will not necessarily result in the same position every time due to factors such as speed, traction, etc.
Think about driving your car...
If this is a small scale vehicle a regular hobby servo should take care of the steering needs. Feedback for the position would require a compass and maybe an accelerometer. I'd look into some of the methods used for controlling autonomous vehicles.

I think some folks are trying to make this more complex than it needs to be.

You could use a potentiometer on the output shaft - One side to +5, the other to ground and the wiper to an arduino analog input. You would need a drive for the motor that has forward-reverse. You would then have to figure out the move profile. This approach might tend to hunt as feedback from the pot might be a little coarse. You could instead use an encoder, more prescision, but not self centerring.