Motor doesn't spin on a STM32F04ZE custom board passing from MC-MDK 4.0 to MC-MDK 5.4.0
Hi,
I'm working on a project trying to port an old FOC SDK 4.0 based application on
a new MC-SDK 5.4.0 one. The job is done on a STM32F407ZE board where previously
the use of FOC 4.0 allows to spin a brushless PMSM motor at various mechanical
speeds. At the moment the motor supplier is not able to tell us if the motor he
is selling us is a SM-PMSM or an I-PSMS motor...
From a MC SDK point of wiev, our motor application uses a 3-phase inverter based
on three STM L6395s (High voltage high and low-side drivers) and a 3-shunts current
sensing configuration.
No over current protection mechanism is at the moment employed and the current
sensing is based on external opamps whose configuration has been taken from
another HW application note (this was the job of an external HW engineer).
Speed and position feedback is obtained employing 3 120-degrees shifted phase
Hall sensors; neither PFC or Brake components are used.
The motor voltage bus is 24 V, maximum speed is 40 Krpm, PWM frequency of the
3-phase inverter is 35000 Hz.
I opened the old FOC 4.0 motor configuration file with the new MC SDK 5.4.0;
it was able to convert with no problem the old settings and to produce a .ioc
file with which it generated a project based on IAR Workbench.
In main.c of the project I do the following things:
uint16_t fault_occurred = MC_GetOccurredFaultsMotor1();
uint16_t fault_current = MC_GetCurrentFaultsMotor1();
bool motor_rc = MC_AcknowledgeFaultMotor1();
ASSERT(motor_rc == true);
uint32_t motor_start = 1;
/* Infinite loop */
while (1)
{
switch (MC_GetSTMStateMotor1())
{
case IDLE:
if (motor_start == 1)
{
motor_start = 0;
MC_ProgramSpeedRampMotor1(1000, 500);
motor_rc = MC_StartMotor1();
ASSERT(motor_rc == true);
}
break;
case RUN:
motor_rc = false;
break;
case FAULT_NOW:
fault_current = MC_GetCurrentFaultsMotor1();
motor_rc = MC_AcknowledgeFaultMotor1();
MC_AcknowledgeFaultMotor1();
break;
case FAULT_OVER:
fault_occurred = MC_GetOccurredFaultsMotor1();
motor_rc = MC_AcknowledgeFaultMotor1();
MC_AcknowledgeFaultMotor1();
break;
}
}What I checked is that the motor state becomes IDLE and once triggered the
motor speed ramp and the motor start, the it never spins. I also checked that
no PWM signal are present on the input pins of the L6368 drivers..
Can someone address me where to find the possible cause(s) of this missing
motor spinning?
Thanks in advance to everyone that can help me.
