Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fix a noisy current sensor
#1
I was working on a build recently and had everything working well, but the current values in the OSD were jumping around so much they were worthless. Typically, current sensors work by measuring the voltage drop across a shunt resistor. This voltage drop is measured using an analog to digital converter in the MCU. Using a voltage divider and OpAmp, this voltage usually ranges from 0-3.3v over the range of currents the sensor is designed to measure. If there is electrical noise in the system, as is very common on quad builds, the voltage measured by the ADC will not be constant for a given current but will vary in frequency and amplitude. 

Betaflight allows you to set the current sensor lpf period to reduce noise, but I found the signal was just as noisy but updated slower. Instead, as I was fairly confident the issue was electrical noise, I decided to add a filtering capacitor to the ADC input hoping that would help stabilize the signal. 

I was using the Flywoo F411 micro stack for this build, which uses pins to connect the FC to the ESC and provide connections between battery, ground, motor outputs, and current sensor. Fortunately, the board also has the current sensor broken out to a pad adjacent to a ground pad, which seemed like the perfect place to add a small filtering cap. 

[Image: ThaiTGD.png]

I had an assortment of 0805 ceramic capacitors, and after a quick consult with an EE on the ELRS Discord I decided to use a 0.1uF and 1uF cap. Soldering 0805 SMD components is a bit fiddly, but I gave it a shot and managed to get it on the first try. 

[Image: l1m7Ggf.png]

Current sensor before:                                       Current sensor after:
[Image: oIRwwAm.png]  [Image: OFxR9aN.png]

Pretty striking difference in noise! After adding the capacitor, the current sensor in my OSD does not jump around constantly and is actually usable. Additionally, I've verified it accurately reports the current at different motor loads using a benchtop DC power supply. In hindsight, I probably would've been fine with just the 0.1uF capacitor, and will try that in future builds.
[-] The following 4 users Like V-22's post:
  • ph2t, Myman, Lemonyleprosy, Scott_M
Reply
Login to remove this ad | Register Here
#2
That is significant!
It is nice when your "tools" are actually useable Smile I have had several FC where you can't use the Current sensor.

Nice Tutorial !

Scott
[-] The following 1 user Likes Scott_M's post:
  • V-22
Reply
#3
Wow, happy i found this! Great work v-22.
Reply
#4
Ar yes, the AMD 3D V-Cache technology
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Tutorial How To Calibrate Your Current Sensor SnowLeopardFPV 12 3,878 24-May-2021, 12:02 PM
Last Post: ph2t
  Antenna Fix Cheb2703 2 702 04-May-2020, 04:11 AM
Last Post: Cheb2703
  TX Flysky i6 hall sensor gimbal KonradS 13 21,126 06-Dec-2019, 09:09 PM
Last Post: KonradS
  Tutorial Virtual Current Sensor with Cleanflight / Betaflight Jordan Marinov 10 36,661 28-Jul-2016, 05:46 AM
Last Post: Maxor


Login to remove this ad | Register Here