Skip to main content
Associate III
July 13, 2025
Solved

How can I drive the motor with the open loop APIs

  • July 13, 2025
  • 2 replies
  • 433 views

Hello Everybody,

MCSDK:6.3.2

CubeMX: 6.1.4

Workbench : 6.3.2

 

I want to test the motor first with the open loop APIs. I follow the instructions of the user mannual and write the code as follows:

code1.jpg

My question is: I captured the U, V, and W three-phase waveforms using an oscilloscope and found that the duty cycle settings are correct. However, the waveforms remain stuck in only one section (they never change) and fail to drive the motor through all six sections. Could you help analyze what might be causing this issue? Thanks!

Best answer by Gael A

Hello DF_MC,

The REV_PARK_ANGLE_COMPENSATION_FACTOR is a parameter set to 0 by default as it corresponds at a specific feature which is not relevant for Open Loop. This factor is meant to be used when the speed is so high that the movement of the rotor between the sampling and the setting of the command needs to be taken into account.


To be able to understand your issue more precisely, could you please have a look at the following questions ?

Can you please have a look at a broader picture of the duty cycles to make sure the duties always stay identical ?Can you have a look at the current waveforms to be sure ?
Are you sure your reference speed is taken into account ? Have you tried increasing the target speed ?

2 replies

Gael A
ST Employee
July 16, 2025

Hello DF_MC,

I am not sure I understand your case. Could you please provide the oscilloscope's waveform and explain it again with the data you provide ?

In addition, I tried your piece of code for a single motor with MCSDK 6.3.2, and a custom setup, and everything works on my side. Could you please also provide info on the setup you are using (board(s) and motor) ?

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.Hope this will help,Gaël A.
DF_MCAuthor
Associate III
July 18, 2025

Hello Gaël,

Thank you for your reply. The oscilloscope waveform is attached. The generated PWM signal appears to be fixed in a specific section and does not change. The blue waveform represents the U-phase signal, while the yellow waveform represents the W-phase signal. The U-phase waveform differs from those of V and W, whereas the V and W waveforms are identical. I also observed the PWM signal pins on the MCU using an oscilloscope. The MCU's signal indeed remains unchanged, which causes the three-phase U/V/W signals from the motor driver to remain unchanged as well. Therefore, I believe the issue lies within the program. Could you please help analyze what might be causing this? 

Thanks a lot!

yellow_W_blue_U.jpg

Gael A
Gael ABest answer
ST Employee
July 21, 2025

Hello DF_MC,

The REV_PARK_ANGLE_COMPENSATION_FACTOR is a parameter set to 0 by default as it corresponds at a specific feature which is not relevant for Open Loop. This factor is meant to be used when the speed is so high that the movement of the rotor between the sampling and the setting of the command needs to be taken into account.


To be able to understand your issue more precisely, could you please have a look at the following questions ?

Can you please have a look at a broader picture of the duty cycles to make sure the duties always stay identical ?Can you have a look at the current waveforms to be sure ?
Are you sure your reference speed is taken into account ? Have you tried increasing the target speed ?

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.Hope this will help,Gaël A.
DF_MCAuthor
Associate III
July 30, 2025

Hello Gaël,

Thanks for your reply. I will check it again! 

Thanks a lot!