iNavFlight / inav-configurator

GNU General Public License v3.0
580 stars 310 forks source link

Random movement in quad pitch and roll when GPS is enabled #2147

Open cptX opened 2 months ago

cptX commented 2 months ago

When being in the configurator in the Setup Tab I was viewing random movement of the quad, although it was sitting still on the table. Please see the attached video.

https://github.com/user-attachments/assets/f6efd37e-6abd-4a24-a194-5c9cb5d2fa80

Initially I thought that a sensor was giving noise but I checked all inputs at the Sensors Tab and everything was stable. Then I disabled the GPS and the random movement of the quad in the Setup Tab was gone.

This made me very curious why the system was making random movements on roll and pitch axis if the gps gives info only about the position in the horizontal plane and provides absolutely no info of the roll and pitch orientation? Is this a bug of the inav firmware, a bug of the inav configurator or no bug at all? If the gps info affects pitch and roll in firmware this could lead to unstable flight and worse position hold.

Please note, that my tests are in house and the gps was getting 5-6 satellites under the roof... My most recent experiments show that the quad appears stable until 6 sats are acquired, then starts jittering... This shows that the extra info coming from gps affects pitch & roll, which in my eyes should not happen.

Jetrell commented 2 months ago

@cptX That's a normal function when GNSS position data is being used to update/augment/correct the attitude reference, from the effects of inflight accelerometer drift.. What you are seeing is noticeable when the delusion of precision is higher and the FC is not actively stabilizing the aircraft, as it would be in flight.

cptX commented 2 months ago

@Jetrell I don't understand why getting new position data from gps affects the stationary pitch and roll. What I mean, is what we see here is the result of the fc kalman filters to change the pitch and roll accordingly in order to move to the new position the gps has given? GPS cannot give info about pitch and roll so how the pitch and roll angles are affected if all sensors are providing the same input?

Jetrell commented 2 months ago

GPS cannot give info about pitch and roll so how the pitch and roll angles are affected if all sensors are providing the same input?

Axis position is based on gyro rotation and the accelerometer confirming that by measured gravity vector. But this has its limitations when forces other than 1G are applied in flight.. It can lead to the accelerometer reference drifting.

There are dynamic accelerometer weights, using rate ignore, slope and turn. To help correct the error when the aircraft experiences forces greater or less than 1G for a short period of time.. But outside of that, GPS VELNED is used to compensate for speed and centrifugal forces applied to the accelerometer.

Both these methods are combine. And the smoothness in which they transition will vary, depending on how poor the satellite position accuracy is.. This is the jittering you see when the aircraft is motionless with a 3D Sat fix.

You can read up more about how it works in the code if you wish.

Nimalankarunakaran commented 1 month ago

Hi,i have the same problem please let me know the solution if you have solved the problem thanks

zied923 commented 2 weeks ago

Hey, i have the same problem and my fpv crashed twice because of this, im using inav 7.1. 2 with f405 v4 speedybee and M10Q-5883 gps/compass. Any one help please how to reduce this bad behavior at least.

sensei-hacker commented 2 weeks ago

Hey, i have the same problem and my fpv crashed twice because of this, im using inav 7.1. 2 with f405 v4 speedybee and M10Q-5883 gps/compass. Any one help please how to reduce this bad behavior at least.

It is unlikely that your aircraft crashed while sitting on the desk because the gyro senses vibrations from a truck driving by on a nearby street. If you are having some problem with your blimp, rover, quadcopter, airplane, or submarine which resulted in a crash, please a open discussion or issue about your problem, and fill in the form so that we can have the information necessary to maybe help you.

zied923 commented 2 weeks ago

I m new here so idk how to use github, i will open discussion ( just did it) thank you.