Designed a PID controller for a DC brushed motor as part of MECH_ENG 333 at Northwestern University.
Here’s the overall control diagram
We have two control loops,
- Monitoring the current through the motor and adjusting to match the requested torque using a heuristic
- Monitoring the actual angle of the motor and determining the appropriate torque
The main feature was turning the motor to a desired angle without significant overshoot. You can see that here
The controller also supported manually setting the PWM, pulse width modulation, tracking a given trajectory and a few other feature designed for testing.
To make sure the inner control loop was working as intended I produced a graph goal current (red circle) vs the actual current (red triangle). The PWM is shown in green though it is less important. This showed that although there is noise the current and goal current map fairly closely.