![]() In a PIL simulation, the generated code runs on the Nucleo boards. In this example, you will learn how to configure a Simulink model to run Processor-in-the-Loop (PIL) simulations. The PIL feature requires Embedded Coder®. Observe the debug signals by performing Monitor & tune (External mode).This example shows you how to use Simulink® Coder™ Support Package for code verification and validation with PIL using STMicroelectronics® Nucleo Boards. NOTE: In this example, the motor is configured to run in only one direction.Ĩ. Increase the motor Reference Speed beyond 10% of base speed to switch from open-loop to closed-loop control. When you run this example on the hardware at a low Reference Speed, due to a known issue, the PMSM may not follow the low Reference Speed.ħ. We designed the open-loop control to run the motor with a Reference Speed that is less than or equal to 10% of base speed. The motor may draw high currents and produce excessive heat. NOTE: Do not run the motor (using this example) in the open-loop condition for a long time duration. Click the Push button again, to start running the motor in the open-loop condition. The motor starts running in a open-loop when the reference speed is between 0 to 0.1 x pmsm.N_base.Ħ. The close loop will start after the reference speed crosses 0.1 x pmsm.N_base (where, pmsm.N_base is the MATLAB™ workspace variable for base speed of the motor). Now gradually rotate the poteniometer in the clockwise direction to increase the speed. View the Simulink Data Inspector.īefore starting the motor, ensure to keep the potentiometer at 0 position by rotating the potentiometer in the anti-clockwise direction.Ĭlick the Push button to start the motor. You can observe from the Diagnostic Viewer that the code is generated for the model and the host connects to the target after loading the generated executable. In the Hardware tab, click Monitor & Tune. For instructions, see Open-Loop Control of 3-Phase AC Motors Using STM32 Processor Based Boards.Ĥ. Compute the ADC offset values obtained from the Open-Loop Control of 3-Phase AC Motors Using STM32 Processor Based Boards. For more, see Open-Loop Control of 3-Phase AC Motors Using STM32 Processor Based Boardsģ. Simulate the target model and observe the simulation results.Ģ. This section shows you to generate code and run the motor.ġ. Generate Code, Deploy and Run on Target Hardware Click Data Inspector on the Simulation tab to view and analyze the simulation results. Click Run on the Simulation tab to simulate the model.ģ. Open a model included with this example.Ģ. Follow these steps to simulate the model.ġ. ![]() The Flux Observer block uses identical inputs to estimate the stator flux, generated torque, and the rotor position. It uses the emf to further estimate the rotor position and rotor speed. The block uses stator voltages and currents as inputs and estimates the electromotive force (emf) of the motor model. The block produces an estimated value that is closely proportional to the measured position. The Sliding Mode Observer (SMO) block generates a sliding motion on the error between the measured and estimated position. In the opened Simulink Library Browser, you can find STM32 Processor Based Boards driver library under Embedded Coder® Support Package for STMicroelectronics® STM32 Processors. Run slLibraryBrowser in MATLAB® Command window to open the Simulink Library Browser. This example uses STM32 peripheral blocks from the Embedded Coder® Support Package for STMicroelectronics® STM32 Processors and MCB library blocks from Motor Control Blockset. You can select either the sliding mode observer or flux observer to estimate the position feedback for the FOC algorithm used in the example.Ī closed-loop FOC algorithm is used to regulate the speed and torque of a three-phase PMSM. This example uses the sensorless position estimation technique. For details about FOC, see Field-Oriented Control (FOC) (Motor Control Blockset). ![]() This example implements the field-oriented control (FOC) technique to control the speed of a three-phase permanent magnet synchronous motor (PMSM) based boards.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |