Problems with current control for a DC motor

ControleCCWendell.plecs (23.0 KB)
I was trying to simulate the current control of a DC motor, where I tested and compared the control in MATLAB, and its response matches the desired requirements. Knowing this, I then tried to apply it to the motor and, for some reason, the circuit oscillates a lot. Do you know any way to fix this issue?

Rafael, when you say “apply it to the motor” do you mean you have physical hardware that you are attempting to control? If so then only you can debug the hardware setup and compare it to your simulation model to determine what is going on.

As to why you see oscillations in your simulation, say in your controller error measurement, it is because you are directly controlling the inductor current without any filtering or sampling. Your current set point is 1 A and with a 20 kHz switching frequency the ripple in your circuit exceeds the average value you’re attempting to control. However, your PI controller filters the high frequency noise and you actually get a reasonable duty cycle controlling the average current. If you increase the switching frequency or inductance, then the ripple to average current ratio will be smaller.

In short, there’s nothing obviously wrong with this simulation and there isn’t enough information to debug your hardware setup and control implementation (which is best discussed with your colleagues and not Plexim).