Current PI

Continuous PI current regulator with back-calculation anti-windup.

  • signal
  • Gradara equations
  • 2 ports
  • 4 parameters
BlockCurrent PIKindcurrentPILibraryControl

Description

A continuous PI controller with a symmetric output limit and back-calculation anti-windup. The input is the current error; the output is a voltage command.

In the field-oriented control example, one instance regulates the d-axis current and another the q-axis current.

Example

PMSM · Field-oriented control 1500 rpm speed command with cascaded d/q current control. A 48 V averaged inverter drives a surface PMSM and a mechanical load that increases at 0.45 s. Ideal current and rotor-position feedback; continuous controllers; no PWM ripple or sensor noise.

Speed commandrpm → rad/sSpeed errorKp · speedKi · speedIntegralPI sumCurrent limitq-axis errorq-axis PIid* = 0 Ad-axis errord-axis PIInverse Park / ClarkeAveraged inverterPMSMMechanical loadClarkePark
In Gradara, select a Current PI block and press F1, then choose Open example. It opens as a new model in My models, ready to run.

Also in this example:SumSubtractConstantLimited integratorClarke transformPark transformInverse transformsThree-phase inverterPMSMMechanical loadStepGainSaturation

Ports

Inputs 1

  • eu

    Control error, typically current reference minus measured current, in amperes.

Outputs 1

  • vy

    Voltage command, in volts, limited to ±limit.

Parameters

  • Proportional gainkp2

    Proportional gain, in volts per unit of error.

  • Integral gainki700

    Integral gain: the integral state rises at ki · u per second.

  • Anti-windup gainkaw350 1/s

    ≥ 0

    Anti-windup gain, in 1/s, 0 or more. How fast the integral state is pulled back while the output is limited. 0 disables anti-windup.

  • Voltage limitlimit27 V

    ≥ 0.1

    Output limit, in volts, at least 0.1. The output is clamped to ±limit.

Equations

Modelica
raw = kp · u + x
y = max(−limit, min(limit, raw))
dx/dt = ki · u + kaw · (y − raw),  x(0) = 0

Implementation

The block’s Modelica model
Real x(start=0, fixed=true);
Real raw;
raw = kp*u + x;
y = max(-limit, min(limit, raw));
der(x) = ki*u + kaw*(y-raw);

Assumptions and limitations

  • Continuous time: no sampling, computation delay, or quantization.
  • The limit is symmetric and fixed. It does not track the available DC-bus voltage.
  • The integral state is not clamped directly; it is held back only through the kaw term.

Tips

  • While y is within ±limit, y − raw = 0 and the block is a plain PI. Once the output limits, the kaw term drives x toward the value that just brings raw back to the limit.
  • A starting point for kaw is ki/kp, which is the default ratio (700/2 = 350).

Used in

These larger examples use it too. Open them from Examples in the app.

  • PMSM · Field-oriented control

See also

Select a block in Gradara and press F1 to open its page offline.