Skip to main content
Associate III
January 9, 2025
Solved

FOC Open Loop API

  • January 9, 2025
  • 2 replies
  • 1087 views

Hello Everybody,

MCSDK:6.3.0

CubeMX: 6.3.0

Workbench : 6.3.0

Motor Pilot : 1.2.9

I used open-loop voltage on the motor pilot to perform tuning with (voltage_ref, TargetSpd) at the following settings: (10%, 300), (20%, 600), and (30%, 900), each with a duration of 2000, to check the motor's operating condition.

However, when I used the API for tuning, only (10%, 300) operated normally. When I updated voltage_ref to 20% and set the Speed to 600, the motor struggled to rotate (it was jittering).

My question is: during the rotation process, do I need to stop the motor before calling OL_UpdateVoltage and MCI_ExecSpeedRamp? or I should use others api to change the voltage_ref and the speed?

Best answer by Vincent7

Hi herryjams22,

Thank you for your reply. Currently, using open loop-voltage in the program, I can freely switch V_ref and RPM without stopping the motor.

This morning, I rechecked the usage of the API (open_loop.c), and there is a line that states: "* user, with OL_UpdateVoltage(), or computed by OL_Calc() if the V/F mode is selected."

From my understanding, these two APIs cannot be used simultaneously (as they apply to different scenarios). However, my program was set to execute both at the same time (refer to the attached image from the original question). As a result, changing V_ref during program execution caused the motor to stall. After marking out the V/F command and re-flashing the program, everything worked normally.

2 replies

Vincent7Author
Associate III
January 13, 2025

the issue has been solved.

January 13, 2025

Hi Vincent7,

It seems like the issue arises when switching voltage_ref and target speed dynamically during operation. Based on your description, it sounds like there might be an underlying synchronization issue between the API commands and the motor's state. While the API theoretically supports such updates on-the-fly, practical implementation sometimes reveals unexpected behavior.

To address your question, it is typically safer to stop the motor before updating voltage_ref or speed settings, especially in an open-loop mode. This ensures the motor is not subjected to unstable inputs. However, if stopping the motor every time isn't feasible, you could try experimenting with lower increments of voltage_ref and speed to see if the jittering reduces.

As a side note, ensure there’s no invisible text or uninitialized parameters in the code affecting motor behavior. Sometimes, small overlooked settings in open-loop tuning can lead to such inconsistencies.

Vincent7AuthorBest answer
Associate III
January 13, 2025

Hi herryjams22,

Thank you for your reply. Currently, using open loop-voltage in the program, I can freely switch V_ref and RPM without stopping the motor.

This morning, I rechecked the usage of the API (open_loop.c), and there is a line that states: "* user, with OL_UpdateVoltage(), or computed by OL_Calc() if the V/F mode is selected."

From my understanding, these two APIs cannot be used simultaneously (as they apply to different scenarios). However, my program was set to execute both at the same time (refer to the attached image from the original question). As a result, changing V_ref during program execution caused the motor to stall. After marking out the V/F command and re-flashing the program, everything worked normally.