cancel
Showing results for 
Search instead for 
Did you mean: 

6step code generated from MC Workbench never detects failure to transition to sensorless

MAnde.11
Associate III

In other words, after the ramp up, it always thinks it locked and is spinning even when it doesn't. I've written this code before so here is where I'm suspicious if anybody here is familiar with this code:

There is a parameter in drive_parameters.h called NB_CONSECUTIVE_TESTS that gets loaded into Bemf_ADC_M1->StartUpConsistThreshold. Then in the BADC_IsZcDetected function it tests if ZcEvents > StartUpConsistThreshold and increments ZcEvents whenever it determines there was a valid zero crossing. However, ZcEvents is never reset to zero (or even decremented) when and invalid zero crossing is detected. In this way it will eventually detect enough zero crossings just by random chance and not meaning we are really locked.

 

Also, it will never fault out in the "Switchover" state either. It always succeeds and dumps it into run state, even if the motor is stalled and the power suppy is current limiting. I have to click stop to get it to quit.

 

Anyone have any experience with this?

1 REPLY 1
cedric H
ST Employee

Hello @MAnde.11 ,

Could you describe your configuration and the version of the MCSDK ?

The best would be to attach your stwb6 project file.

Thanks

Cedric