cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the value of hFinaltorque?

Vincent7
Associate III

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.)

 

11 REPLIES 11
Vincent7
Associate III

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!

Hello @Vincent7,

Thank you for your feedback.

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