cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with One Shunt Current Sensing Using STSPIN32G4 and STDRIVE101 Custom Board

AndyChen
Associate II

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

1 REPLY 1
Gael A
ST Employee

Hello AndyChen,

At low speed level, when modulation is low, we only sample the two same phases (here A and B), whatever the position of the rotor. This is done to prevent current distortion. This is why you only have hCurrA and hCurrB ; hCurrC is not needed as hCurrA + hCurrB + hCurrC = 0. If you speed up your motor close to its maximum speed, you should have an hCurrC value appearing, because A and B will not be available to sample, and you will have to sample C and reconstruct the missing one afterwards.

Are you aware of the existence of the MotorPilot tool ? We recommend it for plotting current values using ASYNC. Could you please have a look there ?
Also, is your resistive torque big enough for your current controller to increase the current ? Because if you have no resistive torque, there is no need for current to reach up even 0.5 Amp. Try loading the machine to see if your current is behaving better.

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Hope this will help,
Gaël A.