2026-03-30 6:39 AM - last edited on 2026-03-30 7:08 AM by Peter BENSCH
Hello,
i found a bug in the code generated by the Motor Control Workbench usign the 6-step algorithm. Even with Open Loop mode enabled, the code is still using the PID for the initial duty cycle computation (state CHARGE_BOOT_CAP in the TSK_MediumFrequencyTaskM1()). If the PID isn't set up right and starts with a low duty cycle, the motor won't turn. This means the Hall sensors don't trigger, the duty cycle never updating, and the motor just sits there even if you set a high duty cycle value. The Open Loop mode shall bypass the PID controller, otherwise it is useless.
I fixed it by changing row 174 of mc_tasks_sixstep.c as follows:
from:
MCI_ExecBufferedCommands(&Mci[M1]); /* Exec the speed ramp after changing of the speed sensor */
to:
if (SDC_GetOpenLoopFlag(pOLS[M1]))
{
SDC_SetControlMode(pSDC[M1], MCM_DUTY_MODE);
}
else
{
MCI_ExecBufferedCommands(&Mci[M1]); /* Exec the speed ramp after changing of the speed sensor */
}
Leo
Edited to apply source code formatting - please see How to insert source code
2026-04-01 1:20 AM
Hi @Leo4 , thank you for your observation regarding the open-loop feature of the 6-step firmware. We will consider it for future releases.
Best regards.
Fabrice