2025-05-06 7:25 PM
Hi all ,
I'm currently using the EVSPIN32G4 evaluation board along with MC Workbench for motor control development, and I'm encountering an issue with Overcurrent Protection (OCP) behavior that I can’t quite resolve.
During runtime, I monitored the motor phase current using a current probe and oscilloscope. OCP is triggered at only around 46A, which is far below the configured 200A.
In the firmware, I noticed:
DAC_OCP_Threshold = 7427;
According to the MC SDK, the current conversion factor is calculated using this formula:
#define CURRENT_CONV_FACTOR ((uint16_t)((65536.0 * RSHUNT * GAIN) / ADC_REFERENCE_VOLTAGE))
I get: CURRENT_CONV_FACTOR ≈ 146 /// I = 7427/146 = 50.9A
In the official ST document UM2850 - Getting Started with EVSPIN32G4, Section 5.5.2 provides a OCP threshold formula.
The formula is used to calculate the actual overcurrent protection (OCP) trigger current based on the hardware resistor network.
I’m unsure whether this discrepancy is due to a misunderstanding on my side, or if there’s a misconfiguration in the setup.I hope someone can help me clarify this issue.
Thanks
2025-05-20 8:30 AM - edited 2025-05-20 9:05 AM
Hello @1123,
How did you measure the 46A current value? The most accurate is to measure with a scope the voltage at Rshunt point.
Signal could be noisy; could you try by increasing the Digital Filter Duration?