2020-10-30 05:34 AM
Hi
I am running on a STM32G071 board, with my own custom HW (standard 3 phase halfbridge). The control is FOC sensorless with 1 shunt
I am having problems tuning the motor, but for starters I would like to run the motor at low speed in open loop
I can find a parameter in the IOC file name Open_Loop_FOC which I can set to "true"
But how do I set the operating conditions and how do I start the motor in Open loop mode?
(I am running MCWB 5.4.1.19309 (I have tried 5.4.4, but it seems to be unstable. STM32CubeIDE 1.4.2 and STM32CubeMX 6.0.1)
Regards
Klaus
Solved! Go to Solution.
2020-11-02 06:47 AM
Hello,
I think you have this issue due to the use of an old version of the MC Workbench.
The issue is in drive_parameters.h, be sure to have these declarations:
Best Regards,
Antoine
2020-11-02 02:15 AM
Hello KKrag.1,
To run a motor in open loop, as you said you need to set "OPEN_LOOP_FOC" to true in the IOC file and generate the project with STM32CubeMx.
In your project, you can find:
To control your application, you can use functions in mc_api.c.
For example, to start your motor, you can call MC_StartMotor1(void).
Let me know if you need more detailed explanation.
Best Regards,
Antoine
2020-11-02 04:56 AM
Hi Antoine
Thanks for the answer
When I change the Open_Loop_FOC to "true", I get compile time errors:
mc_config.c:135:67: error: 'PHASE2_FINAL_SPEED_UNIT' undeclared here (not in a function); did you mean 'PHASE1_FINAL_SPEED_UNIT'?
{(uint16_t)PHASE2_DURATION,(int16_t)(PHASE2_FINAL_SPEED_UNIT),(int16_t)PHASE2_FINAL_CURRENT,&RevUpControlM1.ParamsData[2]},
^~~~~~~~~~~~~~~~~~~~~~~
PHASE1_FINAL_SPEED_UNIT
mc_config.c:136:67: error: 'PHASE3_FINAL_SPEED_UNIT' undeclared here (not in a function); did you mean 'PHASE2_FINAL_SPEED_UNIT'?
{(uint16_t)PHASE3_DURATION,(int16_t)(PHASE3_FINAL_SPEED_UNIT),(int16_t)PHASE3_FINAL_CURRENT,&RevUpControlM1.ParamsData[3]},
^~~~~~~~~~~~~~~~~~~~~~~
PHASE2_FINAL_SPEED_UNIT
mc_config.c:137:67: error: 'PHASE4_FINAL_SPEED_UNIT' undeclared here (not in a function); did you mean 'PHASE3_FINAL_SPEED_UNIT'?
{(uint16_t)PHASE4_DURATION,(int16_t)(PHASE4_FINAL_SPEED_UNIT),(int16_t)PHASE4_FINAL_CURRENT,&RevUpControlM1.ParamsData[4]},
Any hint to how to avoid those?
Thanks
Klaus
2020-11-02 06:47 AM
Hello,
I think you have this issue due to the use of an old version of the MC Workbench.
The issue is in drive_parameters.h, be sure to have these declarations:
Best Regards,
Antoine
2020-11-09 05:40 AM
Hello @Community member,
Antoine’s answers finally solved your problem?
If yes please click on the 'Select as Best' button in the proper reply.
2022-07-14 09:45 PM
Looking for this OPEN_LOOP_FOC, but not finding it. Runing 5.y.4
2022-07-20 02:20 AM
you need to open the .ioc file in editor and search for OPEN_LOOP_FOC
2022-07-20 09:08 AM
Thank you! I did find this and have it functioning. Curious why this isn't in the gui?