2025-01-31 8:49 AM
Hi, my name is Luis.
I'm using MC SDK 6.3.2 with a custom board for a single shunt driver in 6-step mode.
I defined the OCP mode to use internal comparator and enabled over current protection in MC project configuration.
The generated ioc file configures the DAC3 OUT1, COMP and enables, for TIM1, BRK from CMP1 source with polarity high. What I have not seen anywhere is the DAC value corresponding to the current limit I have configured.
I've tried to trigger overcurrent protection with a motor I'm driving correctly by brakeing it, but I'm unable to trigger protection even if the current is way above the configured threshold.
It looks like SDK doesn't really handle the configuration of the DAC and so overcurrent protection is just not implemented.
On a different board with a 3-shunt resistor I have seen the .DAC_OCP_ASelection defined in R3_ParamsM1 inside mc_parameters.c and the function R3_SetAOReferenceVoltage called inside r3_g4xx_pwm_curr_fdbk.c and it seems to work ok.
Is just Over Current protection with internal comparator not implemented for single shunt 6-step mode?
2025-02-27 9:25 AM
Hello @jovijuan,
Sounds that you are using FOC Driving algorithm and not 6-step...
Using evspin32g4 board in single shunt FOC, DAC settings are correctly generated.
Does R1_SetAOReferenceVoltage() function called in R1_Init() function?
If yes, you can try by setting the lowest OCP threshold as possible to trig the OCP?
2025-02-27 9:45 AM
The error I'm reporting is with 6-step driving. I might be missing something, what makes you think it's FOC?
I have not checked the behavior with FOC.
Regards,
Luis
2025-02-28 1:35 AM - edited 2025-02-28 2:51 AM
Hello @jovijuan,
I made a confusion when you mentioned 3-shunt that is for FOC.
You are right, OCP feature through DAC usage is not supported on 6-Step Driving algorithm (this limitation will be added on next Release Note document, thank you for the report).
Can yoy try by adding in SIX_STEP_Init() function, OCP DAC init function settings obtained by generating on your custom board with OCP+FOC use case?