Main Content

Design Field-Oriented Control Algorithm

To implement the speed control algorithm for a motor, perform these tasks:

  • Current scaling — Convert current from ADC counts to PU.

  • Quadrature encoder position decoding — Read the quadrature encoder position counts and calculate the rotor electrical position.

  • Torque control — Implement current control in thed-qaxis.

  • Speed control — Implement speed control.

These steps help you implement the speed control algorithm for a PMSM using Motor Control Blockset™ and are related to the modelmcb_pmsm_foc_qep_f28379dused in the exampleField-Oriented Control of PMSM Using Quadrature Encoder. They explain the procedure to tune the control parameters ford-axis andq-axis current controllers and the speed controller.

In these steps, variables are used to define datatypes and execution times of the current and speed controllers. See the initialization script linked to the example modelmcb_pmsm_foc_qep_f28379dfor details about the variables defined in these steps.

Tip

A basic understanding of Simulink®is a prerequisite for following this workflow as these workflow steps do not provide details on tasks like defining a datatype in a constant block or using math operations blocks in Simulink.

SeeEstimate PMSM Parameters Using Recommended Hardwarefor estimating the motor parameters. Then, seeCreating Plant Model Using Motor Control Blocksetto design a plant model. This helps you verify the control algorithm in simulation.