2025-01-21 05:49 AM
Hello Everybody,
MCSDK:6.3.0
CubeMX: 6.3.0
Workbench : 6.3.0
Motor Pilot : 1.2.9
Power Board : IHM08M1(Rshunt=0.01Ω)
Control Board : NUCLEO-G431RB
Motor : BLDC 26w 24v/8 pole pairs / rpm=4k / rated current=1.8A/hall sensor
I am currently testing torque control, and I am a bit confused about the hFinalTorque setting in the MC_ProgramTorqueRampMotor1 API.
I would like to set the Target Torque to 0.02.
According to the formula provided in the API:
current(digit) = (0.02 * 65536 * 0.01Ω * 5.18) / 3.3 = 20.57 (rounded to 21)
Should hFinalTorque be set to 21 or 210?
Additionally, do I need to manually enable the timer and PWM? (I have already used the Workbench to generate code and CubeMX to generate the project.)
Solved! Go to Solution.
2025-02-03 12:17 AM
Hello Everybody,
The issue has been resolved, and the motor can now run continuously.
The root cause was that the torque value set during the initialization call to MC_ProgramTorqueRampMotor1_F() was too close to the torque value set inside the while loop.
As a result, the power supply showed that it was still drawing a small load (about 0.015A), and when holding the motor by hand, I could feel slight vibrations, but the motor was not rotating.
After increasing the torque value in the MC_ProgramTorqueRampMotor1_F() or MC_SetCurrentReferenceMotor1_F() call inside the while loop, the motor was finally able to run continuously.
For someone like me who is new to FOC and even motor control, this has been a valuable hands-on experience.
This issue might seem like a basic mistake, but I still want to share the cause behind it. Hopefully, it can help others who are in the same situation as I was!
2025-02-05 08:00 AM
Hello @Vincent7,
Thank you for your feedback.