Electronics > Electronics

Using PWM to control DC motor output torque


Hey, I am using Roboclaw as my dc motor driver and changing the duty cycle of input PWM can control speed. Now I have some robotic applications which requires certain value of torque from the dc motor. As for the dc motor, the output torque is proportional to the armature current and RoboClaw can directly read armature current, I plan to use the current value as feedback to control the torque. However, it seems that the duty cycle of PWM directly controls speed, not torque. So can I just use PID to complete this control requirement?

If you do not use encoder feedback, then the PWM duty cycle controls exactly the PWM duty cycle.
If the load is constant, then a specific duty cycle will correspond to a specific speed.
A specific duty cycle will also correspond to a specific amp draw with constant load, if the motor is either running well, or is perfectly stalled with brushes in contact. For very slow moving motors, the brush mechanism may introduce non-trivial nonlinearities.

If you have a motor with a known current/torque relation, and you can read the present current back, and you can control the duty cycle, then a P (or PID) controller can be a reasonable substitute for constant-torque control.

Thank you for replying! If I'd like to generate more complicated torque, such as increasing linearly in 5 second. Can I still tune the armature current? Or I need torque sensor?

I don't know how often the current sensor will sample and return information, although there is a command to return encoder information with 8 milliseconds resolution, so that may be the resolution. If you are OK with the resolution you will get from transmitting serial commands, then yes, you can adjust the current through PWM over the serial bus.
I recommend that you do the math on timing yourself -- how tight a control loop do you need, how many milliseconds of latency, how much overshoot, ...


[0] Message Index

Go to full version