This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OpenPlotter I2C 3.x.x - INA219 settings
#11
Done. The default mode is still set_calibration_32V_2A because set_calibration_16V_5A assumes a shunt resistor of 0.02 ohm and most modules have a 0.1 ohm resistor.

   

I do not have a INA219 so this has been blind development. It is not tested, just no coding errors. Test and report please, thanks.
Reply
#12
The new settings are visible when adding the sensor. Default Settings seem to work. Settings are not visibe when editing the sensor.  Changing from RANGE_32V to RANGE_16V while adding the sensor works - at least i still get sensible readings and no debugging output.  

Changing the other values also does something - but i still need to figure out how to convert the values from the html-tool. 

how do i calculate the values for current_lsb  and power_lsb from this:

[Image: ina.png]


Best regards
Tobias
Reply
#13
These are the allowed values:

current_lsb: float values allowed.
cal_value: integer values allowed.
power_lsb: float values allowed.

bus_voltage_range:
   RANGE_16V
   RANGE_32V
gain:
   DIV_1_40MV
   DIV_2_80MV
   DIV_4_160MV
   DIV_8_320MV
bus_adc_resolution:
   ADCRES_9BIT_1S
   ADCRES_10BIT_1S
   ADCRES_11BIT_1S
   ADCRES_12BIT_1S
   ADCRES_12BIT_2S
   ADCRES_12BIT_4S
   ADCRES_12BIT_8S 
   ADCRES_12BIT_16S
   ADCRES_12BIT_32S
   ADCRES_12BIT_64S
   ADCRES_12BIT_128S
shunt_adc_resolution: same as bus_adc_resolution
mode:
   POWERDOWN
   SVOLT_TRIGGERED
   BVOLT_TRIGGERED
   SANDBVOLT_TRIGGERED
   ADCOFF
   SVOLT_CONTINUOUS
   BVOLT_CONTINUOUS
   SANDBVOLT_CONTINUOUS

You can deduce the correspondence with the result of the html tool by their names.

I do not have neither a INA219 nor time to play with this, can someone help interpret this html tool?
Reply
#14
Tobias,

Send a pic of the entire page of the html-tool, with the values you entered. I will be able to enter the values on my system.

Sailoog,

Same thing, send the entire page of the html-tool with the values you entered to set the defaults.

Thank you.
Reply
#15
I got these defaults from the code (mode "set_calibration_32V_2A"), not from the html tool.
Reply
#16
(2022-11-29, 06:47 PM)Sailoog Wrote: I got these defaults from the code (mode "set_calibration_32V_2A"), not from the html tool.

I guess i just figured it out: leaving all default values in RichFinds HTML  and choosing a LSB of 100 microamps gives the default values in sailoogs screenshot. you just have to adjust for units:  openpoltter expects current_lsb in milliamps (0.1mA=100uA), and power_lsb in Watt (0.002 W=2mW). 

[Image: Hf245zu.md.png]

update: almost. Current and voltage  measurements are OK, power is off my a factor of 1000, so power_lsb is also in mW. The numbers for voltage, current and power in signalK don't line up perfectly, as they are taken at slightly different times, and my test load (the raspberry) is fluctuating a bit.

[Image: Hf2yoZl.md.png]

[Image: Hf2yNwv.md.png]
Reply
#17
That is what I thought was happing but I wanted to check with the values you were using to verify before posting.

Try turning on the raw values. Just to see if they are coming out the same.

You probably should increase the number of samples:
  
  ADCRES_12BIT_1S
  ADCRES_12BIT_2S
  ADCRES_12BIT_4S
  ADCRES_12BIT_8S
  ADCRES_12BIT_16S
  ADCRES_12BIT_32S
  ADCRES_12BIT_64S
  ADCRES_12BIT_128S

Same for the bus voltage:

   SADCRES_12BIT_1S etc.

It also bothers me that the shunt voltage = null


Might be due to high current shunt with low current.
Reply
#18
Raw Voltages are fine, raw current and power seem to be in mA and mW, respectively.

for roughly half an Ampere, the Shunt voltage is 3 to 4 mV, that may well be interpreted as null. I'll try a setup with lager currents this weekend.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)