-
Notifications
You must be signed in to change notification settings - Fork 1
02_basicVectorControl_labEmbeddedModel
For a successful experimental velocity vector control, the control strategy needs to be initially applied in simulation. A simulation of the motor and it's control is proposed in the section. The simulation permits to develop the embedded Simulink file.
-
Start Simulink.
-
In the Simulink Start Page, create a model from the template : MCLV 48V 300W - dsPIC33AK128MV106 DIM
-
A Simulink model opens :
-
This model requires some configurations to be adapted to the motor parameters. Double click on the Board Subsystem and configure following parameters :
-
Set Board Variants as Internal Op-amp. It allows the use on micro-controller internal operational amplifier for ADC measurements
-
Set motor pole pairs to 4
-
Set Optical Encoder resolution per Mechanical Rotation to 4000
-
Set Optical encoder reset to on index signal and keep the offset equal to 0, since the motor has an encoder with index signal.
-
Save the model.
-
A the end the block should looks like :
-
To not hesitate to click on the gray arrow in the left bottom conner of the block to open the template and feel free to explore the Simulink model.
-
-
-
On the model, you may add the LED blink blocks realized previously to ensure that the microcontroller is working correctly
-
Add also the UART Tx-Matlab Block To visualize the signals using tue Serial Link.
-
On the PWM input of the template, add three sinusoidal functions
- To visualize the signals with picgui, download the DataVisu.m script, and write DataVisu in the main window as follows. This will allow you the visualize the different signals properly.
- You should visualize the following plot:
- Open the simulation file MCU_vectorControl_Simulation.slx and the script MCU_initVectorControlParameters.m
To run this simulink model, first run the mfile and then run the simulink file. Explore the simulation file and the different modes.
-
Migrate the controller from simulation to the motor program step by step.
- Try first the park transformation
- Then go for speed control