Basic Current Controller Design for Motor Drives
Overview
This demonstration shows how to obtain the loop-gain \(L(s)\) of a current-controlled, three-phase drive system using the PLECS Multitone AnalysisTool. Furthermore, calculations of the PI current controller parameters based on specifications of the crossover frequency and required phase margin are shown in detail.
Fig. 1 System overview
Note
Model
Plant
The inverter circuit in Fig. 1 is modeled as an ideal three-legged bridge with a stiff \(400\,\mathrm{V}_{\mathrm{dc}}\) supply. The six IGBTs are switched by means of a space-vector modulator to realize the phase voltages commanded by the vector current control. The three-phase currents are measured for closed-loop current control, where a traditional PI controller is used for current regulation in the d- and q-axes. The mechanical speed and angle are measured and scaled by the number of pole-pairs to determine the electrical speed and angle.
Machine Model
The AC motor is a synchronous machine with surface-mounted magnets and no saliency (\(L_{\mathrm{sd}} = L_{\mathrm{sq}}\)). The phase currents are transformed from the three-phase abc-frame to the two-dimensional rotating reference dq-frame aligned to the rotor position. The transformation into the dq-frame converts an AC system into an equivalent DC system. This enables the use of traditional PI controllers with zero steady-state error. However, the transformation into the dq-frame introduces cross-coupling between the q- and d-axes, which have to be considered in the controller structure.
The dq-frame model can be described with the equations shown above, where \(\omega_{\mathrm{e}}\) is the synchronous frequency, and \(\psi_{\mathrm{m}}\) is the amplitude of the stator flux linkages due to the permanent magnet. For simplicity it is assumed that the magnet strength is constant and the machine doesn’t experience saturation.
Controller Design
Plant transfer function
Rotor-field oriented control is applied to the drive system, where the stator current is regulated in the rotating reference frame. The d- and q-axis currents are controlled with PI controllers tuned in order to respect a specified crossover frequency and phase margin, which is explained hereafter. By using decoupling and feed-forward terms in the control structure the plant for the current controller operating in the rotating reference frame design is simplified significantly and can be written as:
The transfer function for the q-axis is identical.
Time delays
Digital control always introduces time delays, mainly due to PWM generation, ADC sampling and the calculation time of the control algorithm on the microcontroller. The total time delay will reduce the achievable control bandwidth and also the closed-loop system stability. Expected time delays should be respected during the controller design process, especially if the tuning-method relies on a mathematical model of the plant to derive the controller parameters. For this demo, two different sources of time delay are taken into account:
The finite computation time of the control algorithm on the microcontroller: \(T_{\mathrm{calc}} = T_{\mathrm{sw}}/2\)
The average time delay introduced by the pulse-width modulator operating in single-update mode: \(T_{\mathrm{PWM}} = T_{\mathrm{sw}}/2\)
The equivalent total delay \(T_{\mathrm{d}}\) therefore sums up to one control calculation time step:
Approximating this time delay as a rational transfer function simplifies the controller design. For this, the Padé approximation can be used. In this example, the time delay is approximated by a second-order Padé approximation. The transfer function has the following form, where the coefficients are calculated in Octave or MATLAB by using the function \({\small\tt padecoeff}(T_d, 2)\):
Controller design
The continuous time transfer function of a PI controller in parallel form can be written as:
The loop gain \(L(s)\) is a multiplication of the plant transfer function \(P(s)\), the PI controller transfer function \(C(s)\) and the time delay approximation \(D_{\Sigma}(s)\):
Hereafter, the plant and the equivalent time delay transfer functions are summarized as a single transfer function:
The main idea of the “Closed-Form Crossover Specification” method is to calculate the PI controller parameters \(k_{\mathrm{p}}\) , \(k_{\mathrm{i}}\) such that the loop gain has the specified crossover frequency \(\omega_{\mathrm{c}}\) and phase margin \(\varphi_{\mathrm{m}}\). In order to obtain meaningful controller parameters the specifications must be compatible with the constraints of the control system and the plant. If this is not the case, the closed-form calculation can even lead to an unstable system behavior.
At the desired crossover frequency \(\omega_{\mathrm{c}}\), the magnitude \(r_{\mathrm{P}}\) and the phase \(\varphi_{\mathrm{P}}\) of the plant are defined as:
and can be calculated by using the Octave function \([r_{\mathrm{P}}\), \(\varphi_{\mathrm{P}}]\) = \({\small\tt bode}(P_\mathrm{D}, \omega_\mathrm{C})\).
Using the calculated parameters \(r_{\mathrm{P}}\), \(\varphi_{\mathrm{P}}\) from the plant transfer function and the two design specifications \(\omega_{\mathrm{c}}\), \(\varphi_{\mathrm{m}}\), the PI controller parameters \(k_{\mathrm{p}}\) and \(k_{\mathrm{i}}\) can be calculated in a closed form by using the following two equations:
Fig. 2 shows the loop-gain \(L(s)\) with the designed control parameters. The controller bandwidth and phase-margin requirements are achieved.
Fig. 2 Loop-Gain transfer function analytically calculated for \(\omega_{\mathrm{c}} = 1000\,\mathrm{Hz}\) and \(\varphi_{\mathrm{m}} = 55^{\circ}\)
Simulation
PLECS allows one to measure the frequency response of a physical system to a small perturbation signal. A small-signal analysis of three-phase systems can be performed by first converting the three-phase AC values into the rotating reference frame. This transformation allows the configuration of a small-signal analysis around the steady-state operating point.
Note
In this example it is assumed that the controller decoupling is achieved and the system is decoupled in the dq-frame. If this is not the case the plant behaves as a Multiple-Input/Multiple-Output (MIMO) system. Such a system requires the use of more sophisticated multivariable controllers. The frequency analysis is limited to the q-axis but to obtain a complete picture it is important to observe the effect of perturbation of the q-axis system on both the q- and d-axis systems (and vice versa).
Loop Gain
To run an analysis, choose Analysis tools… from the Simulation menu, then select the “Loop Gain” analysis from the list and click Start analysis.
Fig. 3 Loop-Gain transfer function measured on the physical system model in PLECS
In this simulation, a loop-gain meter is used on the q-axis current to obtain the loop gain of the closed-loop controlled motor drive system. From the graph it can be seen that the system exhibits the characteristics of an integrator near DC, thus eliminating any steady-state error between the reference and the controlled value. It can be verified that the design specifications for controller bandwidth (\(\omega_{\mathrm{c}} = 1000\,\mathrm{Hz}\)) and phase-margin (\(\varphi_{\mathrm{m}} = 55^{\circ}\)) are met. The slope of the system magnitude is \(-20\,\mathrm{dB}\) per decade around the cross-over frequency and the gain-margin is \(8\,\mathrm{dB}\). Thus, the system is stable. The frequency response measured in PLECS shows a good agreement with the frequency response of the analytical calculation shown in Fig. 2.
Fig. 4 Reference-to-output transfer function measured on the physical system model in PLECS
Reference-to-Output Transfer Function
The frequency analysis for a reference-to-output transfer function, where the plant is the motor drive system, can be obtained by perturbing the d- or q-axis setpoints and observing the effects on the corresponding d- or q-axis quantity. In this simulation, the q-axis current setpoint is perturbed and the effects of the perturbation are observed in the q-axis current. The frequency analysis shows the characteristics of a low pass filter as is expected based on the loop gain.
Limitations
The transfer functions in the simulations above only show the behavior up to half of the switching frequency. This is because the Delay block representing the controller calculation time, the modulator and the switching network are non-linear elements. The modulator becomes non linear for perturbation frequencies above \(f_{\mathrm{sw}}/2\). In order to get corresponding results from the analytical calculation and the PLECS Analysis Tool at frequencies higher than \(f_{\mathrm{sw}}/2\), these elements need to be linearized manually.
This linearization is implemented in this demo model. The initialization script features a parameter config that can take the value 'switched' or 'averaged'. Using the average configuration the results shown in Fig. 5 can be obtained.
Fig. 5 Loop gain calculation using a completely linearized system
Conclusion
This example shows how the PLECS Analysis Tools can be used to measure a transfer function directly in a model of a physical system. In addition, an analytical controller design based on specifications in the frequency domain is presented.
Bibliography
[1]
Guzzella, L.. “Analysis and Synthesis of Single-Input/Single-Output Control Systems.” (2019).