S32K144 FOC using Hall sensor - motor cannot run

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K144 FOC using Hall sensor - motor cannot run

817 Views
fanqi1
Contributor I

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.

  • Workflow 1 - Run 3-Phase PMSM in Open-Loop Control and Calibrate ADC Offset.
  • Workflow 2 - Calibrate Hall Sensor Offset for PMSM Motor.
  • Workflow 3 - Field-Oriented Control of PMSM Using Hall Sensor.

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.

 

 mcb_pmsm_foc_hall_MCSPTE1AK144 - Simulink academic use 24_02_2023 16_00_26.png

Figure 1

Scope 24_02_2023 16_00_04.png

Figure 2

mcb_hall_foc_host _ - Simulink academic use 24_02_2023 16_37_25.png

Figure 3

0 Kudos
2 Replies

359 Views
srnp6037
Contributor I

@stefanvlad what modifications are necessary for this model to run on TORQUE control rather than on SPEED control ?

0 Kudos

736 Views
stefanvlad
NXP Employee
NXP Employee

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.

  • Workflow 1 - Run 3-Phase PMSM in Open-Loop Control and Calibrate ADC Offset.
  • Workflow 2 - Calibrate Hall Sensor Offset for PMSM Motor.
  • Workflow 3 - Field-Oriented Control of PMSM Using Hall Sensor.

 

Workflow 2

 

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:

stefanvlad_1-1679577235934.png

Then I have added this value into the mcb_pmsm_foc_hall_MCSPTE1AK144_data.m script:

stefanvlad_2-1679577287546.png

Then I save and run the mcb_pmsm_foc_hall_MCSPTE1AK144_data.m again.

 

Workflow 3

 

Opening the mcb_pmsm_foc_hall_MCSPTE1AK144.slx model, I flashed it on the S32K144 board, pressing Build ( or Ctrl+B on keyboard):

stefanvlad_3-1679577441862.png

Then opening the mcb_hall_foc_host.slx model and open com port settings, and setting COM4:

stefanvlad_5-1679578410819.png

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:

stefanvlad_0-1679576373009.png

 

Hope all of the above instructions help you to spin the motor

Best regards,

Stefan

0 Kudos