Go Down

### Topic: Precision/Servo-like DC Motor Control? (Read 2328 times)previous topic - next topic

#### ScienceDWB

##### Jan 31, 2012, 05:53 pm
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!
If computer programmers came before linguistics, palendrome would probably be a palendrome.

#### johnwasser

#1
##### Jan 31, 2012, 06:30 pm
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.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

#### dc42

#2
##### Jan 31, 2012, 07:11 pm
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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### Yankee

#3
##### Feb 01, 2012, 04:55 am
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.
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.

#### kf2qd

#4
##### Feb 01, 2012, 07:23 pm
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.

Go Up

Please enter a valid email to subscribe