Shop OBEX P1 Docs P2 Docs Learn Events
Propeller-controlled Capacitive Load Cell — Parallax Forums

Propeller-controlled Capacitive Load Cell

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
edited 2013-03-24 06:43 in Propeller 1
Most electronic weighing systems use load cells constructed from metal bars that bend or stretch very slightly and strain gauges to measure the deflections. Constructing a load cell from strain gauges is not very easy and the electronics involve sensitive (i.e. fussy) analog circuitry. This project was an attempt to build a different kind of load cell that I could construct without all the fuss. I involves a three-plate capacitor whose middle plate can move up and down in response to any weight pulling on it. I cut the capacitor plates from 1/16" 6061 T6 aluminum on my CNC mill. The center plate has some side cuts in it to make it deflect under less pressure than would otherwise be required to bend the whole thing. Here's a photo:

attachment.php?attachmentid=92532&d=1337116194

The plates were assembled with 1/32" Delrin spacers and nylon screws to insulate them from each other. I added a top plate made from acrylic and a couple hooks in order to measure force in tension (i.e. hanging weight). Here's a photo of the completed load cell:

attachment.php?attachmentid=92533&d=1337116194

The outer plates of the load cell are driven by two 312.5 KHz square waves 90 degrees out of phase with each other. How much of each signal gets coupled to the center plate will depend on its relative closeness to the respective outer plate. To measure the deflection requires correlating the output with each of the two inputs and comparing the results. This is done by counters, in much the same way that my AM radio used them to detect signals. First, a counter is set up as if it were being used for sigma-delta ADC operation, except it doesn't need to count anything; we just need the inverted feedback. Next the I and Q counters are set up to output 312 KHz square waves 90 degrees out of phase with each other. Finally, two counters are set up in logic mode (XOR operation), each with the negative feedback as an input, along with either the I or Q output from the 312.5 KHz counters. Here's a schematic:

attachment.php?attachmentid=92530&d=1337116193

I borrowed some programming from the AM radio code and added what was needed specific to the weighing. The logic counters are allowed to count for one second, after which the increase in each phsx register is recorded. The ratio of one difference to the sum of both differences is what I use for the "weight" reading. The program I used is attached as an archive below.

In order to test the load cell, I set it up as a hanging scale, suspended from the ceiling and using some chain and a pipe cap as a basket. I also attached the QuickStart board to the load cell in order to keep the leads short (very important, it turns out):

attachment.php?attachmentid=92534&d=1337116194

I got a bunch of bolts, each weighing about 11 grams to use as weights. I wanted to determine two things: 1) would I get a linear relationship between the actual weight and the readings, and 2) would there be any noticeable hysteresis, indicating that the center plate had "mechanical memory." So I did a tare, then added bolts to the basket one at a time, recording their weights, and then removed them one at a time, again recording weights. The results are plotted in Excel (blue), along with a linear trend line (red):

attachment.php?attachmentid=92529&d=1337116193

Although there are some bumps, the results didn't stray far from linearity. Also, there appears to be very little hysteresis, seeing as how the "outgoing" and "incoming" lines stay close together.

On the whole, I consider the experiment a success. Whether this technique has any practical value or not, I will leave for others to decide.

-Phil
«1

