Attitude and Heading Reference System
Our latest article on “How to write your own Flight Controller Software” is available on Medium. This article covers the Attitude and Heading Reference System (AHRS), IMU Filters and Sensor Fusion. We have released the open source Nexgen AHRS Arduino library to demonstrate these techniques on the Nano 33 BLE.
https://reefwing.medium.com/how-to-write-your-own-flight-controller-software-part-7-64daef8299ee
in betaOptimisation.ino , at the function rms(float arr[]) , the n will be allways 1 (row 43). As result the mean will depend only on arr[0]. I assume that you want a mean of 20 samples as the dimension of sampleArray[SAMPLES_PER_BETA]. That is correct and have size of 80 , but when you pass to rms(sampleArray) (row 101) , in the function rms , sizeof(arr) will return 4 as size.
Thanks Eugen – I’ll have a look.