Control Algorithm Design
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
Controls
Control Reference
ACIM Control Reference | Compute reference currents for field-oriented control of induction motor (Since R2020b) |
ACIM Feed Forward Control | Decouple d-axis and q-axis current to eliminate disturbance (Since R2020b) |
ACIM Slip Speed Estimator | Calculate slip speed of AC induction motor (Since R2020b) |
ACIM Torque Estimator | Estimate electromechanical torque and power (Since R2020b) |
DQ Limiter | Saturate voltages (or current) in the dq reference frame (Since R2020a) |
MTPA Control Reference | Compute reference currents for maximum torque per ampere (MTPA) and field-weakening operation (Since R2020a) |
PMSM Feed Forward Control | Decouple d-axis and q-axis current to eliminate disturbance (Since R2020a) |
PMSM Torque Estimator | Estimate electromechanical torque and power (Since R2020a) |
Position Generator | Generate position ramp of fixed frequency (Since R2020a) |
Six Step Commutation | Generate switching sequence for six-step commutation of brushless DC (BLDC) motor (Since R2020b) |
Vector Control Reference | Compute d and q axis components of reference vector (Since R2020a) |
LUT based PMSM Control Reference | Generate lookup-table-based control reference currents for field-oriented control of permanent magnet synchronous motor (Since R2022b) |
SRM Commutation | Generate switching sequences for n-phase switched reluctance motor (SRM) (Since R2022b) |
LUT based SynRM Control Reference | Generate lookup-table-based control reference currents for field-oriented control of SynRM and PMaSynRM (Since R2024a) |
SynRM FeedForward Control | Decouple d-axis and q-axis current to eliminate disturbance (Since R2024a) |
SynRM Torque Estimator | Estimate electromechanical torque and power (Since R2024a) |
Controllers
Derating Function | Compute derating factor (Since R2020a) |
PI Controller | Discrete-time PID Controller (Since R2022a) |
Field Oriented Control Autotuner | Automatically and sequentially tune multiple PID control loops in field-oriented control application (Since R2020a) |
FOC Default Controller Gains | Compute empirical PI controller gains for the field-oriented control (FOC) based algorithms at run time (Since R2023b) |
VbyF Controller | Implement V/F (open-loop or scalar) control for three-phase motors (Since R2023b) |
Field-Oriented Current Controller | Implement current control for three-phase motors using field-oriented control (FOC) technique (Since R2023b) |
I-F Controller | Implement I-F control for a three-phase permanent magnet synchronous motor (Since R2024a) |
Math Transforms
3-Phase Sine Voltage Generator | Generate balanced three-phase sinusoidal signals (Since R2020a) |
atan2 | Compute four-quadrant arctangent (Since R2020a) |
Clarke Transform | Implement ab to αβ transformation (Since R2020a) |
Inverse Clarke Transform | Implement αβ to abc transformation (Since R2020a) |
Inverse Park Transform | Implement dq to αβ transformation (Since R2020a) |
Park Transform | Implement αβ to dq transformation (Since R2020a) |
SinCos Embedded Optimized | Implement sine and cosine functions (Since R2024b) |
PWM Reference Generator | Generate modulated signals from phase voltages (Since R2020a) |
6-Phase VSD Transform | Compute vector space decomposition (VSD) based transformation on six-phase inputs (Since R2024b) |
6-Phase Inverse VSD Transform | Compute vector space decomposition (VSD) based inverse transformation on orthogonal inputs (Since R2024b) |
Protection and Diagnostics
Protection Relay | Implement protection relay with definite minimum time (DMT) trip characteristics (Since R2020a) |
Host Serial Receive | Configure host-side serial communications interface to receive data from serial port (Since R2020a) |
Host Serial Setup | Configure communication ports used by Host Serial Receive and Host Serial Transmit blocks (Since R2020a) |
Host Serial Transmit | Configure host-side serial communications interface to transmit data to serial port (Since R2020a) |
Sensor Decoders
Hall Speed and Position | Compute speed and estimate position of rotor by using Hall sensors (Since R2020a) |
Hall Validity | Compute rotor spin direction and validity of Hall sensor sequence (Since R2020a) |
Mechanical to Electrical Position | Compute electrical position of rotor from mechanical position (Since R2020a) |
Quadrature Decoder | Compute position of quadrature encoder (Since R2020a) |
Resolver Decoder | Compute motor mechanical position and speed and sine and cosine values of motor electrical position (Since R2020a) |
Software Watchdog Timer | Output true until counter reaches maximum count limit (Since R2020a) |
Speed Measurement | Compute speed from rotor angular position (Since R2020a) |
Sensorless Estimators
Sliding Mode Observer | Compute electrical position and mechanical speed of a surface-mount PMSM (Since R2021b) |
Flux Observer | Compute electrical position, magnetic flux, and electrical torque of rotor (Since R2020a) |
Pulsating High Freq Observer | Estimate initial rotor electrical position of interior PMSM using pulsating high frequency (PHF) injection (Since R2022b) |
Extended EMF Observer | Compute electrical position and mechanical speed of permanent magnet synchronous motor (PMSM) (Since R2023a) |
Signal Management
IIR Filter | Implement infinite impulse response (IIR) filter (Since R2020a) |
Vector plot | Plot vectors in space domain (Since R2020b) |
Position Compensation | Compensate for position offset due to different types of delays (Since R2022b) |
PLL with Feed Forward | Compute position and angular frequency from orthogonal sinusoidal signals (Since R2023b) |
Compute Parameter | Extend functionality of blocks by enabling additional inputs (Since R2024a) |
Dead-Time Compensator | Overcome dead-time effect by modifying reference voltages (Since R2024a) |
Protocol Encoder | Encode input data into a uint8 byte stream by specifying the packet structure (Since R2024a) |
Protocol Decoder | Decode a uint8 byte stream by specifying the packet structure (Since R2024a) |
Byte Pack | Convert input signals to uint8 vector (Since R2024a) |
Byte Unpack | Convert uint8 vector to input signals (Since R2024a) |
Byte Reversal | Reverse order of bytes in input word (Since R2024a) |
Memory Copy | Copy data from and to memory section (Since R2024a) |
Topics
- Design Field-Oriented Control Algorithm
Design and integrate the torque-control and speed-control subsystems.
- Estimate Control Gains and Use Utility Functions
Perform control parameter tuning for speed and torque control subsystems.
- Code Verification and Profiling Using PIL Testing
This example explains PIL profiling on Texas Instruments® LAUNCHXL-F28379D hardware board.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)