Pages: [1]   Go Down
Author Topic: Precision/Servo-like DC Motor Control?  (Read 1516 times)
0 Members and 1 Guest are viewing this topic.
New York City
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

If computer programmers came before linguistics, palendrome would probably be a palendrome.

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8967
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

St. Louis, Missouri
Offline Offline
Sr. Member
****
Karma: 1
Posts: 279
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1025
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: