kriswiner / MPU6050

Basic MPU6050 Arduino sketch of sensor function
715 stars 190 forks source link

Madgwick Quaternions without accelerometer data #50

Open intensite opened 3 years ago

intensite commented 3 years ago

Hello Kris,

First of all, thanks for this old but very useful library.

Is it possible to use the MadgwickQuaternionUpdate without Accel inputs?

I am in the process of creating a model rocket flight computer and I suspect the fusion of the Gyro with accelerometer cannot be used in this application because of the high acceleration inherent to rockets.

I do however need the integration of the angular velocity of the gyro axis into Quaternions.

I tried to strategically place a if statement in the code of the MadgwickQuaternionUpdate to ignore the Accel data if 0,0,0 is passed for the 3 accel axis. However, I am unfortunately not gifted for complex algebra and so far I haven't had much success.

Is this something you can help with?

Best regards.

kriswiner commented 3 years ago

" Is it possible to use the MadgwickQuaternionUpdate without Accel inputs?"

As far as I know the answer is no.

What you can do is put a small weighting on the accel values, sort of like setting them all to zero, but I am not sure this will work too well. Maybe have a weighting of 1 if the absolute value of the accel vector is 1 g or less and an exponentially decreasing weighting as the accel increases above this value?

On Thu, Oct 29, 2020 at 7:52 PM intensite notifications@github.com wrote:

Hello Kris,

First of all, thanks for this old but very useful library.

Is it possible to use the MadgwickQuaternionUpdate without Accel inputs?

I am in the process of creating a model rocket flight computer and I suspect the fusion of the Gyro with accelerometer cannot be used in this application because of the high acceleration inherent to rockets.

I do however need the integration of the angular velocity of the gyro axis into Quaternions.

I tried to strategically place a if statement in the code of the MadgwickQuaternionUpdate to ignore the Accel data if 0,0,0 is passed for the 3 accel axis. However, I am unfortunately not gifted for complex algebra and so far I haven't had much success.

Is this something you can help with?

Best regards.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU6050/issues/50, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKRS7IQ7FAEMWS7H4F3SNITADANCNFSM4TEPHUIQ .

intensite commented 3 years ago

Thank you sir!

One would alter these using the beta or the zeta parameter? Right now (by default) my beta evaluates to 0.60 while zeta evaluates to 0.03

Also, in your sample, we can fin this piece of code (commented out). Is it what you had intended to do to decrease reliance on the accelerometer after initial stabilization.

     if(lastUpdate - firstUpdate > 10000000uL) {
       beta = 0.041; // decrease filter gain after stabilized
       zeta = 0.015; // increase gyro bias drift gain after stabilized
     }
kriswiner commented 3 years ago

These parameters are really irrelevant...but you can try different values if you want.

Most important are proper calibration of the sensors, and fast enough speed (number of iterations per new data sample) of the fusion rate. Everything else is in the noise...

On Sat, Oct 31, 2020 at 10:07 PM intensite notifications@github.com wrote:

Thank you sir!

One would alter these using the beta or the zeta parameter? Right now (by default) my beta evaluates to 0.60 while zeta evaluates to 0.03

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/MPU6050/issues/50#issuecomment-720029033, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKXJI53NPKBTZEHH4F3SNTUHTANCNFSM4TEPHUIQ .