Shop Learn P1 Docs P2 Docs
How to filter noise on AD HX711 Load cell amp — Parallax Forums

How to filter noise on AD HX711 Load cell amp

T ChapT Chap Posts: 4,083
edited 2017-06-09 03:33 in Propeller 1
  IF ina[11] == 0  ' is there data available
     hxraw := hx.readraw  <# 10000  'avoid false number above 10000
          IF hxraw > LoadcellLimit[1]     '
                    GoZeroClear 
                    ser.str(3, String("OverLoad Trip:"))   
                    KillMotor   
                    Repeat   ' lock up
                       beep2500
                       w(80_000_000)
https://www.sparkfun.com/products/13879

I am only assuming the issue is noise. Originally I found that if you read too fast you get bad info, then I added the test for the data line == 0 which means data is ready.

The load cell shows a range when I press on it by hand of 0 to 4000 or so using read raw data. I want to set a threshold using LoadcellLimit[1] to determine if a motor is overloaded. The problem is there are sporadic glitches that exceed 10000 even with no load. I will do some tests with a scope to see if I can see what is going on with the lines. Off the Prop the wire to the HX711 AD is unsheilded for a foot, then the wire to the load cell is sheilded for about 4-6' or so. For these tests the HX711 sparkfun BOB is not in a metal enclosure.

I tried putting in the limit max 10000 but the LoadCellLimit trip is set to 5000, so I still get the false trigger. What is the proper way to deal with this in terms of digital filtering, as I may or may not solve the line noises. Is a MEAN the right approach where you toss out anything beyond a potential viable number but you need several samples to establish an average?

Comments

  • The first stage filter could be a median instead of a mean. The median will discard outliers. The number of samples to take into the median will depend on the run-length statistics. If outliners are isolated to single samples then even a three point median could be effective, but if the outliers come in bursts the filter buffer should be at least twice the outlier burst length statistically determined,
  • Good points about bursts. i think I should log a stream and see how the errors are appearing and that will help determine the sample size. I'd like to solve the cause of the errors but in case that is not easy hopefully a software filter will solve it. As I recall From the first tests the errors were always 6 digits and the valid numbers never exceed 5000 under worst case load. If this is confirmed then it will be simple to just ignore anything over 5000 as one option.
  • If the HX711 is taking point samples it could be getting vibration bursts. Load cells can generate surprisingly intense vibrational outputs far beyond their rated capacity for milliseconds. I've only done a couple of tests with the HX711 as it's considered kind of a low-rent device in my corner of the high-performance weighing world, but I have seen load cells sampled at high frequencies do things you'd not think possible.
  • Vibration burst while sitting on a bench though? I would certainly like to learn about any better amps that could easily interface with the prop, especially with a simple spin object that doesn't occupy a cog.
Sign In or Register to comment.