I am currently working on a hobby project involving a device that will be attached to a golf driver club. Its primary function is to continuously measure the angles (pitch, roll, yaw) throughout the swing. This will allow me to monitor specific parameters, such as pitch at 60 degrees, roll at 15 degrees, and yaw at 10 degrees.
For this purpose, I am currently utilizing an accelerometer and gyroscope sensor (LSM6DSR) and contemplating the addition of a magnetometer (LIS3MDL).
Various fusion algorithms can be employed to combine the data from each sensor, including the Complementary filter, Kalman Filter, Extended Kalman Filter, Mahony Filter, and Madgwick Filter, among others.
However, my initial attempt with a simple complementary filter proved inadequate, as even minor vibrations caused the angles to become highly unpredictable.
Hence, my first question is: which filter would be best suited for my application? It is worth noting that I am utilizing an STM32 microcontroller with a clock frequency of 72MHz and a Floating Point Unit (FPU), enabling me to perform complex calculations during the swing if necessary.
Moving on to my second question, regarding the calculation of the pitch: can the accelerometer and gyroscope alone provide accurate measurements, or should I consider incorporating magnetometer values as well? Alternatively, is the magnetometer primarily utilized for yaw calculations?