2024-02-09 10:09 AM
[VERSION]: MCSDK 6.2.1
[TOOL]: MC Firmware.
[DETAILS]:
I developed a control/power board, a custom Hall sensors board and a motor (which will interface a reduction drive) for AGV application. I am using a dynamometer (link below) to measure maximum torque:
<https://www.magtrol.com/product/hysteresis-dynamometers-hd-series/>
I am facing a problem when starting the motor with speed mode when reaching 1.1Nm (the motor is rated at 1.5Nm). When I add load while the motor rotates, the controller can adjust the current accordingly, look at "add_load_after_start.png".
I already adjust speed PID so that it could increase the Iq reference (mainly through the integral portion), but it seems it is not fast enough as the system detects a motor stall (custom implementation - system requirements - minimum speed at 5% nominal in 6 seconds). Starting with torque mode (setting a short-time ramp to the motor's nominal current) and then changing to speed mode seems wrong, as Iq and Id go to zero after the mode change (at a minimum reliable speed, 20% nominal), and ramps up again.
I already saw these links:
<https://community.st.com/t5/stm32-mcus-motor-control/how-to-switch-from-torque-mode-to-speed-mode-while-motor-is/td-p/212845>
<https://community.st.com/t5/stm32-mcus-motor-control/on-the-fly-change-between-speed-and-torque-control-mode/td-p/216404>
In torque mode, programming a speed ramp with the actual speed and zero run time gives this result "change_torque_to_speed_mode.png".
My suspicions come from "STC_CalcTorqueReference" function in "speed_tor_ctrl.c" file, as the PID doesn't seem to take the last Iq into account. The PID only runs when the controller has a speed setpoint, and when it changes mode it starts from zero. Looking at comments for the "STC_SetControlMode" function, it says "interrupts the execution of any previous ramp command maintaining the last value of Iq", but this is only true for the same control mode.
[EXPECTED BEHAVIOR]:
Changing torque mode to speed mode should take into account the Iq reference.
[HOW TO REPRODUCE]:
To replicate the project look at the following post, it is an update:
<https://community.st.com/t5/stm32-mcus-motor-control/stop-command-and-startup-with-hall-sensors/td-p/607423>
Thanks in advance!