Main Content

Vector Control

Design motor control algorithms using vector control techniques like Field-Oriented Control (FOC) and Direct Torque Control (DTC)

Field-Oriented Control (FOC), helps you achieve high-performance dynamics in both Permanent Magnet Synchronous Motors (PMSM) and Induction Motors. The fundamental principle of FOC is the decoupling of stator current vectors into two orthogonal components: one for magnetic flux and the other for torque production. This decoupling is facilitated by mathematical abstractions known as the Clarke and Park transformations. First, the Clarke transformation converts the three-phase stationary current signals into a two-phase stationary alpha-beta frame. Subsequently, the Park transformation rotates these stationary vectors into a synchronous d-q frame that rotates in alignment with the rotor's magnetic field. By converting complex AC waveforms into DC-like quantities, FOC allows for the independent and precise control of torque and flux.

The Simulink model that you create using Motor Control Blockset can be used to integrate the power inverter, the motor’s mathematical representation, and the FOC algorithm consisting of nested Proportional-Integral (PI) control loops. You can simulate FOC for both PMSM and Induction Motors by adjusting the machine block parameters and the specific flux estimation logic required for each motor type.

Motor Control Blockset also supports Direct torque control (DTC), which is a vector motor control technique that implements motor speed control by directly controlling the flux and torque of the motor. Unlike field-oriented control (FOC) that controls d- and q-axis motor currents, the DTC algorithm estimates the torque and flux values from the motor position and currents. Then it uses PI controllers to control the motor torque and flux to eventually generate the optimum voltages that run the motor.

Note

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

Functions

mcb.PMSMCharacteristicsCompute and plot PMSM drive characteristics and constraint curves (Since R2022b)
mcb.ACIMCharacteristicsCompute and plot ACIM characteristic curves (Since R2022a)
mcb.getPIControllerParametersCompute gains for PI controller in field-oriented control
mcb.calcFOCGainsCompute gains and transfer functions for PI controller in field-oriented control of PMSM (Since R2025a)
mcb.getMotorControlAnalysisFrequency-domain analysis plots for PI controller of field-oriented control

Blocks

expand all

Controllers

Field Oriented Control AutotunerAutomatically and sequentially tune multiple PID control loops in field-oriented control application
FOC Default Controller GainsCompute controller gains for the FOC based algorithms at run time based on empirical method or optimum theory (Since R2023b)
Field-Oriented Current ControllerImplement current control for three-phase motors using field-oriented control (FOC) technique (Since R2023b)
MTPA Control ReferenceCompute reference currents for maximum torque per ampere (MTPA) and field-weakening operation

Control Reference

ACIM Control ReferenceCompute reference currents for field-oriented control of induction motor
ACIM Feed Forward ControlDecouple d-axis and q-axis current to eliminate disturbance
ACIM Slip Speed EstimatorCalculate slip speed of AC induction motor
ACIM Torque EstimatorEstimate electromechanical torque and power
PMSM FeedForward ControlDecouple d-axis and q-axis current to eliminate disturbance
PMSM Torque EstimatorEstimate electromechanical torque and power
Position GeneratorGenerate position ramp of fixed frequency
Vector Control ReferenceCompute d and q axis components of reference vector
SRM CommutationGenerate switching sequences for n-phase switched reluctance motor (SRM) (Since R2022b)
SynRM FeedForward ControlDecouple d-axis and q-axis current to eliminate disturbance (Since R2024a)
SynRM Torque EstimatorEstimate electromechanical torque and power (Since R2024a)

Math Transforms

3-Phase Sine Voltage GeneratorGenerate balanced three-phase sinusoidal signals
atan2Compute four-quadrant arctangent
Clarke TransformImplement ab to αβ transformation
Inverse Clarke TransformImplement αβ to abc transformation
Inverse Park TransformImplement dq to αβ transformation
Park TransformImplement αβ to dq transformation
SinCos Embedded OptimizedImplement sine and cosine functions (Since R2024b)
PWM Reference GeneratorGenerate modulation signals, duty cycles, and phase voltages from reference voltages based on modulation method
6-Phase VSD TransformCompute vector space decomposition (VSD) based transformation on six-phase inputs (Since R2024b)
6-Phase Inverse VSD TransformCompute vector space decomposition (VSD) based inverse transformation on orthogonal inputs (Since R2024b)
Phase Current Extractor for Single Shunt FOCTransform DC shunt currents into phase currents for single shunt FOC (Since R2026a)
PWM Phase Shift for Single Shunt FOCAdd phase shift in three-phase PWM pulses for single-shunt FOC (Since R2026a)
Protection RelayImplement protection relay with definite minimum time (DMT) trip characteristics
Host Serial ReceiveConfigure host-side serial communications interface to receive data from serial port
Host Serial SetupConfigure communication ports used by Host Serial Receive and Host Serial Transmit blocks
Host Serial TransmitConfigure host-side serial communications interface to transmit data to serial port
Hall Speed and PositionCompute speed and estimate position of rotor by using Hall sensors
Hall ValidityCompute rotor spin direction and validity of Hall sensor sequence
Mechanical to Electrical PositionCompute electrical position of rotor from mechanical position
Quadrature DecoderCompute position of quadrature encoder
Resolver DecoderCompute motor mechanical position and speed and sine and cosine values of motor electrical position
Software Watchdog TimerOutput true until counter reaches maximum count limit
Speed MeasurementCompute speed from rotor angular position
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
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
Vector plotPlot vectors in space domain
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)
Compute ParameterExtend functionality of blocks by enabling additional inputs (Since R2024a)
Dead-Time CompensatorOvercome dead-time effect by modifying reference voltages (Since R2024a)
Protocol EncoderEncode input data into a uint8 byte stream by specifying the packet structure (Since R2024a)
Protocol DecoderDecode a uint8 byte stream by specifying the packet structure (Since R2024a)
Byte PackConvert input signals to uint8 vector (Since R2024a)
Byte Unpack Convert uint8 vector to input signals (Since R2024a)
Byte ReversalReverse order of bytes in input word (Since R2024a)
Memory CopyCopy data from and to memory section (Since R2024a)

Topics

Featured Examples