;*************************************************************** ; Prof. Christopher Russel ; Orthonormalize the vectors so the point at 90 degree to each other and have ; the same gain. ; Cso = M * Cic ; (CXso) (a11 a12 a13) (CXic) ; (CYso) = (a21 a22 a23) (CYic) ; (CZso) (a31 a32 a33) (CZic) ; ; where M, (aii) 3x3 is close to ; (1 0 0) ; (0 1 0) ; (0 0 1) ; and CXso, CYso CZso are the corrected and normalized vector components ; Therefore, aii's defaulted values will be set to 0 when i ne j and 1 when i=j, ; shown as above ;*************************************************************** function mag_sensor_orth_correction, Cic, orth_cal ; This calibration function is used to make a correction for the orthogonality of the sensor ; ; Return values initialization CXso = 0 CYso = 0 CZso = 0 CXso = orth_cal(0,0)*Cic(0) + orth_cal(0,1)*Cic(1) + orth_cal(0,2)*Cic(2) CYso = orth_cal(1,0)*Cic(0) + orth_cal(1,1)*Cic(1) + orth_cal(1,2)*Cic(2) CZso = orth_cal(2,0)*Cic(0) + orth_cal(2,1)*Cic(1) + orth_cal(2,2)*Cic(2) Cso = [CXso, CYso, CZso] return, Cso end; end of function