2024-07-12 02:40 AM
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:
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
2024-07-15 05:42 AM
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.