Issues with One Shunt Current Sensing Using STSPIN32G4 and STDRIVE101 Custom Board
- July 12, 2024
- 1 reply
- 1981 views
Hi everyone,
I'm currently working on a FOC motor control project using a custom board with the STSPIN32G4 and STDRIVE101. I am using a single shunt resistor for current sensing and Hall sensor for speed sensing. Here are the details of my setup:
- Shunt Resistor: 0.015 ohms
- Operational Amplifier Gain: 10.1
- Current Control Reference: 0.5A using MC_ProgramTorqueRampMotor1_F(0.5, 100)
After configuring everything, my motor is able to spin. However, I am facing issues with the current control. When I set the reference current to 0.5A, the Iq value I read from the Cube Monitor is very noisy and has small values. For my setup, a value of 1500 should correspond to 0.5A. However, when I use a current clamp meter, I observe an RMS current of 8A and a peak current of 22A (10mv/A). These small values cause the integral term to become very large; thus, I think this is why the current from the current meter goes so big.
Additionally, I monitored the three-phase currents hCurrA, hCurrB, and hCurrC inside the R1_GetPhaseCurrents function and discovered that hCurrC remains 0.
Could anyone provide me with some tips or guidance on how to ensure my single shunt current sensing is correct?
Specifically, I'm not sure about Offset Network Attenuation and Polarization Offset, which I set to 0.9524 and 1.65v.
Any help or suggestions would be greatly appreciated!
Best regards,
Yan-Liang Chen
