Maker Pro
Maker Pro

Load cell + hx711 = drifting value

mikgol

Jul 6, 2013
87
Joined
Jul 6, 2013
Messages
87
Hi there,

I'm using a load cell (TAL220 10kg) and a HX711 with an Arduino to measure weight.

I'm using the "HX711.h" Arduino library to read the values.

Over time, the value drifts away and the device needs to be tare'd again. In my case, it drifts from 0.5 kg to 0.9 kg in a matter of minutes.

I need it to not drift - I assumed that a load cell worked in a way where I could tare it and let it run for weeks and still get an accurate weight (or at least a stable value).

Is the drift because of some software rounding thing in the library, or is it just not realistic to expect a load cell to not drift and it's simply not within the laws of physics on how they work?

I'm hoping it's software, otherwise it's back to the drawing board with my project (it needs to stay on all the time and detect water level).
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
There are many reasons for drift. It could be:

  • The circuit is very sensitive to the supply voltage and that is fluctuating.
  • The sensor is temperature dependent and this is either varying or current through it is causing self-heating.
  • You have an error in your code.
  • Your ADC is not stable (it could be an unstable reference -- do you have a voltage reference or are you using the supply).
  • Your circuit is picking up noise and this is being seen as a weight on the cell.
  • You're not using the cell correctly.
  • There is some mechanical issue that is preventing free movement of something that results in a residual load left on the cell.
Other people could probably come up with more.

In short, you need to determine what the issue is and what you can do about it.

A simple test is to display the raw ADC output while measuring the input to make sure that your reading tracks the ADC value and that the ADC value tracks the input voltage and that the input voltage tracks the load. This will point you at what is likely to be the value which is drifting and thus alloww you to concentrate on that particular part of your circuit.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
And it would immensely helpful if you were to post a complete schematic, including the load cell connections and how you zero-out the load cell and adjust its sensitivity (calibration).
 

mikgol

Jul 6, 2013
87
Joined
Jul 6, 2013
Messages
87
Cheers for the replies guys.

I appreciate the comprehensive list of what could be causing it Steve, especially the suggestion to try raw values - great idea! At least I can eliminate my theory about a software rounding error. I'll give that a go.

Hevans1944, load cells have 4 wires, that feed into the HX711 board to amplify the tiny voltage changes. Here is a schematic:

[mod edit: link to lmgtfy deleted - not respectful in light of the help we try to give]

... regarding calibrating them etc. there are some great youtube video's. I highly recommend a load cell if you need to measure weight in one of your future projects (although maybe for not a purpose like in my project - time will tell, but I will post my findings here to propagate load cell knowledge on the Internet)

... anyways, the scale works remarkably well (I am testing with water - 1 litre = 1KG), I guess I was hoping to hear some kind of physics explanation on how load cells work that would explain why it's not physically possible within the realms of this universe for load cells like this to hold a constant value for a constant weight. I guess Im being lazy and will have to google that one myself :)
 
Last edited by a moderator:

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
I guess you missed my point. I know how to hook up a load cell, how to provide a balance circuit to zero the load cell output, how to provide a circuit that allows the load cell output to be calibrated, and how to condition the load cell output prior to application to an A/D converter, in this case your HX711.

What I don't know is whether you know how to properly do all those things. The link you posted does not inform me of that. It leads instead to a Google search result of using the string "hx711 schematic" for the search parameters. On the results page are lots of schematics showing how to interface the HX11. What I would like to know is how YOU interfaced the TAL220 to the HX11, since you are the one having drift problems. I have never seen drift like you describe in a precision load cell such as a Lebow or Honeywell. Who knows what kind of crap you get from China?
m_Model_3397_Load_180x180_front.png


The symptoms you describe can be caused by an incorrectly bonded strain gauge, among the other things that Steve mentioned. You should check the load cell hysteresis at full load capacity to see if it reliably returns to zero after repeated cycling. A poorly bonded strain gauge will have it all over the map, unable to hold a zero offset. Improper excitation not referenced to the A/D converter reference voltage will also cause zero drift, especially with a 24-bit A/D.
 

samantha_philip

Apr 25, 2019
2
Joined
Apr 25, 2019
Messages
2
Unfortunately as much as many want load cells to be accurate they have a couple of inherent flaws which require a lot of extra electronics and engineering to overcome and thus become expensive. To get load cells to work accurately typically cost hundreds to thousands of dollars.

The two main flaws offset drift and load hysteresis.

The problem is a mechanical thing mostly caused by temperature and the mechanical properties of the materials of load cells. The type you have are aluminum, with temperature the metal structure expands and contracts and bending moment changes. In theory the whetstone bridge deals with this, but it isn't enough and you get offset drift over time. Keep the temperature stable and your measurement will be more stable, but it will still drift some.