Comments

  • JonnyMacJonnyMac Posts: 9,099
    edited 2012-05-15 14:22
    Very cool, Phil!
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2012-05-15 14:33
    Nice ...Ahem... Fish story ... I mean scale... :-)

    No really that's very cool ... I wonder what the results would be if you made your signals 180 Deg out of Phase rather than 90 Deg out of Phase. It's actually a similar circuit to the one I was using for the passive RFID reader.

    You got me thinking though, reading the signal in quadrature versus differential might be more beneficial but very application dependent depending on what you were looking for in the signal to begin with.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2012-05-15 16:26
    Totally awesome Phil-creation. Thanks for showing us how it's done.
  • xanaduxanadu Posts: 3,347
    edited 2012-05-15 16:42
    This project has some real weight to it! Very nice.
  • evanhevanh Posts: 15,889
    edited 2012-05-15 16:55
    Way cool! I'd never even heard of these and I've had to replace/clean up/repair a number of scales in my time ... googling ... well, they are in use it seems and are promoted as superior to resistive versions so either the cable length issue is fixable or the electronics gets embedded in the load cell ...
  • jmgjmg Posts: 15,172
    edited 2012-05-15 17:46
    Inclinometers are commonly Capacitive (differential).

    This might get better differential action, if the centre plate was driven, and two 'capacitance sensor summers' run concurrently on the outer plates - that way you get close to simultaneous CAP readings.

    A limit of this type of circuit, is the granularity of the RC sampling, which does not 'carry over' fractional bits and so you cannot get more precision with longer measuring times.

    A non-sync excite frequency would help, but it would need to be stable.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-05-15 21:16
    Thanks, guys! This was a fun project that I almost gave up on when I had the QuickStart sitting on the bench with long leads going to the load cell. The noise pickup was atrocious, even with a shielded cable going to the center plate. Shortening the leads made all the difference in the world.

    Beau and jmg (who suggested a differential instead of a quadrature approach),

    Quadrature is more robust, since the two signals are orthogonal to each other and their correlations are independent of one another. This means that I can separately extract each signal's contribution to the sum for comparison. By having both signals available indpendently, common mode effects, such as variance with temperature, noise, etc., can be canceled out. Were I to excite the top and bottom plates 180 degrees out of phase, the only data I would have available would be the difference between the two signals, with no clue about the total amplitude. jmg's idea about exciting the center and measuring on the outer plates may have some merit, since two signals are again available; but I doubt that it carries any advantages over the quadrature method. In fact, it might be worse, since two sigma-delta-style counters need to be set up, which potentially have different input characteristics.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-05-15 21:23
    jmg wrote:
    A limit of this type of circuit, is the granularity of the RC sampling, which does not 'carry over' fractional bits and so you cannot get more precision with longer measuring times.
    True, if you neglect to consider the effects of the input capacitance, which the feedback pin must charge and discharge through a resistor to maintain a constant voltage. But the "carry-over" from this capacitance is what permits fractional bits to accumulate over longer time periods, leading to greater precision.

    -Phil
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-05-15 21:39
    Nice work Phil. I have never played with load cells so this was a nice education... thanks for posting.
  • Ken GraceyKen Gracey Posts: 7,390
    edited 2012-05-15 21:46
    Thanks for sharing, Phil. I didn't know how a load cell worked until I saw your example. I was expecting to see Browser in a basket, hanging from the load cell. I'm even more impressed that no matter what you seem to take the time to experiment.

    Ken Gracey
  • jmgjmg Posts: 15,172
    edited 2012-05-15 21:59
    True, if you neglect to consider the effects of the input capacitance, which the feedback pin must charge and discharge through a resistor to maintain a constant voltage. But the "carry-over" from this capacitance is what permits fractional bits to accumulate over longer time periods, leading to greater precision.

    Yes, I've been trying to decide what limits that.
    One thing I can see that should be avoided, is the I/O clamp diodes, so that means a capacitive divider for the impulse drives - keep the signal just high enough to avoid the diodes.
    Then, the Feedback resistor can determines the 'carry over' time constant. - So there may be a 'best value' for that ?
    More accurate may be to call this residual Auto-Zero voltage a dither value, as that better describes how it improves precision.

    Did you measure the plate capacitance, and get any waveforms. Drive in and RC 'spikes' out ?

    A benefit of driving the outer plates from lower impedance is less pickup noise.
    In My pencil sketches, suggest a phase-shifted impulse, would give better differential results than Quadrature.
     Phase shifted:
     Q: ______/====\____________/====\_____________/
     I: _______________/====\_____________/====\____
     
     Quadrature:
     Q: ______/=========\__________/===========\________
     I: __________/===========\_________/===========\____
    

    I think the top option, interacts better with the XOR counter gate effect ?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-05-15 22:04
    Ken Gracey wrote:
    I was expecting to see Browser in a basket, hanging from the load cell.
    With a cat of Browser's ... um ... carriage, I'm afraid something might've gotten pulled out of the ceiling. :)

    BTW, "load cell" is a generic term that applies to any device that converts a force to an electrical signal. Most load cells in commercial application use multiple strain gauges in Wheastone bridge configurations, rather than capacitive effects. Here's an article that explains them better than I could:

    I once had a Sears electronic bathroom scale that I disassembled to see what made it tick. The weighing platform sat upon multiple steel bars joined in an elaborate fulcrum configuration, each with a couple strain gauges attached. After going through the Wheatsone bridge and amplification via op amps the signal was fed to an RC timing setup using a General Instruments NMOS PIC controller. This was before Microchip acquired the PIC controller line. That was my first encounter with strain gauges.

    BTW, it's much harder mechanically to design a scale that things sit on, compared to one that things hang from. In the latter case, it's simple to make sure that the applied force is normal to the sensor that measures it. In the former case, things like unbalanced loads and the torques they produce have to be considered.

    -Phil
  • jmgjmg Posts: 15,172
    edited 2012-05-15 22:04
    ... I almost gave up on when I had the QuickStart sitting on the bench with long leads going to the load cell. The noise pickup was atrocious, even with a shielded cable going to the center plate. Shortening the leads made all the difference in the world.

    I'd expect that, as you are trying to measure fractional pF here, and adding more cables increases the un-changing portion, as well as much more 'aerial pickups'. Less separation between the plates (thinner spacers) should help too. Anything to make the change a larger percentage.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-05-15 22:36
    Here's what the various signals look like:

    attachment.php?attachmentid=92559&d=1337146555

    The P-P output from the center plate is about 2V, so there's no worry about involving the I/O clamp diodes.

    -Phil
    640 x 480 - 19K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-05-15 22:40
    jmg,

    In your diagram,
     Phase shifted:
     Q: ______/====\____________/====\_____________/
     I: _______________/====\_____________/====\____
     
     Quadrature:
     Q: ______/=========\__________/===========\________
     I: __________/===========\_________/===========\____
    

    there would be no advantage in using the top option. In the quadrature technique, contributions from I to Q simply cancel, and vice versa.

    -Phil
  • TubularTubular Posts: 4,699
    edited 2012-05-15 22:42
    Beautiful, Phil. Saw some capacitive load cells at a trade show in the states some years back... Wipotec I think. There are also industrial joysticks that work similarly.

    I'm interested in those little deviations and what could possibly cause them, apart from those cheap bolts where they forget to slot the head properly (I'm sure that's not it!)

    Couple of thoughts... if you made the middle (pickup) out of PCB you could implement a guard ring. Also are your "buckets" an even number of 312.5 khz cycles (probably) or are you dithering from bucket to bucket by having non-integer number of cycles? There are arguments both ways...
  • jmgjmg Posts: 15,172
    edited 2012-05-15 22:52
    The P-P output from the center plate is about 2V, so there's no worry about involving the I/O clamp diodes.

    Obvious from the waveforms, I missed that the plates naturally act as a 50% voltage divider, so you have a 1/2 Vcc step, with no additional load.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-05-15 23:04
    Tubular wrote:
    if you made the middle (pickup) out of PCB you could implement a guard ring.
    True, but FR4, being a composite material is not purely elastic and would exhibit some hysteresis. The glass fibers may also fatigue rather quickly compared with aluminum.
    I'm interested in those little deviations and what could possibly cause them, apart from those cheap bolts where they forget to slot the head properly (I'm sure that's not it!)
    It can't be the bolts, because I'm sure I did not put them in and take them out LIFO style. It might be from fine metal dust that I didn't get completely cleaned from the plates or even from scratches and dings in the metal. (As you can see from the photo, I did not bother to polish the plates.) Other than that, I cannot identify any possible sources of stiction that might contribute to the bumps, even though it does seem to be deterministic. It could also just be a matter of using a scale more suited for measuring pounds to measure ounces.
    Also are your "buckets" an even number of 312.5 khz cycles ... ?
    Yes, there are 312_500 cycles in each sample. Also, I picked 312.5 kHz since it divides 80 MHz by a power of two. So there are no issues with jitter in the I and Q signals, which would compromise the orthogonality of the two signals.

    -Phil
  • jmgjmg Posts: 15,172
    edited 2012-05-16 01:00
    there would be no advantage in using the top option. In the quadrature technique, contributions from I to Q simply cancel, and vice versa.

    The waveforms have given me a slight change, see below.
     Quadrature:
     T: ______/=========\__________/==========\________
    BI: __________/==========\_________/===========\____
              TTzz       TTzz      TTzz        TTzz
     
    Change to Phase shifted 2: T.H == B.L
     T: ______/=====\_______________/=====\___
     B: =================\_____/==============
                     TTzz      BBzz 
    TTzz is measure TT, then AutoZero phase, and 
    BBzz is measure B, then AutoZero phase 
    

    To me, the waveforms show it is not doing a truly balanced measurement, which should be one integrate cycle per active-capacitor to best null common mode variances like humidity effects.
    If you look carefully you can see the Auto zero most clearly when T=L and B=H, and the measurement zones always follow a Top Edge.


    The Bottom edges are indirectly measured, and then by a constant multiplier.(k*dB)

    The modified Pulse will measure Top, then Bottom, in a mirror and alternating manner, and the Counter conditions would be
    !T & FB -> Count During : TT + Tz + PWb + Bz
    B & !FB -> Count During : BB + !Bz + PWt + !Tz

    PWb = PWt, and Tz ~ !Tz, Bz ~ !Bz, keep zz times reasonably short.
    It would be nice to avoid Tz, !Tz

    The plate waveform will be very similar to what you show now.
  • evanhevanh Posts: 15,889
    edited 2012-05-16 09:00
    jmg wrote: »
    Inclinometers are commonly Capacitive (differential).

    I certainly wouldn't put one of those in the same category as a load cell. Last time I worked with an inclinometer it had all the electronics on the back of the transducer assembly, it required a clean 10 volt supply, I could almost crush it in my hands and the IP rating must have been 000!
  • localrogerlocalroger Posts: 3,451
    edited 2012-05-16 15:35
    Phil, this is really exceedingly clever and I may try to make some time to play with it myself. I suspect the nonlinear bumps in your graph are due to the sense plate not remaining exactly parallel to the top and bottom plates. Real capacitive weight sensors use flexure systems to keep the sense plate parallel even in hanging systems. It's really a remarkably good result for such a quick and dirty attempt. I think with a little brainstorming I could see a way to mod this into the capacitive equivalent of a hanging S-style strain gage cell and make it more linear and repeatable. (And I work for a scale company, and have worked with weight sensors of every conceivable type since about 1985. And the capacitive S-cell still wouldn't be legal for trade :-)
  • roland82roland82 Posts: 1
    edited 2012-08-20 22:07
    That's looking like one fine load cell. Capacitive sensors are indeed sensitive to long leads. The trick is to use shielded leads and to drive the shield with the voltage seen on the center conductor (input). Your input should to a unity gain op amp which would drive the shield. Those slight nonlinearities in the output have me curious. I'm wondering what a carefully constructed load cell would look like. Has anyone tried this again?
  • Christof Eb.Christof Eb. Posts: 1,193
    edited 2012-08-21 03:47
    Hi Phil,

    this is a very interesting setup and experiment!
    If you want to, you could explain a little bit more detailed, how the counter and software setup works. What I don't get is, what exactly is being counted or where exactly comes the step between analog and digital.
    What do you estimate is the relative difference of the two capacities? Can you see or measure the deflection of the plate?
    Thanks for sharing!
    Christof
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-21 07:39
    What I don't get is, what exactly is being counted or where exactly comes the step between analog and digital.
    The I and Q signals are coupled into the center plate in relative proportion to the closeness of the plate to the two sources. Because the two signals are 90 degrees out of phase, they are mutually conjugate and can be detected independently from each other. The combined waveform is coupled into a sigma-delta ADC, comprising an input cap and feedback resistor. The feedback positive pulse density will be inversely proportional to the input voltage at any instant in time, in an attempt to maintain a constant voltage on the input pin.

    In order to separate the I and Q contributions to the signal, two additional counters are employed. Each has two inputs: either I or Q, and the feedback signal. The counters are set up to XOR their two inputs, which effectively correlates the pulse density on the feedback pin with the I and Q signals. Therefore the count on each counter after a given time interval will be proportional to the contribution of the selected I or Q component on the input pin.
    What do you estimate is the relative difference of the two capacities? Can you see or measure the deflection of the plate?
    I never measured the actual capacitance. I can see the center plate deflect, but there's too little room for fitting a caliper to measure the displacement.

    -Phil
  • potatoheadpotatohead Posts: 10,261
    edited 2012-08-21 09:12
    Excellent work Phil. I know a notch more now. Thank you!
  • Christof Eb.Christof Eb. Posts: 1,193
    edited 2012-08-21 12:00
    Thank you, Phil, for the explanation.
    Perhaps you have seen my experiment:
    http://forums.parallax.com/showthread.php?138702-A-Physics-Experiment-Measure-a-Force-or-a-Weight-with-the-Propeller
    I am wondering, if your XOR-input counting could be used there somehow to find the resonance frequency of the wire faster, because the phase between the propeller output and the electro-mechanic system should be dependant from the relation of the two frequencies?
    Christof
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-21 12:38
    By squaring and summing the outputs of the I- and Q-component counters, you can get a number that correlates to how well the reference frequency matches the I/Q frequency. You will still have to do a search to find out where the sum-of-squares is maximized, though. The biggest advantage will be high-frequency noise rejection which, in your thread, you stated was a problem.

    Another approach for eliminating noise would be to employ a phase-locked loop from the output of your op-amp to clean up the signal. It's effectiveness will depend on the range of frequencies you need to cover and the lock range of the PLL IC. Its advantage is that you can just count edges with the Prop, rather than having to search for a maximum response.

    -Phil
  • Christof Eb.Christof Eb. Posts: 1,193
    edited 2012-08-22 03:51
    The idea was to get the direction for the search from the phase information. A spring-mass- system should have 90° phase shift for exact resonance, less for stimulus too low and more for stimulus too high. It looks like it would need 3 counters with the same frequency but different phases 0, +45°, +135°?
    Christof
  • idbruceidbruce Posts: 6,197
    edited 2012-09-28 18:44
    Ahhh the experimental process. Don't you just love it! Well done Phil.

    Bruce
  • Don MDon M Posts: 1,652
    edited 2013-03-24 06:43
    I know this is an older thread but thought I'd comment on it.

    I tore apart a broken blood pressure monitor this morning and was looking at how it worked in particular what it used to measure the pressure. What I found is that it uses a 74HC02 quad nor gate to form an oscillator and between one of the stages of the oscillator there is a mechanical bellows attached to a round plate. The plate then changes its distance between it and another plate based on the amount of deflection from the bellows thus changing capacitance and frequency of the oscillator. Fairly simple.

    I knew I had read somewhere on here about capacitive load cell or pressure sensing so I had to look.
Sign In or Register to comment.