Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program a DC motor for constsnt speed after load applied? 4

Status
Not open for further replies.

aj0159178

Electrical
Oct 2, 2005
1
Trying to develop a program that can keep a dc motor at a constant speed after applying three random weighing loads, and also have a kill switch for a load that is entirely to heavy for the motor. Using a basic stamp 2 and trying to program using PBasic. I am new to this and can use help in any means. Thank you.
 
Replies continue below

Recommended for you

There exist ancient designs for DC motor control circuits that can make a motor run at constant speed regardless of load until it runs out of, er, smoke. National Semi offered the circuit in a chip for a long time, now discontinued for a long time. In all such cases, the circuit had to be tuned for the exact motor to be used, and worked well enough to say that it worked, but not universally well. If the tuning was off in one direction, the load regulation was not good. If it was off in the other direction, the motor would have no speed regulation at all; it would just go as fast as it could.

If I remember correctly, the Basic Stamp has a PWM output that can chop a supply fast enough to make a DC motor run okay at a programmed fraction of its maximum speed. The actual speed developed would still depend on the load. No way is a Basic Stamp fast enough to close the loop and provide constant speed regardless of load, even if you had a way to measure applied load or actual speed.












Mike Halloran
Pembroke Pines, FL, USA
 
Both of these functions are normally included in a standard DC drive. Why not just buy an off-the-shelf DC drive and save the effort?
 
Here's some general directions:
1. Get H-bridge e.g. 4 MOSFETS,
vcc
|----------|
q1 q3
|---motor--|
q2 q4
|----------|
gnd

2. Connect the output of stamp pwm to the gates of q1 & q4,if you chop these but keep q3 & q2 off, the motor will spin one way, if chop [pwm] q3 & q2 but keep q1&q4 off you
reverse. The pwm width will control the speed. I neglected to mention that the top FETs gates need their own floating supplies or charge pump or booststrap to work.
3. To get constant speed, you'll need to incorporate a
controller like a PI or PID, or just a compensator might work for simple stuff. TO control speed you need to measure the speed and compare it to a command [this is command minus actual] then feed this into the pi controller. There is a difference equation for discrete controller. To control the motor, it's best to have a current inner loop w/ another faster pi. Measure the current thru return and compare against the pi generated signal from your speed command. The results is sent to the motor controller.
4. One can write a whole book on the subject--you can short cut this by getting motor driver ICs or buying a drive as was suggested. That way you can focus on the speed controller.
 
Hello;
One way to regulate the speed of a DC motor without speed feedback is to use IR compensation. Measure the current drawn by the motor, multiply by a factor and use the result to increase the output voltage slightly. This type of speed regulation will usually result in a load regulation of 2%.
The reason this works is that the armature circuit of a DC motor very closely approximates a voltage generator in series with a resistor. The voltage generator output is determined by the armature speed. What you are compensating for is the equivelant series resistance of the armature, thus the name IR compensation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor