@@ -40,11 +40,15 @@ speed. Units:
40
40
accel: Typically G. Values are normalised in the algorithm so units are irrelevant.
41
41
gyro: Degrees per second.
42
42
43
- ``` calibrate(getxyz, stopfunc) ```
43
+ ``` calibrate(getxyz, stopfunc, waitfunc ) ```
44
44
45
45
The first argument is a function returning a tuple of magnetic x,y,z values from the sensor.
46
46
The second is a function returning ``` True ``` when calibration is deemed complete: this could
47
- be a timer or an input from the user. The method updates the ``` magbias ``` property.
47
+ be a timer or an input from the user.
48
+ The third is a function providing a delay. Some hardware may require a delay between magnetometer
49
+ readings. In multi-threaded environments the function provides an opportunity to yield
50
+ execution to other threads.
51
+ The method updates the ``` magbias ``` property.
48
52
49
53
Calibration is performed by rotating the unit around each orthogonal axis while the routine
50
54
runs, the aim being to compensate for offsets caused by static local magnetic fields.
@@ -77,7 +81,7 @@ these will be aliased down into the filter passband and affect the results. It's
77
81
neccessary to isolate the sensor with a mechanical filter, typically a mass supported on very
78
82
soft rubber mounts.
79
83
80
- If using a magnetoemeter consider the fact that the Earth's magnetic field is small: the field
84
+ If using a magnetometer consider the fact that the Earth's magnetic field is small: the field
81
85
detected may be influenced by ferrous metals in the machine being controlled or by currents in
82
86
nearby wires. If the latter are variable there is little chance of compensating for them, but
83
87
constant magnetic offsets may be addressed by calibration. This involves rotating the machine
0 commit comments