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.)
2025-01-22 01:40 AM
Hello Everybody,
When I execute MC_ProgramTorqueRampMotor1(Set_FinalTor, Set_Duration), the motor runs for a few seconds and then shows fault code 32. According to online resources, it is said to be a software issue. However, I only executed the following commands:
MC_ProgramTorqueRampMotor1(Set_FinalTor,Set_Duration);
MC_StopMotor1();
The rest of the code is generated from the project. May I know which direction I should take to debug this issue?
2025-01-22 06:47 AM
Hello @Vincent7,
You can use MC_ProgramTorqueRampMotor1_F() that uses a float Ampere format as input parameter.
2025-01-22 07:00 AM
Hello @Vincent7,
I assume that you used MC_StartMotor1() api previously at MC_StopMotor1() call.
Fault code 32 (0x20) means Speed feedback (MC_SPEED_FDBK). Using HALL sensor feature, check that HALL sensor is correctly connected.
2025-01-22 07:38 AM
Hello GMA,
Thank you for your reply.
When I used the API to test torque mode, I first used Motor Pilot to tune the parameters. During the tuning process, I noticed that if the Torque Reference remained at 0 or around < 0.2, the "speed feedback" fault would indeed occur when starting, unless I increased the Torque Reference slightly higher.
Now that I am testing with the API, should I still consider the Torque Reference value set in Motor Pilot?
2025-01-22 07:54 AM
Hello @Vincent7,
FinalTorque of MC_ProgramTorqueRampMotor1_F() api or Motor Pilot "Torque Ramp/Target Torque" are aligned.
2025-01-22 04:55 PM
Hello GMA,
Thank you for your reply.
I will try increasing the current to test again.
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.)I did not manually enable the timer and PWM, but the motor still rotates.(ven though fault code 32 occurred.)