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.

INA220: The difference on calculating voltage, current and power with INA219

Part Number: INA220
Other Parts Discussed in Thread: INA219, ,

When using an INA219 common driver (in openbmc) to calculate voltage, current and power for INA220, is there any parameters need to be adjusted to calculate it correctly?

[Current 219's settings]
calibration = 4096
shunt_div=100
bus_voltage_shift=3
bus_voltage_lsb = 4000
power_lsb_factor = 20

[Environment]
6 fans unpleasent.  Each fan spec is, 12v 4.50A.

[Result]
Voltage=24890, shift 3 and multi 4000 = 12444000 uV (24890 >> 3 * 4000) -- this looks ok.
Current=65535, multiple 1000, divide by 1000 and then cast to signed = -1
Power=2 multiply 20000 = 40000

[Questions]
1. What difference on calculating voltage, current and power in between INA220 and INA219?
2. How to interpret 40000 of power?  According EE, the power should less than 10w for total 6 empty fan slot.
3. Does it mean it has inverse current as current=-1?

[Additional Notes]
In driver, it is calculate the value as following:
shunt_voltage = register value / 100
bus voltage = ( register value >> voltage_shift ) * bus_voltage_lsb  *ps: voltage_shift is 3 and bus_voltage_lsb is 4000
current = (register value * current_lsb_uA) / 1000      *ps: current_lsb = 1000
power = (register value * power_lsb_uW)   *ps: power_lsb_uW = power_lsb_factor * current_lsb_uA = 20 * 1000 = 20000, so register = 2, it shows 40000.

  • Hello Benson,

    Thank you for using the TI forum.  Here are my responses to your questions:

    1). The INA220 and INA219 have the same register map and equations, so your driver should be compatible.  

    2). It looks like your equations use µA for the Current_LSB. So if the power register had a value of 2, the power would be calculated as: 2*20*1000e-6 = 0.04W.  It looks like your driver outputs the results if µW, which is where the 40000 comes from.

    3). Similarly, your current would be calculated using µA as well, so since the register value was -1, that means you have a current of -1*1000e-6 = -0.001A.  It looks like your driver outputs the current in mA, which is why you get a -1 as the result. 

    Let me know if you have any more questions.

  • Thanks for the description.

  • Hi

    I'm the HW of this project

    I have a question about this issue.

    1). This current reading is for the current inside this IC or I output? Because the output current reading does not match the actual.

    Take a single fan as an example:

    At fan duty 0%

    actual output current :0.12A

    Reading:#1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 00 02

    is 0.002A?

    At fan duty 50%

    actual output current :0.4A

    Reading:#1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 00 08

    is 0.08A?

    At fan duty 100%

    actual output current :2.2A

    Reading:#1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 00 3b

    is 0.059A?

    Is it our conversion problem for him? or other questions?

  • Hello yeh Wade,

    The current reading is for the current across the shunt resistor. (So it will give you current for wherever you place the shunt).

    If you are using the same driver as above, then you are correct in that the current output would be in mA. It's important to note that the output current will only be correct when the calibration register is set properly. Looking at the values above, if you have all the same settings set, then it looks like your calibration register is set for a shunt resistor of 10mΩ with a max expected current of 32.768A. If this is not correct, then re-calculate your current lsb and cal register values accordingly and it should fix your problem. 

    If those values are correct, then send me a register dump for one of the above use cases (ideally fan duty of 100%, as that is most straight forward), and I can double check the device modes and values.  I would also need to know your maximum expected current, current lsb, and shunt resistor size.  It would also be good for you to re verify the current across the shunt resistor. 

    In either case, you can also look at the voltage over the shunt (both from the device and an external source for verification) and calculate the current with your shunt resistor value to double check the value is what you would expect.

    As a general note, for some more training and info on current sense amplifiers, see the training series: https://training.ti.com/ti-precision-labs-current-sense-amplifiers

  • Hi  Mitch

    We have used the INA220EVM tool to check

    setting

    Max bus voltage 16V

    Max Shunt voltage 0.04V

    R shunt 0.0005 ohm

    Max Possible Current 80A

    Max Expected Current 27A

    Min Current LSB 824u A/bit

    Max Current LSB 6.593m A/bit

    Enter LSB 1.3m A/bit

    Calibration Reg: Int 63015, Hex F627

    Max Shunt Voltage 0.02129855V

    Max Current 42.5971A  7FFE

    Power LSB 26m W/bit

    Max Power  681.554W

    Our BMC team set according to these, but the values ​​read out are far away or 0

    At present we are about to enter the mass production stage, so Rsunt is not able to adjust

    Are there any other settings we can adjust?

  • Hello yeh Wade,

    Can you give me a register dump for the fan at 100% duty cycle case with the above settings implemented? 

  • 1 FAN 100%, register 0-5 (5 times)

    - Loop 10 times for multiple register address to monitor their values
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 00 63
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 92
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 00 3d
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 00 5d
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = 10 00


    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 00 62
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 92
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 00 3d
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 00 64
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = 10 00

    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 00 61
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 92
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 00 3d
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 00 65
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = 10 00

    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 00 5d
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 9a
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 00 3d
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 00 63
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = 10 00

    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 00 65
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 92
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 00 3b
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 00 65
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = 10 00

    6 FAN 100%, register 0-5 (5 times)
    - Loop 10 times for multiple register address to monitor their values
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 02 4f
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 92
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 01 67
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 02 55
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = 10 00


    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 02 56
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 92
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 01 6a
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 02 56
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = 10 00

    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 02 4e
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 92
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 01 65
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 02 47
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = 10 00

    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 02 4c
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 7a
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 01 60
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 02 41
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = 10 00

    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 02 49
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 92
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 01 64
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 02 49
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = 10 00

  • Hello Benson/yeh,

    From the register settings, it looks like your calibration register is set to 0x1000, but from your settings above you wanted it to be 0xF627. This would be why your current value is not reading back properly.  You'll need to fix the calibration register, and if you are using that driver still then you'll also need to update the current LSB setting.

  • Thanks for the feedback.  Here's the output for configure = 0x1EEF, caliberation=0xf626.
    > 1 fan 100%, output:
    - Loop 5 times for multiple register address to monitor their values
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 00 67
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 7a
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 03 be
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 06 31
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = f6 26
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 00 66
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 7a
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 03 c8
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 06 31
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = f6 26
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 00 64
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 7a
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 03 c8
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 06 31
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = f6 26
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 00 67
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 7a
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 03 c8
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 06 12
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = f6 26
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 00 67
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 7a
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 03 be
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 06 31
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = f6 26


    > 6 fan 100%, output
    - Loop 5 times for multiple register address to monitor their values
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 02 49
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 7a
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 15 8e
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 23 37
    #1. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = f6 26
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 02 4a
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f b2
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 15 aa
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 23 56
    #2. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = f6 26
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 02 47
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 82
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 15 96
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 23 75
    #3. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = f6 26
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 02 4a
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 7a
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 15 a0
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 23 47
    #4. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = f6 26
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 1 = 02 4a
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 2 = 5f 9a
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 3 = 15 8d
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 4 = 23 47
    #5. ipmitool -I lanplus -H 10.6.148.65 -U root -P root i2c bus=3 0x84 2 5 = f6 26

    From above value, we can see the interpreted current and power value still floating.

    We will provide another register dump result by giving fixed current (1A-5A) via e-loader later today.  Thanks.

  • No settings:
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 29
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f 9a
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 00
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 00 00
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 00 00
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 2b
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f aa
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 00
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 00 00
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 00 00
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 29
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f 9a
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 00
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 00 00
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 00 00

    [1 Ampare with settings]
    root@c600g5:~# i2cset -f -y 3 0x42 0 0x1eef w
    root@c600g5:~# i2cset -f -y 3 0x42 5 0xf626 w
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f == register 0 still shows 399F
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 2b
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f a2
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 40
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 00 64
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 29
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f a2
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 40
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 00 66
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 2b
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f a2
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 40
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 00 64
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6

    [2 Ampare with settings]
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 51
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f 9a
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 79
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 00 c5
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 52
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f a2
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 79
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 00 cd
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 52
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f a2
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 79
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 00 cd
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6

    [3 Ampare with settings]
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 7a
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f a2
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 b6
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 01 2c
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 7c
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f a2
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 b6
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 01 2e
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 7b
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f 9a
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 b9
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 01 27
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6

    [4 Ampare with settings]
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 a2
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f a2
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 f2
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 01 8f
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 a2
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f a2
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 f4
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 01 8a
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 a4
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f 9a
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 00 f6
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 01 8d

    [5 Ampare with settings]
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 cd
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f 9a
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 01 31
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 01 f1
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 cc
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f 92
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 01 2d
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 01 f1
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 39 9f
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 ce
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f a2
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 01 31
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 01 f1
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = 26 f6

    [1 Ampare with reverse settings]
    root@c600g5:~# i2cset -f -y 3 0x42 0 0xef1e w
    root@c600g5:~# i2cset -f -y 3 0x42 5 0x26f6 w
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 2a
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f 7a
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 01 81
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 02 77
    #1. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = f6 26
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 2a
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f 82
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 01 8b
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 02 77
    #2. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = f6 26
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 0 = 1e ef
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 1 = 00 2a
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 2 = 5f 82
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 3 = 01 81
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 4 = 02 77
    #3. ipmitool -I lanplus -H 10.6.139.147 -U root -P root i2c bus=3 0x84 2 5 = f6 26

  • Hello Benson,

    From these values, the current register result looks to be working as expected.

    From your first set of examples:

    1 fan at 100%:

    current register = 0x631 = 1585 decimal.  To convert to current: 0.0013*1585=2.0605A

    From the shunt result we would expect the current to be: current register 0x67 = 103 decimal. convert to expected current: (103*10e-6)/0.0005=2.06A

    As you can see, the current result register is what was expected for the shunt measurement. 

    6 fans at 100%:

    This example works out similar to the one above, only the current from the current register comes out to 11.7195A, and the expected current from the vsense register is 11.7A

    From your second set of examples:

    For these examples, the calibration register was programmed to 0x26f6 instead of 0xf626, which gives a current LSB of 0.00821335 instead of 0.0013.

    for the 1A case:

    current register = 0x64 = 100 decimal.  To convert to current: 0.00821335*100=0.821335A

    From the shunt result we would expect the current to be: current register 0x2B = 103 decimal. convert to expected current: (43*10e-6)/0.0005=0.86A

    As you can see, the current result register here is also what was expected for the shunt measurement. 

    In general:

    There is a possibility that there is an issue with your setup code or communication stability, since register 0 didn't program properly and the config register was given the wrong value.

    Since the INA220 is reading 0.8A when you expected 1A, there is a possibility that you actually have 0.8A instead, or that the shunt tolerance is causing errors.  It's also possible that there are errors due to layout. Please see the following training video for info on layout: https://training.ti.com/ti-precision-labs-current-sense-amplifiers-shunt-resistor-layout