This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

24-bit A/D converter noise free resolution help

hi,
i am developing a weigh scale application using Cirrus Logic 5532 24-bit ADC in unipolar mode.the output i am getting is very unstable (flickering on display). Can anybody please tell me how to get a stable count.

Parents
  • Thanks for all the replies.
    first let me clarify that i am not looking for full 24-bit resolution.
    i just want 18 bits resolution with manageable noise to get a weight to count ratio of 1:5.

    please guide me as to how i should average the counts in my software so that the noise in the counts is not reflected in the weight displayed.

Reply
  • Thanks for all the replies.
    first let me clarify that i am not looking for full 24-bit resolution.
    i just want 18 bits resolution with manageable noise to get a weight to count ratio of 1:5.

    please guide me as to how i should average the counts in my software so that the noise in the counts is not reflected in the weight displayed.

Children
  • i just want 18 bits resolution with manageable noise to get a weight to count ratio of 1:5.
    "just" 18 bits, you've go to be kidding, good luck, you will need it. That requires a PhD in layout (read Howard Johnson, PhD for suggestions)

    please guide me as to how i should average the counts in my software so that the noise in the counts is not reflected in the weight displayed.

    you can not hide it to more than one or two bits of noise.

    the tried and true is (shown for avg of 16)

    for each reading of the loadcell
    array[index] = loadcell_weight
    index++
    index &= 15

    display weight = (array[0] + array[1] + ... array[15])/16

    however DO NOT BELIEVE that any amount of averaging will hide all noise.

    VERI careful hardware design and sophisticated layout is the only way

    Erik

  • CS5532 is a sigma delta A/D converter with chopper stabilized op-amp.
    its PGIA can be set from 1x to 64x and gain reg from 1 - 40.

    According to the datasheet the it offers less noise at low output word rate
    >>i am usng the chip at a output word rate of 7.5Sps with PGIA at 64x with gain register set at 4 , at which it should provide 19 bits of noise free resolution.i am using only 18 bits.my display is 6-digit 7seg display.

    >>my display is flickering in +/- 7 counts range with occasional surges in the count with weight to count ratio of 1:5, resluting in flicker in display of weight (+/- 3).i am using arithematic mean after every 2 readings.

    >>please tell me what else i can do to reduce the flicker and make it more stable.i also dont undestand why the occasional large deviations from the mean.i have already tried all other possible configration for the ADC.

    this is my first project,i have already completed the eeprom i/f ,display i/f and keyboard i/f.and implemented successfully both the i2c and spi protocols.this is the last hurdle ,so plz help me out.


    sorry for such a long explanation......

    Thanks in advance.

  • my display is flickering in +/- 7 counts range with occasional surges

    +-7 you may be able to (almost) average out, but the "occasional surges" need redesign/relayout you can not get rid of that in software. It HAS been tried, believe me, the costliest part of a scale is the analog, the $0.83 uC does not matter. Every scale manufacturer and his brother is trying to get by with a cheaper analog section, last I checked, no one had succeeded.

    One experience: if the chopper for the analog is not synchrounous with the uC clock you may get "funny things" I had to change a free running oscilator for the CSA to T2out.

    Erik

  • You are getting +/- 3 bits (i.e. 0..7) with occasional surges.

    Assuming you really have done everything possible to get the best possible signal, the only thing left is DSP.

    Digital Signal Processing sounds daunting, but don't be put off: the on-line book I mentioned is just what you need and it is the most readable text on the subject I have ever seen. If you are new to this, a little investment of effort now will pay good dividends in the future.

    http://www.dspguide.com/pdfbook.htm

    After looking at chapter 2, read chaper 15.

    The good news is that any amount of genuine random white noise can be eliminated from a signal; a moving window is the ideal algorithm; and a moving window is as simple as DSP gets! The bad news is that this may require in infinite number of samples to be processed. And, of course, your noise may not actually be random white noise.

    "The amount of noise reduction is equal to the square-root of the number of points in the average. For example, a 100 point moving average filter reduces the noise by a factor of 10."

    For your application, a moving average filter should be just the ticket. You will need a window size of about 100. 127 would be a good choice for a processing a ring buffer. To get a reasonable response, you will have to take samples every 10ms or more. Do note that a moving window is quite different from simply taking the average of n samples.

    Multiple passes, i.e. feeding the result of one moving average window into another moving average window, will give a nice smooth response. If you are not constrained by memory limitations consider up to four passes. While this does not actually improve the noise rejection, the smooth response should be just what is required for display purposes.

    Incidentally, I have some digital kitchen scales at home - I don't know how they work in detail, but they behave in a manner entirly consistent with this sort of implementation.

    Enjoy.

  • genuine random white noise
    Is rarely the problem with a scale. As Graham stated, that can easily be filtered buy moving averages (se my pseudocode above).

    The real problem (aside from drift) is the spurious noise. Many techniques have been tried and failed because someone putting something on the scale look exactly like spurious noise and a scale that takes many seconds to show the weight does not have many applications outside the laboratory. For a laboratory scale sometimes the ultimate precision is more important than fast weighing.

    Zero drift is such a problem that autocalibration is a must, for some reason full scale drift is not that big a problem.

    Erik

  • I see you're swimming in the deep end of the pool today. A lot of bandaids have been suggested here without getting at the cause of your signal variation, you need to understand exactly what is going on in your circuit before you slap a "fix" on it because it's likely to come back and bite you later. At > 14bits resolution there are usually many contributors to the errors which are loosely called noise. You need to do a set of experiments to isolate and measure those contributors, some are not obvious like encasing your circuit in a grounded metal box or running it from a battery instead of a bench supply. The first and most fundamental one is to take the two differential input pins and short them together, what does the output look like?
    Now tie them across vref, what does the output look like? You can do other things like this that take the circuit board out of the picture.
    In the original circuit does the amplitude of the noise change when you change the gain of the PGA?
    Expertise in this area comes from theoretical background combined with years of tinkering in the lab. As stated earlier these people are few and far between. Yours sounds like a commercial application so you should hire a consultant or plan to spend a lot of time in the lab. I routinely get converter limited performance with 14bit systems and have achieved 19 ENOBs using sigma delta converters and tightly bandlimited AC signals.

  • Once again thanks for all the replies.

    The first and most fundamental one is to take the two differential input pins and short them together, what does the output look like?

    As you suggested,i am doing offset calibration.The chip itself provides self offset calibration at different PGA gain settings using internal shorting of the differential pins.But As you mentioned it seems there is a zero drift taking place. should i provide recalibration option when the system is running.

    In the original circuit does the amplitude of the noise change when you change the gain of the PGA?

    The amplitude of noise does change when i increase the gain.

    some are not obvious like encasing your circuit in a grounded metal box or running it from a battery instead of a bench supply.

    Also since i am operating at low output word rate from the adc(this helps in reducing the noise),so i cannot perform more than 4 counts averaging as otherwise the display will take too long to settle.

    I have not yet encased the circuit as you mentioned. will placing it in a grounded metal case help in reducing the flicker.Also i am operating it on bench supply and not battery.

    I am currently calling the adc_read() function in the main loop,will placing the code in Timer ISR make any difference.is it possible that the occasional large deviations are due to incorrect read timings.

    Mine is a small budget project so i cannot invest in a DSP plus i have no prior experience in DSPs.

  • I agree with all points but would add one piece of advice. ALL digital I/O should cease during the ADC conversion. At least during sample if the chip has sample/hold.
    Bradford

  • Mine is a small budget project so i cannot invest in a DSP plus i have no prior experience in DSPs.

    You don't need a DSP chip to do digital signal processing. The moving average filter is not computationally demanding because it is easy to maintain the sum of all the values in a buffer. When a new value is added to the buffer, its value is also added to the sum. When an old value is released from the buffer its value is subtracted from the sum. It does not matter how long your buffer is, you just do one add and one subtract for each new value. An 8051 should be able to do this easily, all you will need is sufficient memory to store the buffer.

    Of course, for all the reasons already mentioned, DSP is not the answer to all problems with noise. However, it is likely that a moving average filter will find a proper place somewhere in your application.

  • We use the same CS5532 for current measurement in battery management systems and I agree that its output might be very noisy. I use the upper 16 bits of the 24 bit AD-result and there's still noise.

    Noise depends on the hardware design (PCB Layout...). Don't use the same ground and supply for AD-converter and controller. The controller is very noisy, and that might also influence its supply.

    Before using software filtering (moving AVG), a hardware filter (i.e. anti aliasing filter) and perhaps a pre-amplifier (instrumention amplifier) is necessary.

  • Mine is a small budget project so i cannot invest in a DSP plus i have no prior experience in DSPs.
    1) there is no need for a DSP
    2) "limited budget" and "24bit ADC" - the joke of the year.
    You can NOT achieve anything above 14 bits without a 4 layer board, a chopper stabilized op-amp with expensive high precision resistors, a high precision voltage reference, an extremely quiet power supply ......

    Erik

  • this is my first project ...
    Get an analog PCB layout book or you will never get anywhere with this.

    Erik

  • First of all i would like to tell u that the problem was with power line noise rejection. I had wrongly configured the ADC for 60Hz noise rejection(7.5Sps OWR) instead of 50Hz noise rejection and corresponding OWR of 6.25Sps.The display is now much stable(+-1 weight).

    this is my first project ...
    Get an analog PCB layout book or you will never get anywhere with this.


    This really is my first project.
    i am only developing the software for the project invloving the interfacing of the uc with the ADC, display, keyboard and AT24C02 eeprom in C using keil C51 tools and hence wanted to how if any coding could control the flickering.
    i was not part of the pcb desinging and layout process.

  • First of all i would like to tell u

    Why do you use the forum to tell micro something?

    now:
    The display is now much stable(+-1 weight).
    earlier:
    my display is flickering in +/- 7 counts range with occasional surges

    do you still have the "occasional surges"?

    Erik