Detection of invalid floating point calculations.
Two Implemented Methods
Query the FPU
Periodically query and reset the FPU exceptions to detect invalid math operations and division by 0.
Check for non-finite numbers filter histories.
Periodically check one value in each filter history for non-finite numbers.
Test Stand Errors
x2sqz Example
Whole error resolved by setting non-zero initial values.
x2omcpi
Has a lot of FFT output being fed to log10 functions. Because the ADC data is zero, the FFT is zero and we try to calc log10(0)
x2susproc
0s being fed to FFT and then log10. Probably not an issue on production.
x2susprocpi
More 0s being passed around to log10. Probably not an issue on production.
x2iopasc0
Filter ASC0_AS_A_RF45_I_SUM
and ASC0_AS_A_RF45_Q_SUM
get an +inf value in their histories on startup. ./cds/common/src/PHASE_WITH_CONTROL.c
does a division by sin result. When IPCs are just starting sin(0) = 0 -> div by zero.
sincos(R_radian,&sinR,&cosR);
sincos(D_radian,&sinD,&cosD);
sincos(R_radian+D_radian,&sinRD,&cosRD);
argout[0] = in1*(sinRD/sinD) - in2*(sinR/sinD);
argout[1] = in2*(cosR/sinD) - in1*(cosRD/sinD);
D_radian is fed from IPC receiver, so will be zero on startup. Probably need to check for zero before division.