-
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
Waypoint tracking improvements #10278
Waypoint tracking improvements #10278
Conversation
So glad to see improvements here. Thanks a lot! |
Just tested it in HIT myself. With these tweaks I was able to go down to 3 for Tracking accuracy and with very sharp turns or 180° turns its perfect. But it still seems to struggle with turn smoothing "cut" at 90° turns. The bank starts a tad too late and is then adjusting slightly too soft. Could bank much harder as the config allows it. If this can be optimized as well this would be Industrial grade WP tracking for Aerial surveys :D For turn smoothing on to do the outside turn, its the same. First half of the video is with Accuracy 6, second half after the cut is on 3 https://www.youtube.com/watch?v=xUHpfCK9mVM |
I didn't do anything about the turn smoothing issue. Not sure what the answer is there. As you say, the control is there to achieve what you want but getting it to do it consistently isn't easy. You could probably fiddle something to start the turn earlier but then you'd find it was over cutting the corner when the wind changed direction. I might try resetting the position controller to see if that improves things (resets the PID influence of the previous straight line flight behaviour). The main problem with the turns is it uses the circular loiter method but only for up to half a turn which isn't long enough to establish the turn correctly. I've always noticed loiter mode usually takes at least 1 full turn before it settles down into a turn with a consistent radius, the initial radius tends to be wider before closing down as the turn continues. |
Fair enough. Its a different beast to tame. |
My observation with elevon controlled planes is always like this. But if I run the same mission with any of my tractor twins or conventional rudder airframe. With |
Actually I forgot that CUT turn smoothing doesn't use the circular loiter code it simply switches to the next waypoint at some distance before reaching the current waypoint. The distance is a function of the turn angle and circular loiter radius setting so it helps if the loiter radius is set correctly. The path it flies to the next course line will be based on the course tracking alignment code ... although this only happens when it's within 90 degrees of the course line bearing. |
Actually lets better check that part only with real world flights. HITL is nice and all but does not really represent a real flight in terms of nav precision with the slow sensor rates and the wonky small craft physics. I am planning on a long test session next weekend so I can put this snapshot on my altus and try it out. |
Made some improvements, the main one being increasing the update frequency for cross track error rate from 2 to 10 Hz which seems to have made a big difference. This now seems to work as originally intended based on HITL testing, tracking back to the course line quickly after turns with little or no overshoot. Still loses accuracy at very high speeds (>120 kph or so) but that's always going to be an issue with the relatively sluggish response of fixed wing roll control. Conventional aircraft should be better with a rudder to help. |
Nice one. Will test in HITL later and flash to my Altus for testing on the weekend. |
Tested in real flight just now. Can upload video later. Looks good to me for merging. |
I made a few more minor tweaks mainly to reduce a potential control oscillation you get as you approach the course line. Other than that it's definitely better than the current method. I did notice though that changing the Nav Position PIDS also makes a significant difference to how it behaves at the turns so it's a bit of a tuning nightmare really although one benefit of this improved method is it seems to be less sensitive to the |
I think whoever makes things that rely on precise path tracking should know how to fine tune the plane. Could not do another test with no compass as I failed the launch and cracked my tail boom mount :D Will try again tomorrow. If you have any further changes, commit them and I will add it to the test. |
I've tried a different method to try and improve this some more which seems to perform even better than the current changes. It even works at speeds of 180 km/h according to HITL. Oddly though it's not so good at lower speeds but this might just need some sort of speed related adjustment adding. It's simpler than the current method with less fiddle factors so definitely better if the low speed can be improved. |
New method seems a big improvement. Now working at all speeds and even managed to change |
Sounds good. I smoked my Altus yesterday.... Hope I can get more tests in the coming weekend |
Made some final changes here. Decided the cut turn addition didn't really work so removed it. Also changed the |
This was with the last commit. The plane is elevon controlled. These are all setting changes I made to the elevon plane, to help it respond faster and track better. Of which the heading controller helped the most. The average speed in the mission was 80km/h. And it has a compass. And for a comparison. The same mission was done at an earlier time with the present tracking method, using a tractor twin with differential thrust for yaw control. |
I Think we might need to look at the Preset profiles again for 8.0. I see no point in not having this ON by default. Does it have negative impacts on planes with no tail? It should only affect yaw mixes, right? |
Having the heading controller enabled for tractor twins, also makes a big improvement.. BUT if you increase the Yaw differential mixing higher that 0.5. It can snap out real bad. Especially if But as for elevon controlled planes (flying wings). I agree. |
a 0.5 Yaw diff mix would be insane anyway. I find even 0.3 is way too high due to risk of flat spin on powerful setups. on the few twins I have I never go above 0.2, usually 0.1. Especially just to get some extra yaw stabilization against wiggle. |
I assume the plane used for the test @Jetrell had some sort of yaw control ? Hard to see how setting |
No not at all. The plane is a Dolphin. The last time I tested this plane with the heading controller enabled, was back in 6.0. And it flew as bad as the first mission image I posted... And when I tested it again yesterday with your commits. I assumed it would fly well without the heading controller.. But you seen the result above. But since I haven't flown this plane with |
The SIM testing had I'm guessing setting |
I had considered that too, but I wasn't sure how that would make its turns more reactive. Plus I noticed when the plane was flying a leg slightly off the wind heading. I could see the roll trying much harder to hold the heading, than I'd encountered before. This was confirm by PID_ERROR[yaw] and likely due to me having When it comes to the two heading controllers.. The first
I would agree.. |
I tested this the other day on a T tail and flying wing. T tail motor glider was very accurate, probably better than the current method which already worked OK. The flying wing, Sonic AR 900, behaved pretty well also, better than I expected. Flew better than before with little overshoot in the turns. This wing has a low KV motor and flies pretty slowly which makes it a bit wobbly at times but it still managed to track within 2m most of the time and that was in spite of having Altitude control also mainly seemed OK with no noticeable porpoising. That was with a |
@breadoven Following up on what I mentioned last week.. I tested the Dolphin again with this build, with the heading controller enabled and the mag On and Off, with the same mission as earlier. But this day the temperature was only 4°C, with a very stiff 20km wind. The only things I could imagine that would make track/turning any better, but would be outside the scope of this PR. Would be earlier anticipation of the turn, based on virtual wind speed and direction. So the turn cut radius could be dynamic, based on the effect a tail or crosswind will have on the plane. |
I think I'll merge this since it's definitely better than the existing method. I don't think it'll ever be perfect, there are just too many things that affect how well it behaves, numerous settings and of course the wind. But it's definitely better than not using it and if you want really good accuracy use a T tail with rudder control. The last commit actually fixed a problem it's had for a while where the cross track error rate jumped about inconsistently which caused really bad roll control fluctuations in certain cases (mainly trackback where it's trying to follow closely spaced waypoints). Realised the waypoint distance wasn't being updated as frequently as the cross track error rate messing up the rate values. It now changes much more consistently which appears have improved things slightly. |
Changes the method used for waypoint tracking to try and fix issues with faster planes which causes instability. Now uses cross track error rate of change to fine tune heading adjustments giving more active control.
Testing on HITL with the flying wing shows the previous instability is gone together with better turn performance with less overshoot. Flight testing on a conventional plane also appears to perform better. Needs more testing though with other plane types to know if it's better overall than the current method.