cancel
Showing results for 
Search instead for 
Did you mean: 

Bug: Configuration with Hall as main and Open Loop debugging enabled creates unbuildable project

DMeie.2
Senior II

[VERSION]: MCSDK 6.2.1, 6.3.0 (CubeMX 6.11.0, STM32G4 FW V1.5.1)
[TOOL]: Motor control WorkBench
[DETAILS]: When creating a project that has the Hall sensor of a motor selected as the main sensor and also the Open Loop debug feature enabled, the resulting project can't be built due to missing defines and variables.
[EXPECTED BEHAVIOR]: I expect the tool to create buildable and working code.
[HOW TO REPRODUCE]: Create a configuration like mentioned under DETAILS. I renamed and attached a MCWB configuration made with preset hardware (I-PMSM 24V motor, B-G431B-ESC1 inverter).
Generate code from project.
When importing the project in CubeIDE and trying to build it, following Errors pop up:
- undeclared defines OPEN_LOOP_VOLTAGE_d, OPEN_LOOP_VF, OPEN_LOOP_OFF, OPEN_LOOP_K for the OpenLoop_ParamsM1 typedef in mc_config.c
- 'VirtualSpeedSensorM1' undeclared, used in various places in mc_tasks.c

1 ACCEPTED SOLUTION

Accepted Solutions
GMA
ST Employee

Hello @DMeie.2,

Thank you for your problem report.
Open loop is considered as a debug mode dedicated to Sensor less algorithm, then it is only available with "Speed Sensor Mode" set to "Observer + PLL" or "Observer + Cordic".
"Speed Sensor Mode" set to Hall sensor with OPENLOOP mode, as in your case, is not supported.

A ticket in open on our side and in the meantime, please select one of sensor less setting.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

View solution in original post

2 REPLIES 2
GMA
ST Employee

Hello @DMeie.2,

Thank you for your problem report.
Open loop is considered as a debug mode dedicated to Sensor less algorithm, then it is only available with "Speed Sensor Mode" set to "Observer + PLL" or "Observer + Cordic".
"Speed Sensor Mode" set to Hall sensor with OPENLOOP mode, as in your case, is not supported.

A ticket in open on our side and in the meantime, please select one of sensor less setting.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA
DMeie.2
Senior II

Thanks for the feedback.
I'll remove the offending Open loop code from my project.

A recommendation: Usability of the motor library would be greatly improved if features like that, or configurations like main/aux sensor would be handled with defines or other software switches instead of relying on a code generation tool that might stop working at any point in time, or, like in my case, when changes to the codebase are made beyond a certain point.