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.

INA181: Calculation of Iload

Part Number: INA181
Other Parts Discussed in Thread: INA250, INA185, INA190, INA191, INA186, INA226, INA236, AMC1302, AMC1300, OPA320, INA240

Dear Sir,

We are testing the EVM board of INA181A2. We have connected 5 milliohms /4w (1%) shunt resistor and try to check 1 to 10 amps AC. The reference pin of INA181A2 is ground (output response of a unidirectional configuration).Now by mcu we got the value of Vout (in Vrms) .we have use the formula to calculate I load   Iload = (Vout - Vref) / (Rsense * Gain)

 
But the problem is as actual Load current (I load) increases  the error in Iload after calculation also increases .( example : actual I load is 1Amp it shows 1.5 Amp .  If actual Iload is 3 Amp it show 4.5 Amp and so on)
We think that we are not taking the error part in our calculation. Is this a problem ? If yes then How can we take errors parts in our calculation?
 
Second thing is to inform you that our Iload is from 1 Amp to 10 Amp AC. And we have grounded the Reference pin (output response of a unidirectional configuration). So we got half wave on output and that we have connected to the ADC pin of our MCU . From that we derived Vrms  and used the above Iload formula. If anything is wrong in this please also advise .
 
 
 
Best Regards,
Minesh Vyas,
JMV ELECTRONICS,INDIA
  • Hi Minesh,

    why are you running the INA181 in unidirectional mode when your measuring current is AC? This will not work because the output of INA181 cannot go all the way down to 0V at the output, as any other amplifier suppled by a singe supply:

    More, the output is distorted from going into saturation.

    Why not applying a suited bias voltage to the REF pin of INA181 and by this creating a proper pseudo ground?

    The result: No saturation, no distortion.

    minesh_ina181.TSC

    Also, the error you oberved looks like a gain error resulting from using an improper shunt. It's highly recommended to use such a four terminal shunt:

    Otherwise the unavoidable solder joint resistance appearing in series to the shunt resistance could dramatically increase the effective shunt resistance. With the shown four terminal shunt, sensing the voltage drop across the shunt at the two tiny terminals an error due to solder joint resistances is impossible.

    Kai

  • Hi, Kai,

    First of all many many thanks for your valuable support. This is the first time we are monitoring current  in our product so no experience in this so please correct us where ever needed.
    In your response you have mainly informed about two points:
    1) Unidirectional mode of INA181:
         We tried bidirectional mode by connecting 2.5 V (Vs/2) to REF pin and monitoring Vrms of only positive cycle (above 2.5 V). If we monitor Vrms of positive
          (above 2.5V ) and negative (below 2.5 V) cycle then the result is zero. So we monitor Vrms of only positive cycles.
        Now ADC reference + is 4.096V so in bidirectional mode we got only 1.5V (Vp) in positive cycle (from 2.5V to 4V for 0 to 10 Amp). Whereas in     
        Unidirectional we get 4V (Vp) in positive cycle (from 0V to 4V for 0 to 10 Amp) so to get good resolution we use unidirectional mode. The result and error is 
        the same in both modes. Please give your advice on this point and correct us.
    2) Using improper shunt
       Yes, we are not using 4 terminal shunt. We will arrange 4 terminal shunt but in the meantime, can we use EVM INA250A2 ? Because this EVM has inbuilt 2 milliohms shunt. We have EVM INA250A2 in stock. Please advice.
    Thanks & Regards,
    Minesh Vyas,
    JMV ELECTRONICS,INDIA. 
  • Hello Minesh,

    I am looking this over and will respond shortly.

    Sincerely,

    Peter

  • Hey Minesh,

    First, everything Kai said in the previous post is correct, especially the distortion error you'll get in an Arms measurement when slamming the INA181 OUT pin into GND. This becomes especially bad if the frequency is too high and the device does not even reach the correct Vout peak. 

    Second, you can use INA250A2; however, you still have to solve the output saturation/dynamic range trade-off you mention.

    Third, please make sure that the input common-mode voltage at device input pins remains within the device ratings, which is -0.3V < Vcm < 26V. You can measure AC current with INA181, but not if voltage is also AC and going below -0.3V.  If the Vcm is AC, then you will need a different approach to measuring AC current.

    Measuring average/RMS current is not easy. Here are some options:

    1. Measure the bi-directional current with bi-directional CSA.

    1. Measure AC current with bi-directional CSA (e.g., INA181, INA185, INA250) with V_REF = Vs/2 =mid-supply .
      1. Perform RMS calculation with MCU post-processing.
      2. Accuracy is limited by low load level. Error at low loads is dominated by device input offset voltage.
    2. Same as 1, but use rectifying diodes to only measure positive current. 
      1. This allows you to double dynamic range because you can set REF=GND.
      2. Downside here is that you may not have space or it might not be compatible with system.
      3. It is not advisable to use a rectifying diode at OUT pin (as opposed to the input) because if OUT is a voltage signal, then you will get error from the variable diode Vf.
        1. If the amplifier is an output-current signal amp, then the Vf problem is solved; however, you will still be saturating the amplifier output, which will cause distortion.
    3. Put a differential input RCR filter at the input of a high-input impedance, bidirectional amplifier (e.g., INA190/INA186/INA191 or an instrumentation amplifier)
      1. This can help with the dynamic range problem.
      2. The input RCR filter needs to have low component tolerances to keep the attenuation factor stable over many systems.
      3. The INA190/186/191 are the only viable current-sense amplifiers that can be used here because they are high-input impedance (>2MΩ). The INA181 has Zin =~2.5kΩ and thus an input filter will cause significant gain change and gain error.
      4. Here is the circuit schematic, but REF would be set to Vs/2.
    4. Use a digital CSA (e.g., INA236, INA226) to digitize the data and then perform RMS calculation with MCU post-processing.
      1. These device can measure average current; however, this is not RMS and like you said, if you average a signal that has DC offset of 0-V, then you get 0V average. So if you wanted to use the averaging feature of the device, then you would need to rectify the signal as I suggested in option 2.
    5. Use a discrete solutions as shown in this document:
      1. https://www.ti.com/lit/an/slyt545/slyt545.pdf?ts=1652144262317&ref_url=https%253A%252F%252Fwww.google.com%252F
    6. Use a true RMS current transducer available in the marketplace. 

    Hope this all makes sense. 

    Sincerely,

    Peter

  • Hi Minesh,

    can you show a schematic?

    Kai

  • Hi Peter,
     Thank you very much for the valuable information provided on my technical query.
    From your reply, what i understood is 
    1) Yes, i am trying to measure 0 to 10 Amp AC (and voltage is also 230 VAC). So first of all, as you said correctly, i have to change my approach. Attached is a small schematic . Please suggest a way to correct this.
               
    2) As you mentioned, different options for measuring RMS. i am not sure which option is ok because i think first i have to select the approach (as per above point). But i can go with the 1st option as i am doing RMS calculation with MCU and in my application it is ok if accuracy is limited by low load level. 
    3) After completing the above two points i will work on shunt.
    Thanks & Regards,
    Minesh Vyas,
    JMV ELECTRONICS,INDIA
  • Hi Minesh,

    you could move the shunt to the neutral of mains voltage and connect signal ground of INA181 also to neutral of mains voltage. By this you would perform a low side current measurement and the common mode input voltage would be heavily decreased:

    Of course, you still must check whether any noise at the shunt can exceed the allowed common mode input voltage range. The input voltage of INA181 must never go more than 0.3V below the ground pin's voltage of INA181, even not briefly. Eventually, you must choose an INA which can tolerate more negative going input voltages.

    Also, you eventually might need protection isolation, if you can touch your circuit and the neutral of mains voltage is not connected to protection earth.

    Kai

  • Hi Kai,

    Thanks for your reply, I will modify my schematic as per your suggestion and get back to you soon with the result . i will also care for proper isolation.
     
    In the meantime,please clear the following points:
    1) If i calculate the RMS value of only the positive wave ( above 2.5 V ) and then calculate I load .   Is this correct ?
    2) i have connected RC ( 1K ohm and .1uf ) between Vout and the ADC pin of mcu. Shall I keep connected ?
    3) You have connected 10K between Vout and GND . Shall i add this ?
    Thanks & Regards,
    Minesh Vyas,
    JMV ELECTRONICS,INDIA.
  • Hey Minesh,

    1) You can calculate the RMS current with only using the positive waves, but you have to assume that the load is either a pure AC wave or single rectified wave, both situations will have different RMS values. You might as well calculate RMS value based off one complete period or multiples of the load period. This would require setting REF to Vs/2.

    2) The RC between INA181 and ADC is usually referred to as the charge-bucket filter and is there to stabilize the amplifier's output being loaded down by the dynamic switching from the ADC. In order to determine the optimal value, you need to know the BW requirements for the MCU. These required BW can vary depending upon the ADCs bit number, sampling rate, conversion time and acquisition times. Check the MCU for recommended RC. 

    3) It is not necessary to connect a 10k load at OUT pin. Load resistors can help with the amplifier's ability to swing low to its ground rail, but it does not seem necessary in this application. 

    In regards to moving the shunt and amplifier to the neutral side, I would proceed with caution. Neutral may not be grounded, or there could be a reverse polarity connection, so these are system possibilities to consider. Another consideration to note, is that when you sense on the low-side, you may not detect any fault current from HOT to Earth ground that could occur with the operation of you system.

    You could consider one of our isolation products, which you can browse with the link below. This included isolated current sense amplifiers (e.g., AMC1300, AMC1302), isolated ADCs, and isolated digital transmitter/receivers. All of these products allow you to isolated the high-voltage mains with you ground referenced system/MCU. If you were to use the AMC1302 for example, however, you would need a floating DC supply that moves with the AC mains. This can be accomplished with a AC-DC, shunt regulator supply. You can do this by connecting HOT and NETURAL to a full-bridge rectifier, smoothing resistor and capacitors, and then a 5V Zener regulator that drops the smoothed, rectified DC voltage to the 5V supply

    https://www.ti.com/isolation/overview.html

    Sincerely,

    Peter

  • Hi Peter,
    Thanks for your continued support.
    From your last reply I understand points 1 to 3 for RMS calculation,RC selection and 10K load resistor.
    But after reading your last two paragraph  i can't decide how to go ahead . Shall i go as Kai suggested schematic or select a new CSA (like AMC1302) ?  
    My requirement is only to measure 0 to 10 Amps AC ( and 230 V AC ). In my product i am using only one isolated 5v dc supply to the MCU & CSA circuit ( by step down transformer).  
     Can you please put me in one direction so i can work on your suggested CSA and schematic to get above goal. Can it be possible with INA181Ax ? 
    i am sorry, i bother you and Kai but i want to understand that can i make it possible my requirement by ti csa ? 
    Thanks & Best Regards,
    Minesh Vyas,
    JMV ELECTRONICS,
     
  • Hi Minesh,

    as we don't know your application in detail, there's no simple answer. The important question is: Is it dangerous to touch the neutral of mains? If it is dangerous then you must have some safety isolation. But this must not necessarily sit at the shunt. There are three scenarios:

    1. Neutral is a dangerous potential and you take an isolation amplifier directly at the shunt.

    2. Neutral is a dangerous potential, but you still take the INA181 at the shunt and do the safety isolation later in the signal chain by the help of digital isolators, .e.g.

    3. Neutral is no dangerous potential, because it is safely connected to protection earth. In this case the INA181 can stay connected to the shunt and having additional safety isolation later in the signal chain is of less importance (but still highly recommended!)

    If you are unsure how to proceed and if you are new in these things, I would go for point 1 and use an isolation amplifier directly at the shunt.

    Of course, if you don't want to connect the shunt to neutral of mains but to 230VAC, I would definitely go for an isolation amplifier directly at the shunt.

    Kai

  • Hi kai,

    Thanks for your reply and yes,you are right this doesn't have a simple answer.
    Let's take this work as we want to measure 0 to 10 Amp AC (@230 VAC) by INA181. So we can check functionality and suitability of INA181 for measuring 0 to 10 Amps AC.
    We first concentrate by using INA 181, Shunt and MCU to make complete test board for measure 0 to10 Amp AC(@230VAC). Isolation part we will take care of. Once we can successfully use INA181 for measuring 0 to 10 amp ac then we will see how to implement it in our product. ( As suggested in option 2).
    In our products we are using different supplies like live supply,cold supply and live & cold supply. So we will take care of the isolation part. Secondly there is no output/input ( for customer use) in our product.
    Now , Is it OK if we proceed as follows ?
     We will use schematic suggested in your second last reply to connect NEUTRAL with GND .And we will make required corrections, if needed in Shunt and RMS calculation and see how we get the correct I load.
    Thanks & Regards,
    MInesh Vyas,
    JMV ELECTRONICS,INDIA.
  • Hi Minesh,

    yes you can proceed this way, from my point-of-view. The 1k 100nF charge bucket filter seems to be a good choice, assumed you don't want to take sample more often than 1000 times per second. What ADC do you want to use?

    Kai

  • Hi,Kai,

    Ok, we are proceeding to work accordingly and before that like to inform following points if anything needs to be correct please inform.
    1) We are using PIC16F15344 (mcu) which has 10 bit ADC . The  Vref + is 4.098 V( this is fixed voltage reference ) of ADC and Vref - is at GND.
    2) To calculate RMS we take the sample at every  500 microsecond for only the positive cycle. So we check the RMS of every positive cycle.
         Doing the same for 50 positive cycles and taking the average of those 50 RMS values. That is our final RMS for calculating  the I Ioad.
    3) The INA181 ref pin connected at 2.5V (Vs/2) and our line frequency is 50HZ. So if we take the RMS of a complete one cycle (positive and negative wave )
         then it will come to zero so that we are calculating only positive cycle RMS.
    Thanks & Best Regards,
    Minesh Vyas,
    JMV ELECTRONICS,INDIA
  • Hi Minesh,

    your 1k 100nF charge bucket filter is in 500µs only charged up to 99.3%. Is this a problem in your application?

    Referring to the RMS calculation, I would first substract from each ADC reading the 2.5V Vref and then calculate the RMS by taking into account the positive and negative values. 

    Kai

  • Hi, Kai,

    Ok,
    1)  I will take a sample at every 1 millisecond and use 1K and 100nF(as a charge 
         bucket filter).
    2) Yes, I do the subtraction of  2.5V Vref from ADC.
    3) Now the last point is , I can also take in account the positive and negative waves .
    But when we calculate the  RMS of full wave (  positive and negative ) the value will come zero or near zero so I load will also be zero then How can we calculate I load ? 
    Thanks & Best Regards,
    MInesh Vyas,
    JMV ELECTRONICS,INDIA
  • Hi Minesh,

    no, this will not become zero because calculating the RMS means to take the average of squared values.

    I recommend taking into account both half waves because it might be complicated to distinguish between the both half waves, if harmonics are superimposed. Then you can have a negative going voltage in the positive half wave and vice versa. Also, the positive and negative half waves don't need to be fully symmetrical.

    Kai

  • Hey Minesh,

    So you are using a step-down transformer to generate an isolated, floating 5V supply for the MCU and CSA, correct? This seems to be how you were able to get current measurements on the 230VAC line voltage in your first post without blowing up the device. If this is the case, then it seems like you can proceed with measuring the line current on the high-side (HOT) with INA181. You can also measure return current on the Neutral; however, the downside to measuring low-side current is that you cannot detect HOT-ground fault current, but this may not even be a requirement for you.

    Overall, no matter what technique you choose, I highly advise to always measure the input common-mode voltage of the INA181 (V_IN+ and V_IN- with respect to INA181 GND pin) with a high-voltage differential probe. This way you can confirm that the INA181 GND is moving with the line voltage and that VCM remains within the operation Vcm limits of 0V to 26V.

    Once the isolation and protection is understood, determining how to convert the output into RMS current should be straightforward. The best practice for getting good AC data is to ensure that INA181 output remains within the linear operating region (~100mV to 4.9V max). If VOUT is going beyond this, then device output stage will become saturated causing saturation delays and measurement error/distortion. This is true for any amplifier. The best way to ensure this is to make sure OUT is biased to mid-supply (Vs/2) since the positive and negative peaks are mostly vertically symmetrical. For this reason, consider setting the ADC REF+ to VDD and ADC REF- to GND. To calculate necessary gain use the following:

    Vshunt_peak = (4.9V-2.5V)/Gain

    Rsh_max = Vshunt_peak/Imax_peak

    Use these equations along with max Rsh power dissipation allowed to determine optimal Gain and Rshunt values.

    As Kai mentioned, determining RMS means you square the measurements first, so negative measurements will always become positive and thus the end RMS calculation will always be > 0. This is the point of RMS.

    As for the charge bucket filter, refer to the BW requirements for the MCU ADC in the datasheet. The required BW will depend upon the conversion and acquisition time chosen. You can also use this app note for more information on determining optimal charge buck filter. The INA181 spice model has closed-loop bandwidth and output impedance modeled so you can use this along with a discrete model of the MCU ADC in TINA to complete then analysis.

    https://www.ti.com/lit/an/sboa443/sboa443.pdf

    My recommendation is to first begin the design analysis with a high-BW, accurate op am buffer (such as OPA320 for example) in between INA181 and ADC. Note that buffers still require a basic RC charge bucket filter. Once you have established the measurement accuracy and MCU code, then remove the buffer and drive MCU directly with INA181 and calculated RC charge bucket filter to ensure that you have similar accuracy and performance before and after removing the buffer.

    Sincerely,

    Peter

  • Hi, Kai,
    Ok, I got your point . I will take positive and negative waves in account and find RMS of full wave for I load calculation.
    Now I proceed with the experiment again and get back to you with the result .
    Thanks & best regards,
    Minesh Vyas,
    JMV ELECTRONICS,
  • Hi,Peter

    Thank you very much for your reply and Yes, we are using a step down transformer for making isolation. Now we are again proceeding with an experiment for measuring current with INA181. We will very much take care of your described points and come back with results soon.
    Thanks & Best Regards,
    Minesh Vyas,
    JMV ELECTRONICS,INDIA.
  • Good luck :-)

  • Hey Minesh,

    No problem. Please post pack on the forum with any more questions and/or updates.

    Sincerely,

    Peter

  • Hi  Kai / Peter

    I am very happy to inform you that with your co-operation and support. Now I can measure the current from 100ma to 10 Amp Ac ( 230V ac) with INA 181. The main changes i done 
    1) Use INA 181 in bidirectional mode  By connecting the REF pin to 2.5v (Vs/2).
    2) For calculating RMS value I have taken into account both positive and negative waves.
    3) The charge-bucket filter uses 1k and 100nF and takes an ADC sample at every 1ms .
    4) I have connected a shunt of 5ml ohms 1% 4W  ( still I will improve the shunt ).
     
    One last query is in following both the case i got the same and correct reading so out of that which one is advisable.
      a) As per my schematic given in my earlier email .( no pin IN+ or IN- is connect to GND.)
      b) As per Mr.Kai schematic .( Neutral is connected to GND.)
     
    Once again many many thanks to both of you.
     
    Best Regards,
    Minesh Vyas,
    JMV ELECTRONICS,INDIA.
  • Hey Minesh,

    Great to read. For you last query, this should come down to system-level requirements. If you want to detect HOT-Earth ground fault events, then you should place INA181 on the high side. However, you may not care about detecting fault currents (this is the job of GFCI circuits anyway to detect faults >5mArms typical). Thus, there could be a rare scenario where there is some fault leakage, but it is not enough to trip GFCI. Thus, it would superimpose onto the load you are measuring. This could add ~3% error if fault = 3mArms and load = 100mArms. This does not even include harmonic leakage transients due to noisy motor drives in certain machines like a washing machine. If there is a chance that there could be a reverse polarity scenario, then you may have to consider these things anyway.

    You could place INA181 on neutral side and potentially not even need the step-down isolation transformer because neutral is same potential as Earth ground; however, if there is any chance that there could be a reverse polarity connection where user flips the electrical wiring or the electrical connection to load, then INA181 would be exposed to 230VAC with no protection/isolation and blow up.

    Overall, due to the possibility of leakage noise on HOT side, I would highly recommend some an input filter to the INA181 as shown below. Keep input resistors < 10-Ohm or else there will be significant gain attenuation. Choose a capacitor that sets a cutoff frequency (fc) above the ADC sampling rate and/or above any step response requirement you may need so there is no unnecessary reduction in system speed. See the link for more explanation on why input resistors nee to be <10-Ohm for most current-sense amplifiers.

    If you end up needing more accuracy, consider the INA185, INA186, INA190, INA240, INA241, INA296. The INA185 is functionally the same as INA181, but has more accurate specs and comes in smaller package. The INA186/INA190 (low power) are nice because you can use input filters with input resistors up to 1kOhm with little change to gain, which allows you to use lower capacitance/tighter tolerance CF. The INA240/INA241/INA296 are beneficial because they can generate accurate (0.1%) VREF=Vs/2 internally with no extra circuitry needed. They also have higher AC CMRR and higher BW and thus you could easily increase ADC sample rate/bit number, although you don't need a very high sample rate given you are sensing a 50-Hz signal

    I hope this helps.

    Best,

    Peter

  • Hi, Peter,
     
    Thank you very much for your valuable information. Ok, we will finalize our schematic as per our application needs. Also take a try for an input filter to the INA 181 and check the result. We will also study the CSA you suggested and see if we can work on another one for our products.
     
    Presently we are closing  this query and in future if required we will again approach you by E2E  post.
    We highly appreciate your and Mr.Kai support and co-operation.  Thanks a lot.
     
    Best Regards,
     
    Minesh Vyas,
    JMV ELECTRONICS,INDIA.
  • Good luck Relaxed

  • Of course Minesh anytime. 

    Please post back with any other questions/updates you have.

    Best,

    Peter