Main Content

Velocity Controller

Discrete-time velocity controller

  • Velocity Controller block

Libraries:
Simscape / Electrical / Control / General Machine Control

Description

The Velocity Controller block implements a velocity controller in discrete-time.

You provide measured and reference rotor velocities (w and wref) as inputs to the block. The block then outputs a reference torque Tref for an electric drive.

To prevent windup in the integrator, feed the saturated reference torque Tref_sat from the electric drive back to the velocity controller.

Equations

You can control the rotor angular velocity with discrete sample time Ts using one of three common approaches:

  • Proportional-integral (PI) control, with proportional and integral gains Kp_w and Ki_w:

    Tref=(Kp_w+Ki_wTszz1)(wrefw)

  • Proportional (P) control, with proportional gain Kp_w:

    Tref=Kp_w(wrefw)

  • P-PI control characterized by a double velocity feedback loop as shown in the following figure:

    Here, the PI Controller block is structured as in the PI control strategy, and Kv is the proportional gain for a P 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 function in discrete time is

GZC_w(z)=TsKi_wKp_wz+(TsKp_wKi_wKp_wKi_w)

Examples

Ports

Input

expand all

Desired or reference velocity, in rad/s.

Data Types: single | double

Measured mechanical velocity, in rad/s.

Data Types: single | double

Saturated torque reference used for integral anti-windup gain, in N*m.

Data Types: single | double

External reset signal (rising edge) for the integrator.

Data Types: single | double

Output

expand all

Unsaturated reference torque, in N*m.

Data Types: single | double

Parameters

expand all

Type of controller:

  • PI control — Proportional-integral control using a single feedback loop

  • P control — Proportional-integral control using a single feedback loop

  • P-PI control — Proportional and proportional-integral control using a double feedback loop

Dependencies

The Control type options affect the visibility or configurability of these parameters:

  • Controller integral gain

  • P controller proportional gain

  • Anti-windup gain

  • Integral anti-windup gain

  • Sample time (-1 for inherited)

  • Enable zero cancellation

Proportional gain for the:

  • PI controller

  • P controller in the single-loop control model

  • PI controller in the P-PI controller

Integral gain for the PI or P-PI controller.

Dependencies

This parameter is visible only when the Control type is set to PI control or P-PI control.

Proportional gain for the P controller in the P-PI controller.

Dependencies

This parameter is visible only when the Control type is set to P-PI control.

Anti-windup gain for the PI controller.

Dependencies

This parameter is visible only when the Control type is set to PI control or P-PI control.

Time, in s, between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.

If this block is inside a triggered subsystem, inherit the sample time by setting this parameter to -1. If this block is in a continuous variable-step model, specify the sample time explicitly using a positive scalar.

Dependencies

This parameter is visible only when the Control type is set to PI control or P-PI control.

Time, in s, between consecutive discretizations. Discretization is required for zero cancellation.

Dependencies

This parameter is only visible when all these conditions are met:

  • Control type is set to PI control or P-PI control.

  • Sample time is set to -1.

  • Enable zero cancellation is selected .

Option to use zero cancellation on the feedforward path.

Dependencies

The Enable zero cancellation parameter is visible only when Control type is set to PI control or P-PI control.

The Discretization sample time parameter is only visible when Enable zero cancellation is selected .

References

[1] Naouar, M. W., A. A. Naassani, E. Monmasson, and I. Slama-Belkhodja. "FPGA-based predictive current controller for synchronous machine speed drive." IEEE Transactions on Power Electronics. Vol. 23, Number 4, 2008, pp. 2115–2126.

Extended Capabilities

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

Version History

Introduced in R2017b