cancel
Showing results for 
Search instead for 
Did you mean: 

Weird noise on ADC - current sensing.

karaoglu
Associate II

Hi, I'm developing a FOC board based on STM32G431RBT6 and I wanted to test the board in open loop before attempting to FOC.
While testing for current sensing, I'm getting a lot of noise which messes up the measurement.
I tried disconnecting the motor to be sure that the source of the noise is not the SMPS on the board, there is little to no noise on the ADCs without the motor.

karaoglu_0-1745360848307.png

It looks like this when running the motor in open loop with very low RPM. With increased RPM, the noise becomes more prominent since the motor is not under any load and drawing less current at the same power, and it becomes impossible even to see the shape of the sine wave.
And there's that weird spikes at the bottom of the sine which I don't have any clue about.

I'm using internal opamps with PGA set to 16 in as differential low side current sensing amps. ADC is triggered at every overflow event through OC4REF.

What's the possible causes for this problem and how to solve?

8 REPLIES 8
GMA
ST Employee

Hello @karaoglu,
Are you using ST MCSK firmware?
Refer to "ST Workbench tool">About>Documentations>Documentation>"User manual" tab, "Current sampling ..." chapters for current sampling topologies and timing limitations description.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

Hello, no I'm not using MCSDK, I'm writing my own code.
However, I can try using a SDK, it would be much easier. I'm not using it because I did not design my board according to an evaluation board, so I couldn't find a matching circuit in MC Workbench. 
Is there a way to skip MC workbench and use the MCSDK adjusted to my custom board?
If not, what's causing the noise?

Hello @karaoglu,

You can use the STMC Board Designer tool (embedded on MCSDK) to create your custom board. Your custom board will be then available on MC Workbench.
Noise could come from ADC conversion timing vs PWM timing (refer to current sensing documentation).

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

> If not, what's causing the noise?

Presumably EMI, either magnetic coupling onto the ADC inputs from the motor, or indirectly via the power supply of the MCU.

karaoglu
Associate II

Hello again,
I tried the STMC Board Designer tool. It's a promising tool but not really helpful in this case.

I measured the noise on the scope, there is +/- 20mV of ringing around 625kHz on the shunt. And the weird spikes at negative peak looks like caused by the ringing at the switching node of the half bridge. I traced the 625kHz noise back to the power supply, and it's the power supply that creates the noise. There's noise on the ground of the board when it's connected to the power supply too, which is weird.
But the source of the noise is definitely the power supply. I tried to use BNX026H01L EMI filter by murata in front of the power supply but it didn't help. 

How can I eliminate that noise? Is my power supply too cheap or is it normal? 

I am not a hardware designer.

But the best option, which AFAIK many motor driver applications use, is to have the MCU itself electricall isolated from the motor electronics.
And even then, some routing/wiring design cycles might be required to improve EMI immunity.

LCE
Principal II

As long as we see neither schematics nor PCB layout, we can only guess.

Motor PWM and switching regulators belong to the worst noise sources, so schematic design and PCB layout must be done very diligently - and is challenging even for experienced hardware designers.

Alone the grounding for circuits like that is an art in itself.

Look for the switching path - including the GND return path, and keep them as short and low impedance as possible.

 

Darn, that sounded almost like an AI answer... :D

> Alone the grounding for circuits like that is an art in itself.
> Look for the switching path - including the GND return path, and keep them as short and low impedance as possible.

Might sound somewhat like an AI answer, but true.
Especially the relatively high currents for a motor can offset the ground level, and strong EMI (accompanying high currents and fast rise/fall times) can inject significant noise.

As said, electrically isolating motor electronics and controller is the route most solutions go.