-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPS Inconsistent behavior #431
Comments
Seems like a GPS-related problem. GPS (and estimated navVel) velocity doesn't seem to be correlated with UAV attitude and stick input: It might also be a compass issue: However, I doubt it's compass - UAV heading strongly correlates with yaw stick input. I'd blame GPS reception that reported invalid coordinates/velocities/course for some reason. @stronnag was there strong wind that day, if so - what direction? |
@digitalentity, thanks for the analysis. There was less than 8 m/s wind; I often fly in more. My initial thought (from the field) was that it was just a bad GPS day. I guess that happens from time to time. I did not suspect the compass, much of random flying / drifting around was manually correlating the observed heading with the LTM reported heading (which seemed consistent), whereas the mwp calculated 'range from home' often seemed incongruous. It was an object lesson in 'try PH before engaging more advanced nav functions'. I'll do some more missions today before closing. |
@stronnag |
A day later .... updated the firmware to abf1015 (so no significant change). Starts with similarly less than stellar sat statistics (13-15 sats, 1.3-1.5 HDOP); couple of hours later its back to normal, 19-20 sats and 1.1 HDOP. PH and other nav functions back to their awesome performance and consistency, even at the lower than normal end of the sat coverage range. Someone in the DoD really didn't like me yesterday. Maybe we should use some of those spare X-FRAME bits for a glitch detection alert or counter? |
@stronnag thanks for your report, indeed something must be wrong with GPS reception. We can use a byte in X-Frame to indicate INAV internal status flags, however we still don't have a good logic of detecting GPS failures... |
The solution to the problem is using EKF algorithm although it looks messy and complex. |
EKF is nothing close to a glitch detection and protection, it's merely an algorithm to blend data from available sensors. |
If large difference between receiving from gps and predicting form EKF,program will move the data from gps.Maybe I'm wrong. |
It's not the EKF itself, it's a supporting code logic that does the detection. |
Oh.Sorry.It's my wrong. |
Today I had a situation when at pos hold mode my hexacopter rapidly started to fly away. Not sure whether it was caused by loosing some sats or... Anyway maybe it would be a good idea either to take an average of 2-3 readings or ignore for pos hold mode position change grater than... (say 10cm/sample depending on model speed from the previous cycle/ significant sat.num loss)? |
GPS glitches are very rare, my report was a once a year occurrence, for a frequent flyer. Your problem is more likely symptomatic of mag interference. Have you verified that the mag works perfectly at all throttle settings? |
Not sure what's telling you it's mag problem. If it was, then I believe the model would make slowly bigger and bigger circles, but it would not rapidly fly away. Do you agree? |
Hard to diagnose w/o logs. Circles happen when heading is slightly wrong (up to maybe 30 deg) - this result in quad moving in slightly wrong direction. Bigger error will result in quad going in significantly wrong direction and a case of fly away. |
There were no circles (for sure if it were then I would see it every time when using pos hold for a while). But there was just sudden pitch inclination increase by approx 30 deg. Now I know how to enable onboard dataflash bbox, so hope to catch it next time. |
It's either a magnetic anomaly or compass failure, or real GPS glitch. If compass wiring is not good the sporadic bug in connectivity to compass chip may cause the chip to freeze and give out same heading over and over again. Please also check the wiring to the compass. |
I am using onboard compass, so no wiring, can try to threat it with hot air but low chance. The FC is shielded (50x50mm 35um Cu PCB) from the bottom and grounded. |
@xdigyx shielding like that would not block magnetic field from power cables. It might shield oscillating magnetic field, but frequency would have to be > 100kHz. |
Got your point, I was not thinking about this as the yaw heading reads were changing only 1-3deg depending on THR level. |
@digitalentity. I no longer think that this is an external GPS issue.
Today.
(all logs at http://seyrsnys.myzen.co.uk/inav_ph_woes/). There was perhaps 30 seconds in the land / power-cycle sequence. I find it hard to believe the satellite performance is varying in that short time period. The whole sequence described above was within 7 minutes, with consistently between 17-19 satellites and c. 1.1 HDOP. That I can have nav functions randomly work / fail on power cycle within very short time periods looks to me like a firmware issue rather than a celestial GPS issue. I'm encouraged in this theory by your recent CC3D sensor woes. |
I'm certainly willing to believe this is a firmware problem. The IO changes were pervasive, and although I was very careful, there is certainly a possibility that I've introduced a bug somewhere. |
It's all circumstantial at the moment, but definitely a regression since 2016-7-30, the last flawless nav experience (with this hardware). I should add that so far the Dodo has behaved OK, whilst the SPRF3 has not (same firmware). Tomorrow, it's the Dodo. |
Today I did catch same issue. For sure there was some yaw drift, but it seems like the model was all time trying to face the starting position. After approx 2 min from start num of sats dropped to 0 just for one read cycle and my model rapidly moved. The full log file I can send on email to whom it may concern (pm me). Just for clarification: I am using ver 1.1. |
@stronnag, I agree, this is very likely software issue. However I'm Which direction was your machine facing on powering up? Maybe something in |
This is going to be a tough one - changes to firmware will affect the
memory layout and may seemingly "fix" the bug...
|
@stronnag I have a strong feeling that something is wrong with either IMU of magnetometer code. From your latest logs: LOG 293 LOG 294 Interestingly in LOG292 and LOG293 machine does the same (correct) tilt to corrent for error however actual correction differes. This can only happen when heading is incorrect. Can you send exactly the same hex/dump file you've been using during these tests so I can check it on my SPRF3 board? |
So, can you clarify what you have done. As I understand it you have taken your Dodo FC off your tricopter (which does PH fine) and put it on the quadcopter which previously had the SPRACINGF3. The quadcopter didn't do PH before and now still doesn't do PH. Is that correct? Also, can you put the SPRACINGF3 on the tricopter and see how that flies? |
I'd say it's a hardware issue, however we have one single weird thing here - issue is not present on older commit (from before complete IO migration). I'm confused. @stronnag do you, by any chance, have a SerialRX receiver (S.Bus or something like that)? I'd really like to rule out the PPM receiver code. 0489eb8 did some changes to timer handling which may be the thing that's haunting us now. Also, try disabling gyro sync (just to make sure EXTI is not responsible). |
If I understand correctly, the difference between Tri and Quad is the airframe and GPS module, the rest is the same. I'd say it's something wrong with GPS code or GPS processing code in NAV system. Also worth trying - SPRacingF3 EVO on a quad. I know it's not that simple but it will rule out the specific firmware issue. Facts we have:
Did I miss something? |
I have a spektrum satellite that I can steal off another machine (moving tele off or soft serial). I can also disable gyro sync. I could put the SPRF3 on the tri, but that's my last resort. I hope to get out later today with spek sat and gyro off (and working logging). Summary:
|
Did you miss something. No
|
@stronnag thanks for testing my crazy ideas 😄 I think the issue is isolated to your specific setup, however since it wasn't evident with earlier revisions, we should try hard and fix it as it's clearly a regression in the latest code. |
And thanks for all the developer effort that has gone into this. I'm more that will to agree that it could well be setup specific post 27822a5, on the other hand, we have a very small testing community. |
Further testing / option elimination
However, one thing you mentioned did seem worthy of further experimentation. Most of time, after a hard reset PH will initially fail; a single soft reboot will iirc always fix the condition. |
@stronnag now this is something! Quite possible it's a hardware not ready condition. Do you know if it's HMC5883L or HMC5983 chip on BN880 GPS? They use the same driver but HMC5983 is usually taking longer to initialise. In the If during migration to new IO we saved some time on initialising all of them then the delay for compass to initialise on power-up is no longer enough. Another possibility is that we start initialising GPS too early, not giving it much time to boot properly. Simply looking at the diff output I see that we changed a delay in I'll prepare a debug branch to test as soon as possible! |
I've implemented two extra delays on cold-booting in #517. One is imposed prior to sensor detection (500ms), the other delays GPS initialisation to start at least 2sec from power-up. You get PH working some time, so missing delay is probably marginal. I suspect that reduced BMP085 detection delay (less 180ms to boot time) is what caused the problem. If so, extra half-second delay should put things back to perfect state. |
In the field. 7 successful pH cycles on boot-delay and naze32. Big grin. Changing fc to dodo for more tests. |
10 consecutive PH cycles on dodo with boot-delay. We're fixed. Time for another RC? |
Yee-haw! We finally did it! |
Fantastic! Thanks again @stronnag for all your help in testing. An lots of good cleanup resulted from this. And I am SO GLAD that it was not a problem with the conversion to the new IO! |
@digitalentity can you also merge #521 - updated targets. It just adds some BARO and MAG |
Also please merge ibus telemetry Il 29/ago/2016 11:11, "Martin Budden" notifications@github.com ha scritto:
|
And EVO SDCARD .... |
@stronnag I really appreciate all the time and test flights and willingness to put your aircraft at risk in order to help solve this problem. Well done to everyone else involved too, of course! |
I know this bug is marked closed, but I'm pretty sure I'm experiencing it (or something closely related), because engaging PH seems to always result in the aircraft flying away, but after a soft reboot is performed, PH works fine. (still gathering data, but haven't observed any occasions where PH works on hard reset, or doesn't work on soft reboot) This is on an Omnibus clone (f4 v5pro) on 1.7.2 with a Beitian BN-880 GPS/compass. There's no blackbox capability on this FC, or I'd share a log. Willing to perform any steps that might help narrow down the cause of the issue. EDIT: After some more research, it appears very likely that this is issue #1791 that I'm experiencing. |
Spoiler : Somedays, adequate humber of satellites and reasonable HDOP doesn't meant nav functions will work as expected.
Today I flew 85fe245 and f440ead on my usually utterly reliable quad. This machine has not failed to execute PH, RTH or missions since we fixed SBAS months ago ---- until today.
Result. Completely random PH behaviour (if PH fails, then I don't even try any other nav function). Randomly, on hard reset, nav functions will either work or fail. Some log files at
http://seyrsnys.myzen.co.uk/inav_ph_woes/. All the log files were created in a short time frame with good satellite coverage (16-19) and good HDOP (1.1 - 1.3).
... does some betaflight stuff on the minis for 30 minutes
Note 0. LOG00281 Index 1, PH attempt 4 is a good example of 'fly off'![selection_473](https://cloud.githubusercontent.com/assets/158229/17458870/3318c644-5c1a-11e6-9f85-7fac90c42b86.png)
Note 1. 281-283 were executed in quick succession, it is unlikely that there was some environmental change that affected the results.
Note 2. If PH is not (obviously, visually working), it is rapidly aborted.
Exec Summary : nav post 43eaf10 seems pretty random to me at the moment. Other experiences solicited.
The text was updated successfully, but these errors were encountered: