How to implement and validate motor control algorithms | Field-Oriented Control of Induction Motor with Simulink, Part 4
Learn how to implement field-oriented control algorithms for induction motors using reference examples included with Motor Control Blockset™. Verify the performance of your algorithm in a closed-loop simulation, then generate code and deploy it on an embedded microcontroller using Embedded Coder®.
With motor control block set, you can now design and implement control algorithms for induction motors starting in MATLAB release 2020B. The reference examples provided with the block set help you simulate the control algorithm against inverter and motor models. You can also generate code from the same reference example that runs at 20 kilohertz on your microcontroller.
This is a shipping reference example, and a motor control block set for induction motors. It's very much similar to the reference example for PMSM. You can refer to this video on PMSM for more details. New blocks for induction motor include the ACIM control reference block, which accepts reference dark and feedback speed values and computes the corresponding b axis and q axis reference currents for the speed reference value.
This is in addition to the PI controller, which controls the rotor speed and generates an equivalent reference dot for the overall speed control objective. Similar to the PMSM reference example, you can implement the field oriented control algorithm using Clarke, Park, Inverse Park, Space Vector Generator, and the PI controllers for the ID and IQ current loops.
Further, the current control algorithm implements a feed forward control using the newly added ACIM feed forward control block to decouple the d access and q access currents required for implementing the field oriented control [INAUDIBLE]. A new torque estimator block has also been added to the motor control library, which estimates the electromechanical torque and power using feedback values of d and q axis currents and motor speed feedback.
In induction motors, the electric speed is different from the mechanical speed. And hence, the newly added ACIM slip speed estimate of block helps estimate the slip speed for field oriented control of induction motors. As in the PMSM reference example, you can process position and speed measurements by converting the quadrature encoded readings to position and speed, using these blocks that are provided by the motor control block set.
Verify the control algorithm against linear black models for induction motor and inverter using their respective blocks available from the motor control library. Simulate the model using the run button under the simulation tab, and view the results in data inspector. You can log and visualize any signal of your interest in your model, such as speed, load torque, ID IQ currents, phase A voltage as seen by the motor, the space vector modulation signals, and other signals.
You can analyze the response of the motor control algorithm to different scenarios, such as the impact of variation in the motor load torque or speed reversal on the IQ current, as shown here, and the corresponding change in the phase A voltage and space vector modulation signals. These are well known duty cycle modulation signals, with the characteristic shapes that we obtained with space vector modulation.
You can verify the controller performance by modifying the control parameters, and run multiple simulations until you reach an acceptable level of performance. An interesting point to note here is that no data points are dropped in the simulation results, thus making Simulink an important debugging tool. Taking a closer look at the timing religion legend reveals that the inner current loop-- which is shown in green here-- runs at 20 kilohertz.
At the outer speed control-- shown in blue-- runs 10 times slower at 2 kilohertz. Next, you can move on to implementing your algorithm on the embedded microcontroller by clicking on the build, deploy, and start button. This generates code from the Simulink model, deploys it on the DSC 2000 hardware used in this demo, and then, it starts the execution.
Once completed, you can now spin the motor using the host model. This model establishes [INAUDIBLE] communication with the motor. For the hardware demo, we have an easy induction motor coupled to a shaft to a PMSM to create a dyno setup. The PMSM provides speed feedback and acts as a load to the induction motor.
The generated code is running on this DSC 2000 processor. You can set the reference speed here, and start and stop the motor using this button. Change the reference speed values and observe how the control algorithm tracks them. Now, let's try a speed reversal.
You can also take a look at the performance of the ID and IQ currents by selecting them here. Normalized values are displayed in the oscilloscope. Visualize torque and power. And the three phase currents, as well, using this model. As mentioned earlier, the generated code for the current control loop is running at 20 kilohertz on the DI hardware-- that is, under 50 microseconds.
And the actual field oriented control algorithm executes in under 10 microseconds. So try it out, and see how you too can design and deploy your motor control algorithms for induction motors on your embedded hardware using motor control block set and embedded coder.
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.