Load hysteresis is where the same load(let's say 5kg) measured from min load(0kg) to the 5kg load compared to 10kg load down to 5kg will return a different result. This is due to the mechanical properties of the load cell, effectively a memory. Therefore outputs from load cells can report curves in their range response to load, typical a positive curve on the upwards load and negative on the downwards load. Combine this with offset drift and results can lead to relative high error.

Ways around the hysteresis is to use a load cell roughly one-third of the range you require, the negative is that you lose sensitivity to load. This can limit the load on load off difference which is more stable, but you lose sensitively to small changes.

You could try adding a temperature sensor, plot different temperatures to load. Use varying loads as the different load will have possible different offset effects. It gets messy.

There are reasons why accurate scales costs a lot.
to learn more about load cells visit here:
https://tacunasystems.com/knowledge-base/load-cell-tips/

An electrical/electronics engineer looking to make a working product using this device might need to perform such an analysis and AUTOCAD helps with that.
 
Last edited by a moderator:

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
There are reasons why accurate scales costs a lot.
Yes there is, but this is a really ancient thread that was abandoned by the OP almost three years ago (last seen here November 4, 2016). However, those of us who have been responsible for load cell and strain-gauge instrumentation over the past fifty years or so appreciate your efforts. The link to Tacuna Systems appears to be especially useful, for both the newbie as well as those who have been on the bleeding edge of this technology for a long time. I enjoyed visiting and reviewing information about this niche technology on their website pages.

As you are no doubt aware, load cell performance is a mainly a materials issue. Hysteresis is an especially pesky problem, and even optical interferometer methods (where they are warranted) do not offer a "perfect" solution. However, in engineering, "gud enuf" is good enough. Even the cheap aluminum Asian crap has its place... somewhere. Joy-stick force controls, maybe?

Maybe just go digital.
This has been the "correct" approach for a long time... ever since the advent of cheap, easily programmable, microprocessors. Even before that, manufacturers were offering "laser trimmed" analog components to make it easier to control offset and drift before the final conversion to a digital signal value. Now the trend seems to be to measure whatever "errors" exist in the analog circuitry and store corrections in a look-up table, or as a correction algorithm, depending on the nature of the error and how stable the corrections must be over time, temperature, shock, vibration, etc. I am amazed and forever grateful that the continued micro-miniaturization of electronics has brought so much inexpensive stability to my profession and hobby.

When I started down this road, axial-leaded carbon-composition resistors with ten percent resistance tolerances were the norm. Some twenty years later, metal-film and carbon-film resistors with one percent resistance tolerances became de facto bench-stock parts. And today there is a huge range of resistors available, some barely visible to the naked eye, others with kilovolt capability and one percent or better value tolerances. And that's just one component! Similar advances have occurred across the board everywhere you look... with the possible exception of electro-chemical batteries. Still waiting (patiently) for a decent deep-cycle, long-life, fast-recharge battery while limping along with lithium-ion technology.:rolleyes:
 

rAlvarez

Feb 19, 2020
6
Joined
Feb 19, 2020
Messages
6
Thank you @(*steve*), @hevans1944, and @samantha_philip for providing insightful replies and valuable pointers on this topic. The prevalence of Arduino and low-cost HX711 and load cells inundates the web with noise that makes it hard to take designs to the next level. The Tacuna articles are very insightful.

I see about 20X the expected hysteresis on my system, and I'd appreciate your help understanding the source, potentially improving it, or selecting better components to solve this. In particular, the load cell specs suggest a 0.02% F.S. hysteresis while I see about 0.4% while only using about 10% of the F.S.

I think the electronics are stable (see below), and my suspects for hysteresis are threefold: The load cell, the mechanical mount (3D printed out of PETG), or a metallic spring (McMaster 9044K85) I'm using as a test sample.

The background
I'm designing a system to measure the force vs. length of specific polymer fibers, and I thought I could get way more precision and stability out of the cheap Chinese load cells that what I'm getting. I've improved the HX711 by adding capacitors to the supply, excitation, and output, as well as improved reading precision by averaging out many (10 to 100) readings in code, but now I find myself plagued by hysteresis way beyond what the specs suggest I should see.

My system consists of a 100 g inexpensive load cell connected directly (with 4-way braided wires about 10 cm long) to the HX711, which is driven by an Arduino Mega2560. The HX711 is driven by power pins on the Mega and further decoupled by ~3 uF on the HX711 board. The long term stability of the readings is ok with only ~0.5 g progressive drift in ~24 hrs while there is about 1 or 2 C change in environment temperature. This leads me to think the power supply is sufficiently stable, and there is not much noise on the electronics.

The hysteresis I observe happens when I run a loading and unloading cycle on the spring (or the polymer fiber) and then view the resulting graph. The load ranges from 0.5 g to 7.8 g, and the spring is stretched at about 0.5 mm/min (so a full cycle takes ~1.5 mins, and I sample position and load every 1 s). Instead of overlapping lines on the extension and contraction cycle, in the graph, I see a gap of about 0.4 g, which corresponds to a 0.4% hysteresis on the load cells full scale of 100 g. This is 20X larger than the spec, which says hysteresis should be 0.02%. Surprisingly, when I do a simpler hysteresis test, I don't see this gap. If I tare the loadcell and then apply a load of 3.6 g (confirm the reading of 3.6758 g), then add an additional 13 g, and then remove the 13 g, I then see the reading return to the expected 3.6709 g, suggesting a hysteresis of 0.005%.

Any suggestions about what is going on?

Overall, I have no issue spending a few hundred on a quality load cell and amplifier system that can measure somewhere in the vicinity of 20 g (0.2 N). However, my project is heading towards testing the reliability of multiple fiber samples, so I was hoping to build a system with tens or even hundreds of load cells, so an economic solution would be preferred.

Can any of you consult towards selecting proper components or improving the performance of the current ones?

TIA!
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Is there a difference in how the load is applied in the two cases? I'm thinking that one sounds like a slowly applied load that is held for some time before release vs three other where you just apply a weight, measure and release.
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
I would make a dummy load cell with four sooper-dooper resistors to see if the rest of the instrumentation is stable. Add a high value resistor to check calibration. If this system is stable, then you will have to get a better load cell.
 

rAlvarez

Feb 19, 2020
6
Joined
Feb 19, 2020
Messages
6
Is there a difference in how the load is applied in the two cases? I'm thinking that one sounds like a slowly applied load that is held for some time before release vs three other where you just apply a weight, measure and release.
Yes, there is a difference in how the loads are applied.
In one case, where I see the hysteresis, the load is applied very progressively by stretching a spring. One end of the spring is attached to the load cell and the other to an effector that very slowly moves and stretches the spring. So yes, the load is slowly and progressively applied from 0.5 g to 7.9 g and then back to 0.5 g in a cycle that takes about 1.5 minutes.

In the other case, where I do not see hysteresis, I carefully hang weights on the load cell by hand (using tweezers). I try to make it so that the load monotonically increases or decreases as new weights are added or removed. But yes, in this mode the load is applied in much greater discrete steps over a shorter time.

Are you thinking this could be some creep-induced hysteresis? If I hang a static weight for a long time the system is stable and does not show creep.

After posting this last night, I thought that if I don't see hysteresis with weights, but I do see it with metal springs (fibers) then perhaps the springs themselves have the hysteresis. Could this be?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Yeah, I was thinking creepage or a lack of stability over minutes as opposed to seconds. Your description seems to eliminate this, but it also points squarely at your test method (with the spring) as being a major contributing factor.

Is there any way that some load could remain on the spring?
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
Without seeing your experimental setup, I would first suspect the plastic holder of your fiber. The metal components, such as the spring, do not appear to be a factor, nor does the load cell since there are situations, such as adding and removing weights by hand, where it performs to specification. Plastic, in general, is a poor choice of means to secure (without creep) anything. Try making the fixture from aluminum or stainless steel. You can worry about cost-effective ways to make a hundred or so later, after you secure the contract by successfully doing this one. If a metal fixture doesn't solve your "creep" problem, it probably exists in the fibers. Good to know that, if it's true!

The Air Force has a LOT of data on fibers from decades of work done at Wright-Patterson AFB that eventually led to major replacements of aluminum structural components on airplanes with carbon fiber composites. Everything from fiber properties to epoxy properties was tested, both individually and when assembled into a composite structure. This data should be available to the public if you just know what to ask for and where to look. Test methods as well as test results are both important to avoid re-inventing this particular wheel, which is just now being widely used in new commercial aircraft construction.

MODERATOR: Doesn't this topic now deserve it's own title and thread since the original poster has long ago disappeared? Load cell technology is very mature, but there are those coming up who are not aware of how it all works and plays together, or even how a load train should be constructed.
 
Last edited:

rAlvarez

Feb 19, 2020
6
Joined
Feb 19, 2020
Messages
6
Thanks to @(*steve*) and @heavans1944 for your input.

I think I found the issue! And it is not the load cell or the support. I too suspected the issue with my setup is the way loads are being attached. The fibers under test are made of proprietary materials for specialized new applications so no wheel-reinventing here, but I always appreciate anyone trying to save me from myself ; )

I tested repeated load cycles by carefully mounting a piece of AWG36 Stainless Steel wire to the PETG mounts. I looped the wire so that it would be constantly loaded and not slip and then ran the test with way more load than before (cycled between 60 g and 90 g).
I observed a hysteresis pattern that very clearly suggests the issue is backlash on the effector that stretches the load. There seems to be a deadspot of about 0.030 mm (~ one thou) while the effector switches direction. This number is perfectly consistent with the specs of the lead screw that is driving the effector. With this info, I went back to look a the data from the spring and BINGO! The spring showed a hysteresis cycle with a 0.03 mm separation.

At this point, I know the limits of my system, the magnitude of hysteresis on a stiff body and that the hysteresis I observed on the polymer fiber sample (about 2 mm) is real. I'm surprised the PETG mounts do not seem to contribute significantly to this hysteresis, but I'm happy I don't need to machine them out of metal.

Thanks again for all the input!
 
Top