forked from zietzm/Helmholtz_Test_Bench
BUG: Calibration routine uses raw field instead of compensated field
Substracting the ambient field from the set magnetic field values during calibration, no longer substract initial offset measurement from all readings
This commit is contained in:
+3
-2
@@ -476,14 +476,15 @@ class MagnetometerCalibrationComplete(Thread):
|
||||
for vec_idx, test_vec in enumerate(test_vectors):
|
||||
# Command output
|
||||
applied_vec = test_vec * self.calibration_mag_field
|
||||
self.cage_dev.set_field_raw(applied_vec)
|
||||
self.cage_dev.set_field_compensated(applied_vec) # Set compensated field not raw field
|
||||
|
||||
# Sleep for a certain duration to allow psu to stabilize output and magnetometer to supply readings
|
||||
time.sleep(self.calibration_interval)
|
||||
|
||||
# Read output and save to array for solver later
|
||||
raw_reading = g.MAGNETOMETER.field
|
||||
reading = raw_reading - offsets
|
||||
# reading = raw_reading - offsets
|
||||
reading = raw_reading # Do not substract offset since it will artificially suppress (hard-iron) offsets
|
||||
for i in range(3):
|
||||
row = {'m': reading[i], 'b_x': applied_vec[0], 'b_y': applied_vec[1], 'b_z': applied_vec[2]}
|
||||
# self.put_message("[Axis {}] {}".format(i, row))
|
||||
|
||||
Reference in New Issue
Block a user