OK thank you @Jim_Remington for the feedback - my mistake on the jolting, (I assumed i needed maximum readings) but no worries.
Before i get to the calibration re run:
Your comment “I don't understand your plot. It seems possible that at some point, you are crossing a boundary of 90 or 180 degrees, and the math is failing because of sign ambiguity in a sin() or cosine() term.” I’m not sure WHERE in the plot you see this happening. I guess it is possible that i have sign ambiguity , though i have copied and pasted code, so it seems unlikely) but anythings possible, right?
So while we are discussing the +/- signs, and to confirm:
- for the first three boxes in magneto I have been SUBTRACTING from the equations, and
- the next nine boxes i have ADDED.
- Wherever there are two negative, it becomes positive
RE-DOING THE ACCEL CALIBRATION AGAIN
This time I have held it still and just ROTATED it in all directions (as with compass calibration) and re run accelerometer calibration once more. The results are below:
the coloured data output i put in the script like this:
Then re-run magneto
3. re-run of Heading Pitch and Roll
the re-run with the eqtns copied across. As before read is heading which i hold constant (via my wooden gimbal) then i only move pitch and then Roll
-i move Pitch (blue) forward, then back then return it to neutral
- then Roll (yellow) to left a bit, right a bit and neutral
The heading of the device stayed the SAME and should not change at all. but the output (red) changes markedly.
arggg. What to do next>????
I'm hapy to try testing, changing the +/- signs, but there are multiudes of combinations to try. Where to start? There MUST be a logical solution to this!!!