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:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
openplotter-i2c 3.x.x released
#41
ops good luck!
Reply
#42
Is there a way to apply a calibration factor to a sensor value? What are magnitude and sensor settings?
Reply
#43
(2022-11-12, 08:04 PM)tobias.e Wrote: Is there a way to apply a calibration factor to a sensor value? What are magnitude and sensor settings?

Yes, you can set an offset for each magnitude.

Sensors setings are general settings affecting all magnitudes and a magnitude setting will affect only that magnitude. check ADS1115, it has both sensor and magnitude settings.
Reply
#44
(2022-11-12, 08:21 PM)Sailoog Wrote:
(2022-11-12, 08:04 PM)tobias.e Wrote: Is there a way to apply a calibration factor to a sensor value? What are magnitude and sensor settings?

Yes, you can set an offset for each magnitude.

Sensors setings are general settings affecting all magnitudes and a magnitude setting will affect only that magnitude. check ADS1115, it has both sensor and magnitude settings.

Hi Sailoog, 

thanks for the quick reply. The offset is added to the value, but i would like to multiply by a factor ( INA219 using a different shunt).

Best regards, 
Tobias
Reply
#45
RichFind, tobias.e, let's follow this discussion here please: https://forum.openmarine.net/showthread.php?tid=4310
Reply
#46
Hi Sailoog,

the other tread is great, as it allows to use the full potential of the INA219.

But I think, to be able to scale any sensor data would still be a useful feature for openplotter-i2c. 
So instead of 
Code:
value=value_raw + offset
 
generate
Code:
value=scaling_factor * value_raw + offset


Best regards, Tobias
Reply
#47
Yes, good idea. We could add a new field "Scaling factor" with 1 as default value next to the offset field.
Reply
#48
Scaling factor added to openplotter-i2c v3.3.5:

   

Please test and report, thanks.

Also added settings for INA219: https://forum.openmarine.net/showthread.php?tid=4310
Reply
#49
Hi Sailoog, 

Thank you for including this! Scaling seems to work just fine, but generation of default scaling values seems to be a problem.

I just changed the scaling value for temperature on the BMP280, and singnalK stopped getting values from I2C. 

Debug output from openpoltter-i2c was ( several lines per second): 



Code:
Error reading BMP280: 'factor'
Error reading INA219: 'factor'
Error reading BMP280: 'factor'
Error reading INA219: 'factor'


After also setting a factor for pressure on the BMP280, Errors for this sensor were gone, but the INA219 was still complaining: 


Code:
Error processing INA219: local variable 'current_lsb' referenced before assignment
Error reading INA219: 'factor'
Error reading INA219: 'factor'

This disappears after pressing edit and OK for each measurement.

Looks like the default value of 1.0 works only as long as no scaling factor has been set for any sensor.

One further observation: after setting all scaling values to 1, data was sent to signalK only once, and was not updated for several minutes.


As soon as i changed the update interval for e.g. pressure, data for pressure was updated accordingly. 


Best regards, 
Tobias
Reply
#50
Yes, this is expected for existing sensors but once you edit them or you created a new sensor everything should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)