# Current Sense Noise?

**URL:** https://community.simplefoc.com/t/current-sense-noise/6757
**Category:** hardware support
**Tags:** stm32
**Created:** [February 15, 2025, 3:28pm UTC](https://community.simplefoc.com/t/current-sense-noise/6757 "2025-02-15T15:28:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![LotsOfNaan](https://community.simplefoc.com/user_avatar/community.simplefoc.com/lotsofnaan/32/8199_2.png) [@LotsOfNaan](https://community.simplefoc.com/u/LotsOfNaan)
#### Post date: [February 15, 2025, 3:28pm UTC](https://community.simplefoc.com/t/current-sense-noise/6757/1 "2025-02-15T15:28:29Z")

</div>

Hey there! I have a setup with a GM3506 motor, a MKS Dual FOC Plus V3.2, a AS5048A encoder, and a WeAct STM32G474 board. I’m programming in the Arduino environment. With this I’ve run into an issue tuning the current vector PIDs, which I believe I have traced down to it reacting to noisy data from the current sense amplifiers.

This is the current from a single phase of the motor spinning in open loop velocity mode, measured with both a current clamp on the phase wire (blue) and an oscilloscope probe on the current sense input pin on the STM32 board (yellow):

 ![image](https://community.simplefoc.com/uploads/default/original/2X/6/6591761cb66a33b6217c8fd003c09579e21ca97c.png)

And this is what the STM32 itself sees in the same situation:

 ![image](https://community.simplefoc.com/uploads/default/original/2X/b/bd09c94e317333ce26851c4d997cc9e52c735e0b.png)

With the motor disabled it’s better, but still a tad wilder than I’d expect:

 ![image](https://community.simplefoc.com/uploads/default/original/2X/e/e92b2defcd152bde0dcebf24f3fb4c9903d89752.png)

What would the typical place be to start debugging this? Filtering in hardware? Finding the noise source? Configuring the ADCs better?

---

<div class="post-metadata">

### Author: ![LotsOfNaan](https://community.simplefoc.com/user_avatar/community.simplefoc.com/lotsofnaan/32/8199_2.png) [@LotsOfNaan](https://community.simplefoc.com/u/LotsOfNaan)
#### Post date: [February 17, 2025, 9:33am UTC](https://community.simplefoc.com/t/current-sense-noise/6757/2 "2025-02-17T09:33:13Z")

</div>

For future reference - I ‘fixed’ it by running two of the STM32G4’s ADCs in continuous conversion oversampling mode, instead of the library just doing a single read every time:

 ![image](https://community.simplefoc.com/uploads/default/original/2X/6/681812cd114459ba87dd9b227a0c96fc373e237d.png)

Still feels like the setup I’m using could use some actual hardware filtering, and I wonder if it would be helpful if users could easily check their current reading noisiness through the SimpleFOC library. This was really messing up my current PID loops, while I have quite a ‘standard’ hardware setup, that just wasn’t working right.
