-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Multirotor toilet bowling detection #10854
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
base: maintenance-8.x.x
Are you sure you want to change the base?
Multirotor toilet bowling detection #10854
Conversation
|
I like the concept.
This would be very useful. May I ask.. Did you write this as a result of your copters experiencing toilet bowling over the last year ? |
I've had a couple of crashes caused by toilet bowling. The first was close to trees, it hit them before you had a chance to do anything. The second was recently and shouldn't have been a problem given it was high and away from things to hit except it also had a problem with an incorrect Z velocity (caused by the toilet bowling ?) which resulted in it disarming from quite a height. It's not always immediately obvious it's toilet bowling looking through the FPV View and it had held position happily for several minutes beforehand so I assumed the compass was OK (the toilet bowling starting after yawing 180 degs so inconsistent heading all the way around). I ended up hitting RTH and it managed to make it home albeit in a massive sweeping arc then drifted off as it turned to the home heading at which point it actually recovered to a stable landing hover (the heading was actually vaguely correct in that direction). It was trying to land but the Z velocity estimation was screwed up which caused it to climb rapidly when it thought it was descending. This confused the landing detector leading to the disarm. In hindsight I should have just switch out of Nav modes and flown back manually which I tried literally at the point it disarmed. At least with this PR it probably would have stopped the instability and thrown up a message telling you it's got a problem with the compass. Would have just made thing a lot more immediately obvious. Amazingly all the quad suffered was a bent (S shaped) frame spacer post which I think was the only bit that hit a tree branch. |
|
The reason I asked. Is because two of my test copters have expereinecd toilet bowling as well over the latter half of the 8.0 master, I tried re-calibrating the compass etc. With varied success. But haven't really pinned down why its happening.. Being that both these copters are well established in the hardware layout, over many releases. With both only having small crashes. Not enough to damage much at all. |
The problem in my case seemed to be caused by an old BN-880 compass and possibly a new GPS mount which was a cm lower and closer to the frame than the old mount. The heading was out by around 70 degs going from NW to S when the toilet bowling occurred. Recalibrating afterwards and fiddling with compass alignment settings to account for the fact the new mount was a few degs different to the old one didn't seem to help, the heading was always 30-40 degs off at some point in the circle. A new Walksnail WS-M181compass worked straight away, consistent compass and quicker GPS lock + smaller and lighter. |
Are you willing and able to test this? Compiled targets can be found here, or if it's more convenient I can compile for whichever board so you don't have to hunt for them. |
|
I've been testing this using BEEPER mode with the following bit of extra test code in navigation.c inav/src/main/navigation/navigation.c Line 2896 in 9591dee
I've noticed you need some wind to induce toilet bowling. Even with a 70 deg heading error it wouldn't toilet bowl the other day when conditions were calm but it started pretty quickly when there was some wind on another day. Toilet bowling is more reliable with a 90 deg heading error. Which is interesting because I've wondered how accurate the compass really needs to be to avoid problems in Poshold. Seems not that accurate. I struggled to get any instability at 45 degs even with wind. |
I figure with Which raises a question I've seen a lot of in the later part of 8.0.. How much is the magnetometer actually doing in 8.0. Because I've noticed some unusual bearing error. |
|
Testing with this firmware. In the first part of this log (not pictured here to save video file size). I was travel straight in Poshold (Cruise) and released the stick to center. And the copter pulled-up straight and in-line with the course it was traveling on.. I did this again, and the result was the same, with no deviation. It is interesting that this also happened after a 180° turn around, as you experienced.. Which leaves the question. What is actually causing it. And why did the copter just hook to the left ? Its not the only copter I've seen this happen with over the last 8 months or so. I doubt there was enough mag deviation to cause that to happen, or it would have happen in the two stops, just before. Once the copter had settled down to a fixed hover position, while toilet bowling. I assume systems message warning should have appeared ? Deviation.mp4If you would like to look at the whole log. Just ask, and I'll DM you it on Discord. |
|
Not sure it detected that toilet bowling @Jetrell given there was no system message. It also tends to very obviously snap back under control when detection happens. Looks more like the toilet bowling simply faded away by itself. |
|
It appears to work okay in Poshold. So it would appear this feature helps to stop toilet bowling once it occurs; in a cases when the user doesn't have their copter setup correctly.. This makes it very helpful addition, with all else being good. After flashing back to 7.0 (arbitrarily) with these same copters. The toilet bowl effect doesn't occur after a 180° heading reversal. I had a skim through 8.0 changes that might have added to this. I'd considered the new auto declination tables being incorrect at my location. But after running a re-calibration and using manual mag declination for my location. The issue still persists. |
|
Did you test @Jetrell by inducing a heading error or did this toilet bowling just occur anyway ? As it is this PR will only work if a hold position is active which for WP missions is Time hold or end of mission hold. I take it toilet bowling doesn't occur if you do a 180 deg reversal in Poshold mode ? |
|
The tests in Poshold where done while the copter was in motion with the pitch stick held forward to make it travel. The other times I notice this other more concerning issue occur. Is when the copter is performing an RTH. It was using a 3 sec PH_time in the test mission. However when there is noticeable deviation between the headings seen in the log. This feature does catch it, and snaps it back straight again. |
|
Are you sure that's not just a dodgy compass @Jetrell ? The issue I had was the compass was just unreliable. Would work fine most of the time then become sluggish and inaccurate for no obvious reason. Almost seemed location related as if there was some sort of interference in certain locations. Although in the end it wouldn't calibrate no matter what you did. As for the horses ... this is really only meant to stabilise the quad and prevent it going nuts before you have time to react. It can't really do anything else because the heading correction this applies may in fact only work for the current heading. If you try and turn to some other heading the correction could be wrong because the compass error will have changed. However, switching out of the Nav mode to Acro resets the correction so you could turn to home for instance (if you knew where it was from the FPV view) then try and use Nav modes again in which case any heading correction applied should be good to get home. |
|
I wish it was a dodgy compass. It would be easier to replace them LOL. That would save me a lot of time and frustration. But after flashing back to 7.0. Its all good again. Adding to your other question. We know that during magless copter navigation usage. It updates the IMU heading from GNSS course. |
|
I am considering using acceleration data from GPS to estimate yaw. If this works well, it may get correct yaw estimation even on toilet bowling. |
|
#10854 (comment) The yaw and the course over ground is different; yaw is where the plane is facing, and CoG is where it is flying. |
In what way do you mean normal ? Quote for that post : In the first part of this log (not shown here to save video file size). I was travelling straight in Poshold (Cruise) and released the stick to center. And the copter pulled-up straight and in-line with the course it was traveling on.. I did this again, and the result was the same, with no deviation. Then I turned the copter around 180degs on its yaw axis and traveled in the opposite direction, then relased the stick. This is where that video starts. Which incurred a sudden hook to the left by navigation. Seen by the rcCommand[roll] and not rcData[0]. it was not a stick response from me, but from the nav controller. This lead to the toilet bowl effect. And from tests with other copters, it's the 180 deg yaw turn on its axis, that causes this deviation once the copter is commanded to slow or stop. |
|
@shota3527 Here is a video from UAVTech. |
|
The only problem is that there is a heading/yaw estimation error(difference on estimated yaw vs real) on the multi-rotor, causing the toilet bowl or navigating to the left/right problem when navigation mode is engaged. In the UAVtech video at 06:03, pay attention to yaw and cog. The quad is flying to keep on an estimated 198 ° course, but it actually flies on a 205 ° course in reality(COG). The estimated yaw is being corrected to 205 °. But the navigation command is to maintain a 198 ° course, so turn left to keep the 198 ° course. And in Deviation.mp4 vedio, the estimation is already disoriented by mag sensor The AHRs aim to obtain the best Roll/Pitch/Yaw Estimate using available sensors, and navigation relies heavily on this. However, this does not work well for my yaw estimate. Only a perfect mag or flying absolutely a straight line (facing a different direction is okay) in no wind can get perfect estimation. I don't think with evidence. chance of positive estimation error(real is greater than estimated) is statistically significant, it can also cause by other reasons, like most of us mount the mag sensor in same orientation, |
|
@shota3527 I get what you mean. Please don't take anything I say as criticism. I'm just trying to put forward the culmination of many tests with many model. With the position estimator being the sum of GNSS, IMU and Mag data. Its hard not to get incorrect data from loss of satellite precision and mag deviation during banking, turning or slowdowns.. And its also impossible for the IMU not to experience higher levels of vibrations at certain points in the throttle range (unless INAV had BDshot) even on quads and fixedwing that have their props and motors balanced together. Which all my test fleet and cruisers do. Fly long legs in a mission or RTH generally doesn't see issues.. But the worst cases are in modes like Poshold or WP missions, when the copter is traveling along, then can stop, turn or slow at a fixed point.
From flashing back to 7.0 and before with multiple copters, using the same hardware. I had noticed the estimator does seem more tolerant over a wide range of tests. Including flying in different temperatures and times of the day to provide the availability of more satellites. |
|
@Jetrell
|
I often check for vibrations in the log data. They are as clean as I can get them, both with hardware and filtering. The only part of the throttle range there is some noise, is between around 35 to 42% due to ESC pwm drive. But this is very minimal. The filters squash that with ease.
I had tried that early in 2024. And have switch back and forth between those in the dynamic model. And I have stayed with air<1G. The two are practically identical. With no user quantifiable benefits that can be noticed, either good or bad. I have also more recently drop the GPS serial baud rate down to 57600 from the higher default. Due to the way GNSS comms is a bit touchy, and looses hot fix in a moment. This certainly doesn't help on lower quality modules, when the almanac has to be acquired again.
That is interesting to hear! |
|
@Jetrell |
I would say yes. It effects all axis's. I understand the limitations of what the available sensors can accomplish under challenging conditions. And if I didn't have past software references, when using the same hardware I did back then, as well as today... Then I'd most likely not know any different. And just ignore it. Not that I feel its acceptable navigation performance. Its just that I wouldn't be faced with it every time I go out flying. When I'm trying to assess if other new changes are making any difference.. If you get my meaning. @breadoven may have something extra to add. |
|
I think we have two different things being discussed here.
Can I get a show of hands on question number 2? Should we merge this PR, is it ready? |
|
|
I did think it might be better to have options for detection only and detection and correction. Don't forget that the correction only applies until the Nav mode is switch off at which point it resets. The only outstanding test I wanted to do was checking behaviour in Pos Hold cruise mode which I never got around to doing. |
Adds toilet bowling detection for multirotors. If toilet bowling is detected a heading correction is applied which should stop the toilet bowling occurring. A system message is also shown on the OSD.
Detection is based on inconsistency between the required heading to the hold point and the GPS course over ground and also a speed/distance to hold point factor. These are only active when the quad is > 1m away from the hold point and has a speed of at least 1m/s (GPS ground course is unreliable below this speed).
The speed/distance to hold point factor, speed * distance, seems to provide a good indication of the main characteristic of toilet bowling which is rapidly increasing speed and distance from the hold point. From testing this factor is in the low hundreds for normal position hold. When toilet bowling occurs it rapidly rises to 10's of thousands.
Detection can be tuned for sensitivity by a setting that effectively sets the threshold value of the speed/distance to hold point factor. When set to 0 (default) toilet bowling detection is disabled .
This has been tested during position hold on a 5" multirotor and appears to work well. The testing initiated toilet bowling by adding an offset to
posControl.actualState.yaw. 45 degs didn't seem to do much, no toilet bowling, but 90 degs immediately causes problems. When toilet bowling was detected and the heading correction applied the toilet bowling stopped immediately. The heading correction was typically within 20 degs of the actual true heading which seems to work OK given even a 45 deg heading error doesn't seem to cause toilet bowling.Currently only works when holding position. This doesn't include when adjusting position although it appears this should work, needs more testing. Also could be extended to work with RTH etc when on route to home/WP. There is also the possibility to use this detection to flag the magnetometer as unreliable in the IMU preventing its use when Course Over Ground is reliable at higher ground speeds.