Hello, I am using NXP MCSPTE1AK144 Motor Control Kit https://www.nxp.com/design/development-boards/automotive-motor-control-solutions/arm-based-solutions...
I am trying to implement a FOC algorithm for 3-phase PMSM. There are three workflows.
The workflow 1 and 2 work well, the motor can run and I can observe signal in the scope. But in workflow 3, I built target model first (Figure 1), then when I run the host model (Figure 3), the motor cannot run. And all of the signals in the scope is like Figure 2.
I just updated the values from workflow 1 and 2 in the target model initialization script mcb_pmsm_foc_hall_MCSPTE1AK144_data.m. The port name was set correct. I am a beginner so I am confused about this. I would be very grateful if anyone can help me about it.
Thanks,
Fanqi.
Figure 1
Figure 2
Figure 3
@stefanvlad what modifications are necessary for this model to run on TORQUE control rather than on SPEED control ?
Hello Fanqi,
Thank you for the details provided above, they helped me understand better your issue,
As a starting point, I recommend using the following software:
Following the described workflows above, all should be fine, I have the same setup on my end, and tested it fine.
From all of the above I find the workflow 2 very important since this will impact the Speed control of the Motor.
In my case, I had to change two motor phases, in order to change the rotation direction for the calibration:
Then I have added this value into the mcb_pmsm_foc_hall_MCSPTE1AK144_data.m script:
Then I save and run the mcb_pmsm_foc_hall_MCSPTE1AK144_data.m again.
Opening the mcb_pmsm_foc_hall_MCSPTE1AK144.slx model, I flashed it on the S32K144 board, pressing Build ( or Ctrl+B on keyboard):
Then opening the mcb_hall_foc_host.slx model and open com port settings, and setting COM4:
You can see in the device manager what COM port your particular board has.
Then I press Run and also toggle from Stop to Start. If the motor does not Start, press the reset button on the board.
The final result with the motor spinning, after pressing the reset button on the board, looks like:
Hope all of the above instructions help you to spin the motor
Best regards,
Stefan