This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AFE4300: Weigh scale values inconsistent

Part Number: AFE4300

Hello,

We are trying to use AFE4300 for weight measurement and we got the basics working. We are able to enable the weigh scale front end and also see 1.7V on VLD. We are using this to excite our load cell (200 KG capacity). We calibrated the scale using 30 kilos of known weight. When we try to measure back the same 30 kilos, the values are inconsistent across trials.

We get 30.4Kg, 30.9Kg, 27Kg, 31.5Kg, 32kg across 5 different trials. I checked the raw adc values and I found that the adc values themselves are varying. What could be the issue here? Where should I start looking to be able to debug this? 

Please help.

Regards,

Shnakar

  • Hello Shankar,

    We have received your inquiry regarding the device AFE4300 and hope to have some answers back to you shortly.
  • Dear Praveen,

    Thanks for the response. Meanwhile I had some doubts regarding the data in the datasheet.

    I see that the first stage gain is taken to be 183 in the document. However, I see that in the reference schematic (+BOM) a 500ohm resistor is used for Rg. That would make the first stage gain to be 1+ 2 X 100000/500 = 401 am I right in this calculation?

    Further more in the next section we need Vmax_diff that should be given by Vref/GAIN. Again Vref is 3.3V so my Vmax_diff (assuming second stage gain to be 1) would be 3.3/400 = 8.25mv

    Next we come to common mode volatge. If I substitute 8.25mv for my max diff I get a range of 1.4V < CM < 1.9V

    Am a bit confused here. Does this mean my mid point should be around 1,4V that is not the case as am using VLDO to excite, my midpoint would be around 0.9V.

    Another question is if I should assume 8.25mv for Vmax_diff or should I pull it from my load cell spec sheet? If I use it from my load cell spec sheet then my Vmax_diff is 2mv which will further raise my CM range to 2.6 > CM > 0.6 should I consider this one?

    Please help. I would love to be clear about the design calculations.

    Regards,

    Shankar

     

  • Hi Shankar,

    Regarding inconsistent values, can you please provide following information.
    1) Do you Enable/Disable weight scale between measurements?
    2) How many data point do you consider for each measurement. Do you do averaging ?
    3) Do you do offset correction for each measurement?

    Your calculation of gain is correct. However for Vmax_diff = Vref/Gain = 1.7/401 = 4.23mV. "Vmax_diff" is the maximum voltage allowed for the given gain. In your case, its 4.23mV.
    Your CM range would be 1.349>CM>0.651 ( with Vmax_diff = 2mV ( from load cell's datasheet) and gain=401 , AVDD = 2)

    Regards,
    Prabin
  • Dear Prabin,

    My answers below

    1) Do you Enable/Disable weight scale between measurements? 

    Shankar: No I don't once I start, I keep it always in weight mode. My second stage gain is 1 I do not even change that.

    2) How many data point do you consider for each measurement. Do you do averaging ?

    Shankar: I consider an average of 100 samples


    3) Do you do offset correction for each measurement?

    No I am not performing an offset correction as of now.

    I understand that Aref is 1.7V.

    However, a big confusion to me when you say AVDD = 2V. Isn't AVDD supply voltage and is equal to 3.3V? The spec sheet says AVDD is 3.3V and that is what we are supplying. Is there any particular reason we need to consider 2v? 

    Regards,

    Shankar

  • Hello Prabin/Praveen,

    we are desperately waiting for some support. We have checked with different load cells, I tried excitation voltages from 1.7V (internal VLDO) up until 3V (External, 3V will ensure CM = 1.5 which agrees to your calculation above) and in all the cases, the measurements seem to be really inconsistent.

    One more thing we see is that the adc values does not vary linearly when we add/remove weight. It varies up to 2.5kg!!! that is something that is really bothering us. Attaching my register settings for your reference. Can you please help us? We are really stuck and time is ticking for our project.

    void resetAFE4300()
    {
    digitalWrite(PIN_RESET ,LOW);
    delay(100);//ms wait
    digitalWrite(PIN_RESET ,HIGH);
    }


    void initAFE4300()
    {
    writeRegister(MISC1_REGISTER,0x0000);
    writeRegister(MISC2_REGISTER,0xFFFF);
    writeRegister(MISC3_REGISTER,0x0030);
    writeRegister(DEVICE_CONTROL_2,0x0000); //Selecting Bridge 0 already
    writeRegister(DEVICE_CONTROL_1,0x6005); //Power up both signal chain
    writeRegister(IQ_MODE_ENABLE,0x0000); //Disable IQ mode
    writeRegister(ISW_MATRIX,0x0000); //Channels IOUTP1 and IOUTN0
    writeRegister(VSW_MATRIX,0x0000); //Channels VSENSEP1 and VSENSEN0
    writeRegister(ADC_CONTROL_REGISTER_2,0x0000); //ADC selects output of weigh scale
    writeRegister(DEVICE_CONTROL_1,0x6005); //Power up weigh scale signal chain
    writeRegister(WEIGHT_SCALE_CONTROL,0x0000); //Gain = 1 DAC Offset = 0
    writeRegister(ADC_CONTROL_REGISTER,0x4140); //Differential measurement mode, 128 SPS (Default)
    }
    Regards,
    Shnakar
  • Another big concern is that AFE4300 provides only 1.7V for excitation of load cell which is way too less compared to what the spec sheet of load cell says. We are using only 1.7V as against a rated minimum of 5V in the load cell spec sheet. I also note that using 5V will throw my CM voltage beyond calculated limit so we cannot use the 5V excitation as well. I have not come across any load cell that can be excited using less than 5V. Will this have any impact? How do we handle this?

    Can you please help us here? We are stuck trying to move from older platform for our product to this and our time is ticking. We really need some support here. Please help.

    Regards,

    Shankar

  • Hi Shankar,

    For the consistent result can you please do offset cancellation for each run. So basically, for each run do following steps:
    1) Measure the output without any load. This gives Offset.
    2) Measure with the load.
    3) Take the difference (i.e. step2-step1) for your calculations.

    Yes, AVDD is 3.3 V. If your system has 3.3v as AVDD, you have use 3.3 in the formula for CM.

    You can try exciting the Loadcell with external 5V, as long as your CM is within the rails of AFE4300. But the advantage of ratiometric measurement will be lost. Give it a try.

    Regards,
    Prabin
  • Hello Prabin,

    That experiment did not improve the results either. Following are changes I did

    1) instead of 1.7V for excitation, I used the 3.3V source of the micro controller which is pretty stable.

    2) I changed the second stage gain to 2 just was a bit curious about it

    3) I added the offset in every startup as you had mentioned and I printed subtracted ADC values (I have printed all 3 values for ref)

    Also I used a 5KG dead weight and tried obtaining offset for the same so that load cell can be more accurate.

    ADC_measured =21461.26

    offset = 12010.32                                 //5KG dead weight that is permanently left on load cell

    ADCVAL = 9450.94

    ADC_measured =21463.44

    offset = 12010.32

    ADCVAL = 9453.12

    ADC_measured =21463.46

    offset = 12010.32

    ADCVAL = 9453.14

    ADC_measured =21460.92

    offset = 12010.32

    ADCVAL = 9450.60

    //Next cycle

    Enter 0 --- For weighing something on Weigh scale

    Enter 1 --- For Body Impedance measurement

    Enter 2 --- To cancel a Tare weight

    Enter 3 --- To calibrate weight scale with known weight

    NOTE: FOR WEIGH SCALE, CHOOSE AFTER YOU PLACE THE OBJECT ON LOAD CELL

    Init Start

    Initializing weigh scale

    Init end

    Keep the scale empty for offset and press 0

    Keep the weight to measure and press 0

    ADC_measured =21170.70

    offset = 12076.14                       //5KG dead weight that is permanently left on load cell

    ADCVAL = 9094.56

    ADC_measured =21178.60

    offset = 12076.14

    ADCVAL = 9102.46

    ADC_measured =21180.74

    offset = 12076.14

    ADCVAL = 9104.60

    ADC_measured =21179.60

    offset = 12076.14

    ADCVAL = 9103.46

    You see that there is a huge difference in ADC values especially after a reset cycle. Upon micro reset, am also performing AFE reset on the RST(bar) pin.  I see that a simple instrumentation amplifier which is existing gives an accuracy up to 50g for 85KG! So the readings we see above a far from usable especially for weight.

    What other issues could be there? Can you think of any area where am doing it wrong? I even tried with 5V source but I got stray values so I settled with 3.3V values that seem to be slimier to 1.7V.  I have verified my register settings and they all seem to be fine. Clocking is fine since am getting a regular interrupt from adc.

    Where else can I look in to? how do we get the accuracy that is specified in the datasheet?

    Please find attached the specification sheet of the load cell we are trying to use. Please help us in the matter.

    www.adiartech.com/.../807-60410.pdf.

    regards,

    Shankar

  • Hi Shankar,

    Could you please clarify following things.
    1) In your earlier mail you have "writeRegister(DEVICE_CONTROL_1,0x6005);" twice, why?
    2) In your previous mail, what is the unit of "ADC_Measured", "offset" and "ADCVAL". Is that ADC code or V?

    Looking at the result of your previous test, there can be two possible cause either input is changing or gain is changing. So to locate the cause can you do following experiment.
    1) Set the gain with physical resistor instead of potentiometer.
    2) Short INP2 and INM2 to VCM. This is to measure offset without any input using 2nd bridge.
    3) Connect a loadcell to INP1 and INM1. Put a constant load on it.

    Your program should have sequence as described below.
    1) Reset the AFE4300
    2) Configure the AFE4300.
    3) Connect 2nd bridge to the weight scale and capture few samples. Average of those samples gives "Offset1".
    4) Connect 1st bridge to the weight scale and capture few samples. Average of those samples gives "Out1".
    5) Connect 2nd bridge to the weight scale and capture few samples. Average of those samples gives "Offset2".

    Repeat above test few times.

    Regards,
    Prabin
  • Thanks for the response.

    1) In your earlier mail you have "writeRegister(DEVICE_CONTROL_1,0x6005);" twice, why?
    Ans: One during general initialization and second during Weigh scale init. I have just tried removing the redundant code it still does the same. Anyways thanks for pointing that out.

    2) In your previous mail, what is the unit of "ADC_Measured", "offset" and "ADCVAL". Is that ADC code or V?
    Ans: Those were raw adc values

    Please note that in our design, we have used a fixed 499 ohm resistor as given in reference design so we do not have a pot. Our gain is fixed at 401.

    Unfortunately we have not routed the INP2 and INM2 on HW. I do not have any connectors for it. We have the routing for only one bridge. I can do VCM check on same bridge and update you with the results.

    regards,
    Shankar
  • Shankar,

    Step 3 to find root cause says "Connect a loadcell to INP1 and INM1. Put a constant load on it." But it should have been " Give external diferential input using voltage divides ".

    Regards,
    Prabin
  • Hello Prabin,

    I got some results that I do can't explain. I tried following two experiments

    1) I shorted INM1 and INP1 to VLDO (1.7V) according to the calculation 1.7V lies in the CM range so I expected a zero output but surprisingly I get a saturated output (close to 65150 or so)

    2) I rigged up  a potential divider of 1K and 1.3K and applied a common mode voltage of 0.96V to INM1 and INP1 and I still see a saturated output. Theoritically I should get a zero output from an inst amplifier for a common mode input.

    Another big surprise is I tried grounding the INP1 and INM1 so that I atlesat get a zero on adc for 0V inputs. I still get saturated values

    I don't understand what is happening here.

    I got a bit suspicious about my HW so to be sure, I checked the INP1 and INM1 voltage directly on the AFE pins. I find no issues, proper 0.96V appear on both pins wrt ground. I also checked my stage 2 gain register setting in my code and it is set to 1 (I also tried with stage 2 gain = 2 but same result)

    Do you see any obvious issue here? why am I unable to achieve a zero ADC output? and more than that why is it saturated? And again why does it not saturate with load cell? Am lost!

  • Hi Shankar,

    Yes, your findings are really different. We have not faced this issue in the past.
    Do you still get saturated output when both the inputs are directly shorted to external lower voltage ( e.g. 0.9V)?
    While doing so can you also probe the inputs and make sure they are indeed at same voltage.
    If you still get saturated output, you can try following things:
    1) See how does the device responds with gain changed.
    2) Try with some other device as well.

    Regards,
    Prabin