Main Content

Control Algorithm Design

Create controller algorithm for motor control system

Create the torque-control and speed-control subsystems, verify the target execution time, and tune the control gains.

Note

The blocks listed here are compliant with the MISRA C™ guidelines.

Blocks

expand all

Control Reference

ACIM Control ReferenceCompute reference currents for field-oriented control of induction motor (Since R2020b)
ACIM Feed Forward ControlDecouple d-axis and q-axis current to eliminate disturbance (Since R2020b)
ACIM Slip Speed EstimatorCalculate slip speed of AC induction motor (Since R2020b)
ACIM Torque EstimatorEstimate electromechanical torque and power (Since R2020b)
DQ LimiterSaturate voltages (or current) in the dq reference frame (Since R2020a)
MTPA Control ReferenceCompute reference currents for maximum torque per ampere (MTPA) and field-weakening operation (Since R2020a)
PMSM Feed Forward ControlDecouple d-axis and q-axis current to eliminate disturbance (Since R2020a)
PMSM Torque EstimatorEstimate electromechanical torque and power (Since R2020a)
Position GeneratorGenerate position ramp of fixed frequency (Since R2020a)
Six Step CommutationGenerate switching sequence for six-step commutation of brushless DC (BLDC) motor (Since R2020b)
Vector Control ReferenceCompute d and q axis components of reference vector (Since R2020a)
LUT based PMSM Control ReferenceGenerate lookup-table-based control reference currents for field-oriented control of permanent magnet synchronous motor (Since R2022b)
SRM CommutationGenerate switching sequences for n-phase switched reluctance motor (SRM) (Since R2022b)

Controllers

Derating FunctionCompute derating factor (Since R2020a)
PI ControllerDiscrete-time PID Controller (Since R2022a)
Field Oriented Control AutotunerAutomatically and sequentially tune multiple PID control loops in field-oriented control application (Since R2020a)
FOC Default Controller GainsCompute empirical PI controller gains for the field-oriented control (FOC) based algorithms at run time (Since R2023b)
VbyF ControllerImplement V/F (open-loop or scalar) control for three-phase motors (Since R2023b)
Field-Oriented Current ControllerImplement current control for three-phase motors using field-oriented control (FOC) technique (Since R2023b)

Math Transforms

3-Phase Sine Voltage GeneratorGenerate balanced three-phase sinusoidal signals (Since R2020a)
atan2Compute four-quadrant arctangent (Since R2020a)
Clarke TransformImplement ab to αβ transformation (Since R2020a)
Inverse Clarke TransformImplement αβ to abc transformation (Since R2020a)
Inverse Park TransformImplement dq to αβ transformation (Since R2020a)
Park TransformImplement αβ to dq transformation (Since R2020a)
Sine-Cosine LookupImplement sine and cosine functions using lookup table approach (Since R2020a)
PWM Reference GeneratorGenerate modulated signals from phase voltages (Since R2020a)
Protection RelayImplement protection relay with definite minimum time (DMT) trip characteristics (Since R2020a)
Host Serial ReceiveConfigure host-side serial communications interface to receive data from serial port (Since R2020a)
Host Serial SetupConfigure communication ports used by Host Serial Receive and Host Serial Transmit blocks (Since R2020a)
Host Serial TransmitConfigure host-side serial communications interface to transmit data to serial port (Since R2020a)
Hall Speed and PositionCompute speed and estimate position of rotor by using Hall sensors (Since R2020a)
Hall ValidityCompute rotor spin direction and validity of Hall sensor sequence (Since R2020a)
Mechanical to Electrical PositionCompute electrical position of rotor from mechanical position (Since R2020a)
Quadrature DecoderCompute position of quadrature encoder (Since R2020a)
Resolver DecoderCompute motor mechanical position and speed and sine and cosine values of motor electrical position (Since R2020a)
Software Watchdog TimerOutput true until counter reaches maximum count limit (Since R2020a)
Speed MeasurementCompute speed from rotor angular position (Since R2020a)
Sliding Mode ObserverCompute electrical position and mechanical speed of a surface-mount PMSM (Since R2021b)
Flux ObserverCompute electrical position, magnetic flux, and electrical torque of rotor (Since R2020a)
Pulsating High Freq ObserverEstimate initial rotor electrical position of interior PMSM using pulsating high frequency (PHF) injection (Since R2022b)
Extended EMF ObserverCompute electrical position and mechanical speed of permanent magnet synchronous motor (PMSM) (Since R2023a)
IIR FilterImplement infinite impulse response (IIR) filter (Since R2020a)
Vector plotPlot vectors in space domain (Since R2020b)
Position CompensationCompensate for position offset due to different types of delays (Since R2022b)
PLL with Feed ForwardCompute position and angular frequency from orthogonal sinusoidal signals (Since R2023b)

Topics