Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

INA226: wrong current measurements with a 12V, 20W halogen lamp as load

Part Number: INA226
Other Parts Discussed in Thread: TPS54331,

I have a buck converter (TPS54331) and manipulate the feedback with a comparator (opv compares a (low-side) shunt with a DAC voltage) in order to control the current.

I have included the INA226 (high side shunt) in order to check the controlling and to know the work point of my load. I do also adjust the DAC coltage when running out of current limits.

As load I am using a halogen lamp (20W, 12 V, 1.67 A). When using the lamp, the INA226 shows wrong current values (~25-30%). A lab power supply shows, that the working point of the lamp is correct. When I replace the lamp with a power resistor, the INA226 actually shows correct numbers.

I am using the INA226 without a filter, but added a capacitor over the shunt later. Unfortunately I do not see any improvement. I am wondering what is going on. My currently running configuration:

Shunt = 25 mOhm

CALIBRATION = 2048

expected CURRENT = 16700 @ ca. 1.67A

read CURRENT = 23820

read VBUS = 10080 => ~12.6 V (125 mOhm shunts included)

I tried a lot and fixed some issues with the configuration, but I am at a point where I do not have any good idea any more. The lamp is a PTC and might show up a high current when starting the buck converter ... although it has a delayed starting ramp. Could this influence the INA226 conversions?

