Motor Control Blockset
Design and implement motor control algorithms
Motor Control Blockset™ provides reference examples and blocks for developing field-oriented control algorithms for brushless motors. The examples show how to configure a controller model to generate compact and fast C code for any target microcontroller (with Embedded Coder®). You can also use the reference examples to generate algorithmic C code and driver code for specific motor control kits.
The blockset includes Park and Clarke transforms, sliding mode and flux observers, a space-vector generator, and other components for creating speed and torque controllers. You can automatically tune controller gains based on specified bandwidth and phase margins for current and speed loops (with Simulink Control Design™).
The blockset lets you create an accurate motor model by providing tools for collecting data directly from hardware and calculating motor parameters. You can use the parameterized motor model to test your control algorithm in closed-loop simulations.
Simulation and Code Generation
Use fully-assembled reference examples as a starting point for designing and implementing field-oriented control algorithms for surface-mount and interior permanent magnet synchronous motors (PMSM). Use these example models to test and verify your algorithm design in closed-loop simulation and reuse the same models to generate and deploy embedded code.
Motor Control Kits
Use reference examples to quickly generate compact and fast C code to implement motor control algorithms for several supported motor control hardware kits. Automatically build and deploy applications to your target microprocessor directly from a Simulink model to test algorithms on the motor hardware. Communicate with and control these target applications from the host machine.
Use Park, Clarke, PI controller, space vector generator, maximum torque per ampere (MTPA), and field weakening blocks to create field-oriented control algorithms in Simulink.
Generate fast and compact floating- or fixed-point code for implementation on an embedded microcontroller (with Embedded Coder). Assess current loop performance with real-time execution profiling.
Rapid Control Prototyping
Test control algorithms in real-time with Simulink Real-Time and the Speedgoat electric motor control kit. The kit consists of a complete software/hardware package to run and test brushless DC motor control algorithms developed with Motor Control Blockset on Speedgoat real-time target hardware using analog and digital I/O.
Use reference examples to calibrate offsets for Hall sensors and quadrature encoders. Then use sensor decoder blocks to process signals from Hall sensors, quadrature encoders, and resolvers to compute rotor position and speed.
Implement sensorless field-oriented control using Sliding Mode Observer and Flux Observer blocks. Use these blocks to compute the rotor electrical position and mechanical speed of a PMSM from measured voltages and currents. Estimate magnetic flux and mechanical torque. Adjust observer parameters and verify observer operation in simulation before generating embedded code.
Initial Controller Tuning
Automatically compute initial PI controller gains for speed and current loops based on motor and inverter parameters. Provided scripts help you analyze current loop dynamics in time and frequency domains by computing and plotting the root locus, Bode diagram, and step response of your current loop (with Control System Toolbox).
Field-Oriented Control Autotuner
Use the Field-Oriented Control Autotuner block to tune speed and current loop gains of field-oriented controllers to achieve specified bandwidth and phase margin for each loop (with Simulink Control Design). Tune the gains in simulation against a plant model. You can also tune the gains in real-time against motor drive hardware using a Speedgoat target computer (with Simulink Real-Time).
Prebuilt Instrumented Tests
Identify the stator resistance, d-axis and q-axis inductance, back-EMF constant, inertia, and friction constant for your motor by using provided reference examples that run predefined tests on your motor.
Parameter Estimation Dashboard
Initiate and control parameter estimation from a Simulink model on a host computer. Save the estimated values to parameterize motor models and to compute controller gains.
Motor and Inverter Models
Model and simulate your surface-mount and interior PMSMs using blocks that implement linear lumped-parameter motor models. Parameterize these models with values determined from instrumented tests. Combine your controller model with a motor model and a provided average-value inverter model for fast closed-loop simulations.
Higher Fidelity Modeling with Simscape Electrical
Model and simulate nonlinear motor dynamics and ideal or detailed switching in the inverter using Simscape Electrical™. Test your field-oriented control algorithms against these high-fidelity motor and inverter models with simulations that incorporate nonlinearities and switching effects.