2022-07-25 10:34 AM
STM32F405
MCSDK = V5.4.5
f_pwm = 10kHz
High frequency task = 10kHz
Medium frequency task = 1kHz
Position and speed = Hall (main) & STO+PLL (auxiliary)
Current sensing = 3 x 3mOhm shunts
Is it possible with the MCSDK to power up the processor with the motor shaft already rotating and start the controller without the motor coming to a halt? When I try this the motor drives with a very strange noise until the motor is first stopped, after that it runs normally.
I think the cause of this is that the Hall effect initialisation doesn't work correctly if the motor shaft is rotating (perhaps HALL_Clear()->HALL_init_electrical_angle() relies on the motor not rotating?).
Can anyone tell me if this is the likely cause and if so, is there any way to startup the MCSDK code and run the speed/current controller if the motor shaft is already rotating at power up?
2022-07-27 04:51 PM
From hall_speed_pos_fdbk.c:
/**
* @brief Clear software FIFO where are "pushed" latest speed information
* This function must be called before starting the motor to initialize
* the speed measurement process.
* @param pHandle: handler of the current instance of the hall_speed_pos_fdbk component*
* @retval none
*/
__weak void HALL_Clear( HALL_Handle_t * pHandle )
Does this mean that the motor can't be free spinning when HALL_Clear() is called? By "free spinning" I mean not driven by the STM32 but by something else, for example, a flywheel.