Fermium / datalogger

The Datalogger physicists deserve
0 stars 0 forks source link

Move a and b variables to mathsheet #90

Closed ddavidebor closed 6 years ago

ddavidebor commented 7 years ago

Move A and B variables to mathsheet, also rename them with something more explicit

ddavidebor commented 7 years ago

This should be implemented directly in the current set widget. The math is very simple and works the following way:

Assuming you have a value you want to assign, for example 0.05 A (amperes) --> 0.05 for simplicity

We use a simple adjustment algorithm to compensate for hardware issues, it works the following way:

output = a + inputvalue * b

where a is near 0, and b is near 1

two better names for a and b are:


Currently, in develop those two values are specified here:

https://github.com/ddavidebor/datalogger/blob/dc04435e69f9931b19a4d3588aabb991b75295a2/app/devices/labtrek/ltk-hall/config.yaml#L22-L25

But that is only specific for a instrument model, while calibration values are specific for every single instrument.

The best solution would be to put the values and the formula in the mathsheet

adj_current_generator_offset = 0.0
adj_current_generator_slope = 1.0
output_current = adj_current_generator_offset + user_output_current_value * adj_current_generator_slope

This way the current input value passes through the formula, that could be changed with a better model in the future.

problem is, not all the mathsheet is valid if the measures have no value. So we need to invent some way to separate the current output part. Maybe a specific comment ? or maybe use some "grep-like" instruction to extract the lines we need.

ddavidebor commented 7 years ago

Please @wtubog ignore the code regarding a and b in usb.js

SimoneTosato commented 6 years ago

temporary solution making a and b editable, we will find a better handling solution when working on a more efficient config file.