Issue with Single-Shunt Topology in MCSDK 5.Y.2 on STM32G431RB
Hello everyone,
I am using MCSDK 5.Y.2 with an STM32G431RB MCU on a custom board. I can successfully run the motor using the three-shunt topology. However, when I switch to the single-shunt topology, the motor does not start.
I checked the mc_api.c calls for both configurations, and they are the same. On the single-shunt board, I immediately get bState = FAULT_OVER right after bState = START. This issue does not occur with the three-shunt board.
When generating the motor code, I noticed some differences in the file structure:
- For the three-shunt topology, the directory MCSDK_v5.Y.2-Full\MotorControl\MCSDK\MCLib\G4xx\Src is created, containing the file r3_2_g4xx_pwm_curr_fdbk.c.
- For the single-shunt topology, this directory is not created, and instead, the file r1_ps_pwm_curr_fdbk.c is placed in the Src directory. Was r1_g4xx_pwm_curr_fdbk.c removed on MCSDK5.Y.2?
Could I be missing a difference in the state machine or configuration between the two topologies?
Below is the code I use to start the motor in my custom software:
State_t eMCState;
eMCState = MC_GetSTMStateMotor1();
if (eMCState == IDLE)
{
MC_ProgramSpeedRampMotor1(SpeedCommandRPM/6, RampDurationMs);
MC_StartMotor1();
}
Any guidance on resolving this issue or identifying the root cause would be greatly appreciated.
Thank you!