Any help would be hellpful. Thank you.

  • Hi Marius,

    a lamp is a thermistor (NTC) and can make the control loop oscillate. Can you post some scope plots?

    And a schematic would be helpful :-)

    Kai

  • Hi Kai,

    thanks for your feedback. I did not do any scope measurements, because the feedback seems to be quite stable (least for a few hours of operation). Please find excerpts from the schematics below. The parts are distributed over 2 pcbs and I made a kicad project each. Actually, there are two more boards to extend the platform. These do just extract the microcontroller ATMEGA328PB (not shown here) free pins and interfaces.

    I am going to add some resistors in the prototype to improve stability. However, it should not affect the current measurements with the INA226. I am going to make some additional measurements soon and to post them asap.

    Best regards,

    Marius

  • Hey Marius,

    Thanks for posting your question to the forum.

    Is this 30% error at steady state operation? If yes, then the startup of the lamp should not affect the measurements during steady state.

    You also show in the schematic a 50mΩ shunt, yet mention a 25mΩ. Could you please confirm the correct shunt value for INA226?

    What are you setting the average and conversion time of the ADC to?

    Is the 30% error constant or is it a part of a fluctuating current reading of the INA226? Maybe the current has a low frequency component?

    Here would be my steps to debug this:

    1. Read back the CALIBRATION register to make sure you are writing to it correctly.
    2. Confirm the halogen current is actually 1.67A DC with another method. Power supplies current readings can be very inaccurate and will mostly average out any potential oscillation or AC component in the load. There could be an oscillation simply due to your comparator feedback method. So probing the voltage and current of the halogen load is critical.
      1. You won't need much accuracy, so you could measure voltage across the 100mΩ shunt directly with a probe or measure voltage across lamp.
    3. With the lamp running at steady state, read the shunt voltage values from INA226, instead of the current values. Calculate what current is based upon Vshunt and shunt resistance. If these values are correct, then the calibration register is not correct or the read of the current register is not correct, which seems unlikely.
      1. Try capturing many measurements over time to see if there is some oscillation.
    4. Adjust the ADC to the longest conversion time with the maximum number of averages? If this helps, then there could be some AC component/noise in the current signal.
      1. You can also increase Vshunt acquisition throughput by setting the ADC to Vshunt continuous mode (no VBUS measurement).
    5. Measure the 12V rail with probe. Is there noise or large voltage transients? This could stain the CMR of device and add CMR error. If this is the case, try adding caps from IN+ and IN- to ground.
    6. Make sure the system has good grounding.

    I hope this helps.

    Best,

    Peter

  • Thank you all for your response.

    Sorry for my delayed response, I needed to fix some bugs to read out all parameters of the INA226 to output them on the serial.

    I also did some additional measurements.I figured out, that resistors show as wrong values as the Halogene lamp does. Here is what is in the INA226 with a 5 Ohm resistor as load:

    INA226.Configuration Register 0x00: 0b100010111111111
    >> Reset: no
    >> Averaging: 16
    >> Bus CTime: 8244 us
    >> Shunt CTime: 8244 us
    >> Operation Mode: Shunt and bus continuous
    INA226.Shunt Voltage Register 0x01: 0x4E13
    INA226.Bus Voltage Register 0x02: 0x1CEA
    INA226.Power Register 0x03: 0x24FB
    INA226.Current Register 0x04: 0x63EB
    INA226.Calibration Register 0x05: 0xA3D
    INA226.Mask/Enable Register 0x06: 0b10000000000
    >> Conversion Ready Flag to Alert pin
    INA226.Alert Limit Register 0x07: 0xFFFF
    INA226.Manufacturer ID Register 0xFE: 0x5449
    INA226.Device Register 0xFF: 0x2260

    For current calculation, I am using 0,078125 mA/bit ( = (CURRENT_REG * 5) >> 6) It displays 2 A. My multimeter shows a current of 1,67 A. 

    Here are some data data from Friday: (The INA measures the voltage over the load and both shunts)

    5 Ohm >> INA226: 6.822V & 1.501A

    5 Ohm >> Multimeter:  6.56V & 1.27A

    20W lamp >> INA226: 11.712V & 1.98A

    20W lamp >> Multimeter: 11.42V & 1.67A

    Peter, thank you for your check list. Here is what I came up:

    1. confirmed, CALIBRATION is as expected

    2. confirmed with multimeter (INA226 shows 12V, multimeter 1,67A) and a lab power supply.

    1. I have access to measure the voltage and current over the load, reconnecting the VBUS is not that easy.

    3. seems for me, that VSHuNT and CURRENT are consistent

    1. I ran over many hours and it seems to be more or less stable. Although, I believe I have some issues with the comparator, there are missing some resistance after the Ref-voltage and the Dac_out. However, it should not affect the INA readings

    4. Measurement time is already 8.2 ms and 16 samples averaged. 256 samples do not change the result.

    5. For 24V powering of the buck converter, I used the lab power supply and tested it with two different power supplies (30W and 50W). Always the same. The 12V from the buck converter is oscillating a bit as expected since I want to stabilize the current. Any suggestions for the caps' dimensions?

    6. It is a 4 layer layout and all have a ground plane without any other routings. The INA (and all other components) is connected in such a way, that I get VCC/GND from innner layers, routing the connection to the capacitors (100n ceramic, 4u7 Tantal) and end up at the ICs supply pins. 

    Here is a picture of a measurement (INA read-out) before I found the issue with data. I used another configuration, but you get an idea of. 

    .. The oscillations at the begiinning happened due to touching the electronics (checked the heating), and these at the end might be due to missing resistors as mentioned earlier ...

    The shunt resistor is 25 mOhm now. During design, 50 mOhm seemed to be reasonable, but trial and error let me add 50 mOhm in parallel. I just hope, I did not mix the shunts (50 and 100 mOhm) up during reflow. This would give additional 33 % current (100 || 50 as shunt for the INA). But the dac behaves as expected, so I believe, I did not mix them up...

    I am running out of ideas ...

  • Hey Marius,

    What is the source voltage for your first test with the 5-Ohm load? I am seeing a couple scenarios here:

    1. Either the ammeter is inaccurate. It reads 1.67A, when the load is really 1.82A.
    2. Or, the load really is 1.67A and the effective shunt resistance is actually 100mOhm||50mOhm = 33.33 Ohm as you suggested is possible at the bottom of your last reply.

    For scenario 1, all of the measurements make sense for a ~10V bus and 5-Ohm load. The INA226 is reporting 50mV shunt and 9.2525V bus. This means the bus voltage is 9.325 V. Is this what it is supposed to be? Could the 12-V buck be put into CC mode and pulled below its nominal voltage because current is too high? Anyway, this means the load should be 9.325V/(5Ohm + 125mOhm) = 1.819A. The device is reporting 1.998A.

    For scenario 2, if you accidentally made the INA226 shunt = 100||50, then 50mV/33.33mOhm would imply the real load is 1.5A. This would be closer to the 1.67A measurement from the multimeter.

    I would double check the shunt resistance and the accuracy of the multimeter.

    Sincerely,

    Peter

  • Hi Peter,

    thanks for coming back to me. Well, I checked the current and the voltage drop over the 100 mOhm shunt. These are consistent: 1.7 A (adjusted) and drop of 0,172 V. I derive from these values:

    1. shunt is a 100 mOhm and the other needs to be 50||50 mOhm, I double checked the bags with remaining resistors.

    2. the ampmeter is accurate enough ... least not 30% off

    Here an excerpt of my last message:

    5 Ohm >> INA226: 6.822V & 1.501A

    5 Ohm >> Multimeter:  6.56V & 1.27A

    The VBUS of the INA measurement is slightly higher, but measures - in contrast to the measurement with multimeter - load + shunts. At the end, the values are close enough (for me). The values from the multimeter let me calculate a load of 5.16 Ohm, what is close to the measured resistance outside the circuit.

    Why didn't I measure the voltage drop over the INA shunt sooner? I believed, it is not accurate. But actually it is ... I measure 50 mV, giving me 2 A at 25 mOhm, but actually I see less current with the in-series ampmeter. Do you have an idea, what can cause this? bad soldering of the shunt?

    Thank you for your time investigating into my issue. At the end of the day I "just" need to find the additional in-series resistance.

    Cheers,

    Marius

  • It was the shunt. Thank you all for your support and help.