Main Content

Gain Calculation and Tuning

Calculate PI controller gains for applying vector control

Motor Control Blockset helps you to select and adjusting the controller gains (PI gains) for the current, speed, and position loops. The gains are initially calculated from the motor’s electrical parameters (resistance, inductance, inertia) and the desired bandwidth or response time of each control loop. In FOC, the current loops (d‑ and q‑axis) are tuned first because they must be fast and well‑damped to ensure proper torque and flux control. The speed loop gains are then tuned to be slower than the current loops, ensuring stable cascaded control. Proper gain calculation and tuning are critical to avoid oscillations, excessive torque ripple, slow response, or even instability in the drive.

Functions

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)

Blocks

expand all

Controllers

PI ControllerDiscrete-time PID Controller (Since R2022a)
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)
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)
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)

Topics

Featured Examples