![Yoctopuce Yocto-GPS Скачать руководство пользователя страница 129](http://html1.mh-extra.com/html/yoctopuce/yocto-gps/yocto-gps_user-manual_3415557129.webp)
The Yoctopuce modules support two types of calibration. On the one hand, a linear interpolation
based on 1 to 5 reference points, which can be performed directly inside the Yocto-GPS. On the
other hand, the API supports an external arbitrary calibration, implemented with callbacks.
1 to 5 point linear interpolation
These transformations are performed directly inside the Yocto-GPS which means that you only have
to store the calibration points in the module flash memory, and all the correction computations are
done in a perfectly transparent manner: The function
get_currentValue()
returns the corrected
value while the function
get_currentRawValue()
keeps returning the value before the
correction.
Calibration points are simply
(Raw_value, Corrected_value)
couples. Let us look at the impact of the
number of calibration points on the corrections.
1 point correction
The 1 point correction only adds a shift to the measures. For example, if you provide the calibration
point
(a, b)
, all the measured values are corrected by adding to them
b-a
, so that when the value
read on the sensor is
a
, the latitude function returns
b
.
Measure correction with 1 calibration point, here (5,10)
The application is very simple: you only need to call the
calibrateFromPoints()
method of the function
you wish to correct. The following code applies the correction illustrated on the graph above to the
first latitude function found. Note the call to the
saveToFlash
method of the module hosting the
function, so that the module does not forget the calibration as soon as it is disconnected.
Double
[]
ValuesBefore =
{
5
}
;
Double
[]
ValuesAfter =
{
10
}
;
YLatitude f = YLatitude.
FirstLatitude
()
;
f.
calibrateFromPoints
(
ValuesBefore, ValuesAfter
)
;
f.
get_module
()
.
saveToFlash
()
;
2 point correction
2 point correction allows you to perform both a shift and a multiplication by a given factor between
two points. If you provide the two points (a, b) and (c, d), the function result is multiplied
(d-b)/(c-a)
in
the [a, c] range and shifted, so that when the value read by the sensor is
a
or
c
, the latitude function
returns respectively
b
and
d
. Outside of the [a, c] range, the values are simply shifted, so as to
preserve the continuity of the measures: an increase of 1 on the value read by the sensor induces an
increase of 1 on the returned value.
17. Advanced programming
www.yoctopuce.com
123
Содержание Yocto-GPS
Страница 1: ...Yocto GPS User s guide...
Страница 2: ......
Страница 6: ...22 Characteristics 557 Blueprint 559 Index 561...
Страница 10: ...4 www yoctopuce com...
Страница 14: ...8 www yoctopuce com...
Страница 18: ...12 www yoctopuce com...
Страница 22: ...16 www yoctopuce com...
Страница 38: ...32 www yoctopuce com...
Страница 42: ...36 www yoctopuce com...
Страница 54: ...48 www yoctopuce com...
Страница 72: ...66 www yoctopuce com...
Страница 92: ...86 www yoctopuce com...
Страница 122: ...116 www yoctopuce com...
Страница 132: ...126 www yoctopuce com...
Страница 159: ...20 High level API Reference On failure throws an exception or returns a negative error code www yoctopuce com 153...
Страница 564: ...22 Characteristics 558 www yoctopuce com...
Страница 565: ......
Страница 566: ......