Skip to main content
Senior III
June 12, 2025
Solved

Phase current sensing problems

  • June 12, 2025
  • 4 replies
  • 580 views

 I am measuring the phase current signal, in between i see sudden spikes and the motor halts. I am testing at 60V battery input. It is hall based system and FOC. 

STuser2_0-1749712417019.png

 

It is a custom board and i have not configured the motor pilot, 2 questions if you can answer it will be helpful

a. If  i am reading the phase currents at the middle of the low side pwm then it shall be consistently reading the same value but why suddenly it reads invalid value i do not understand i mean the spike.

b. If it is low inductance value should i mandatorily switch at 20KHz at present i am doing at 15KHz. What best i can do to identify the root cause.

Please advise based on the inputs i can move forward.

 

Best answer by cedric H

To Bring up a new board, the first advice I have is to enable the Motor Pilot support with the data log support, and enable the open loop support.

Runing your motor in open loop will allow you to check the quality of your current sensing.

This is fully described in the documentation accessible from the workbench :

cedricH_0-1749824963450.png

 

Did you start from a schematic provided by ST ?

Regards

Cedric

 

4 replies

STuser2Author
Senior III
June 12, 2025

Please help me for recommendation of current sensing filtering i have to for low side current sensing, i assume it is low pass filter and if i am switching at 15KHz and max rpm is 700 and number of poles is 23.  The output from the shunt resistor is connected with the internal opamp of STM32G4 controller.  

GMA
Technical Moderator
June 12, 2025

Hello @STuser2,

For Phase current sampling strategy, refer to User Manual documentation available through "Workbench tool">About>Documentations>Documentation>"User manual" tab, "Current sampling" link.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.Best regards.GMA
STuser2Author
Senior III
June 13, 2025

I have made the following changes in the code

#define MAX_MODULE 15000 

so the maximum voltage applied is 15000/32767*60V = 27.4 V

The switching frequency i have reduced to 10KHz from 15KHz

 i have noticed improvement and the motor is running but some issues still bother me

a. In between there are current spikes and there is audible noise for motor when this happens, i know it is invalid switching. I took the cube monitor data the same is observed. How do i resolve this issue?

STuser2_0-1749789211669.png

STuser2_1-1749789479053.png

b. What will be the impact of the PWM change i have done. I dont here any audible noise at 10KHz. Can i continue with it? Please advise. 

 

 

 

cedric H
Technical Moderator
June 13, 2025

Hello @STuser2,

As stated in the following post: How to write a Motor control post to get a respons... - STMicroelectronics Community

Could you at least tell us if you use the MCSDK and if yes, which version.

Regards

Cedric

STuser2Author
Senior III
June 13, 2025

Thanks for the reply, i started with 6.2.0 MCSDK and keep checking for the updates on MCSDK and if i find anything new i am adding without affecting the overall functionality but i can say not major changes MCSDK base version is 6.2.0 what i used.

 

 

 

 

 

 

 

 

cedric H
cedric HBest answer
Technical Moderator
June 13, 2025

To Bring up a new board, the first advice I have is to enable the Motor Pilot support with the data log support, and enable the open loop support.

Runing your motor in open loop will allow you to check the quality of your current sensing.

This is fully described in the documentation accessible from the workbench :

cedricH_0-1749824963450.png

 

Did you start from a schematic provided by ST ?

Regards

Cedric