Main Content

PMSM Current Controller

Discrete-time permanent magnet synchronous machine current controller

  • PMSM Current Controller block

Libraries:
Simscape / Electrical / Control / PMSM Control

Description

The PMSM Current Controller block implements a discrete-time PI-based permanent magnet synchronous machine (PMSM) current controller in the rotor d-q reference frame.

You typically use this block in a series of blocks making up a control structure.

  • You can generate a current reference in the d-q frame to be used as an input to this block with a PMSM Current Reference Generator.

  • You can obtain a voltage reference in the abc domain by converting the output of this block using an Inverse Park Transform block.

You can see an example of a full control structure, from machine measurements to machine inputs, in the PMSM Field-Oriented Control block.

Equations

The block is discretized using the backward Euler method due to its first-order simplicity and its stability.

Two PI current controllers implemented in the rotor reference frame produce the reference voltage vector:

vdref=(Kp_id+Ki_idTszz1)(idrefid)+vd_FF,

and

vqref=(Kp_iq+Ki_iqTszz1)(iqrefiq)+vq_FF,

where:

  • vdref and vqref are the d-axis and q-axis reference voltages, respectively.

  • idref and iqref are the d-axis and q-axis reference currents, respectively.

  • id and iq are the d-axis and q-axis currents, respectively.

  • Kp_id and Kp_iq are the proportional gains for the d-axis and q-axis controllers, respectively.

  • Ki_id and Ki_iq are the integral gains for the d-axis and q-axis controllers, respectively.

  • vd_FF and vq_FF are the feedforward voltages for the d-axis and q-axis, respectively, obtained from the machine mathematical equations and provided as inputs.

  • Ts is the sample time of the discrete controller.

Zero Cancellation

Using PI control results in a zero in the closed-loop transfer function, which can result in undesired overshoot in the closed-loop response. This zero can be canceled by introducing a zero-cancelation block in the feedforward path. The zero cancellation transfer functions in discrete time are:

GZC_id(z)=TsKi_idKp_idz+(TsKp_idKi_idKp_idKi_id),

and

GZC_iq(z)=TsKi_iqKp_iqz+(TsKp_iqKi_iqKp_iqKi_iq).

Voltage Saturation

Saturation must be imposed when the stator voltage vector exceeds the voltage phase limit Vph_max:

vd2+vq2Vph_max,

where vd and vq are the d-axis and q-axis voltages, respectively.

In the case of axis prioritization, the voltages v1 and v2 are introduced, where:

  • v1 = vd and v2 = vq for d-axis prioritization.

  • v1 = vq and v2 = vd for q-axis prioritization.

The constrained (saturated) voltages v1sat and v2sat are obtained as follows:

v1sat=min(max(v1unsat,Vph_max),Vph_max)

and

v2sat=min(max(v2unsat,V2_max),V2_max),

where:

  • v1unsat and v2unsat are the unconstrained (unsaturated) voltages.

  • v2_max is the maximum value of v2 that does not exceed the voltage phase limit, given by v2_max=(Vph_max)2(v1sat)2.

In the case that the direct and quadrature axes have the same priority (d-q equivalence) the constrained voltages are obtained as follows:

vdsat=min(max(vdunsat,Vd_max),Vd_max)

and

vqsat=min(max(vqunsat,Vq_max),Vq_max),

where

Vd_max=Vph_max|vdunsat|(vdunsat)2+(vqunsat)2

and

Vq_max=Vph_max|vqunsat|(vdunsat)2+(vqunsat)2.

Integral Anti-Windup

An anti-windup mechanism is employed to avoid saturation of integrator output. In such a situation, the integrator gains become:

Ki_id+Kaw_id(vdsatvdunsat)

and

Ki_iq+Kaw_iq(vqsatvqunsat),

where Kaw_id and Kaw_iq are the anti-windup gains for the d-axis and q-axis, respectively.

Assumptions

  • The plant model for direct and quadrature axis can be approximated with a first-order system.

  • This control solution is used only for permanent magnet synchronous motors with sinusoidal flux distribution and field windings.

Examples

Ports

Input

expand all

Desired d- and q-axis currents for control of a PMSM, in A.

Data Types: single | double

Actual d- and q-axis currents of the controlled PMSM, in A.

Data Types: single | double

Feedforward pre-control voltages, in V.

Data Types: single | double

Maximum allowable voltage in each phase, in V.

Data Types: single | double

External reset signal (rising edge) for integrators.

Data Types: single | double

Output

expand all

Desired d- and q-axis voltages for control of a PMSM, in V.

Data Types: single | double

Parameters

expand all

Control Parameters

Proportional gain of the PI controller used for direct-axis current control.

Integrator gain of the PI controller used for direct-axis current control.

Anti-windup gain of the PI controller used for direct-axis current control.

Proportional gain of the PI controller used for quadrature-axis current control.

Integrator gain of the PI controller used for quadrature-axis current control.

Anti-windup gain of the PI controller used for quadrature-axis current control.

Sample time for the block (-1 for inherited). If you use this block inside a triggered subsystem, set the sample time to -1. If you use this block in a continuous variable-step model, you can specify the sample time explicitly.

Prioritize or maintain the ratio between the d- and q-axes when the block limits voltage.

Enable or disable zero-cancellation on the feedforward path.

Enable or disable pre-control voltage.

References

[1] Bernardes, T., V. F. Montagner, H. A. Gründling, and H. Pinheiro. "Discrete-time sliding mode observer for sensorless vector control of permanent magnet synchronous machine." IEEE Transactions on Industrial Electronics. Vol. 61, Number 4, 2014, pp. 1679–1691.

[2] Carpiuc, S., and C. Lazar. "Fast real-time constrained predictive current control in permanent magnet synchronous machine-based automotive traction drives." IEEE Transactions on Transportation Electrification. Vol.1, Number 4, 2015, pp. 326–335.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2017b