-
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
Fixedwing porpoising effect in altitude hold modes #10305
Comments
What wing was this and do you have a log and diff file ? |
It's an Orca V2. Here is the Diff. |
i also had really bad pitch oscillations in alt hold modes. turning i gain down helped then it flew sloppy |
It would be useful to have a 7.0 Diff and an 8.0 Diff so the PIDS for the altitude control changes in 8.0 can be better tuned. And as mentioned above a log would be most useful to better understand what's happening. |
set your Logging rate to 3% only. Thats sufficient for most things to analyze. Everything above 250Hz (or 25%) can be problematic on some SD cards. btw your loop time is not in the diff. That means it is on firmware default and that should be 2khz. This is too much fur a wing and means that with your 25% log rate right now it logs at 500Hz. Definitely problematic with SD logging. |
Have you noticed these same problems @b14ckyy ? The PIDS for #9471 were never fully optimised other than basic tweaking to avoid an instability with the original settings. They work fine for me for a conventional plane, certainly not obviously worse than the previous position based altitude control method. I'm guessing it's more likely to cause problems with flying wings which tend to be sluggish in pitch response. I imagine it would be beneficial to add in PID FF, should improve responsiveness, so I'll do that and see if it improves things. |
@breadoven Besides @b14ckyy Thanks for the heads up. I'm aware that lower speed logging often works better. But I still experience log corruption on most of my flight controllers. Not always, but regular enough to say its frustrating. |
I have had altitude hold problems in different ways indeed but no constant dolphining. The worst issues I have is with HITL actually as in waypoint missions the plane really struggles to climb to the target altitude and sometimes even loses altitude despite being already below. This only then recovers when getting closer to the target WP. But my HITL plane tune is a mess in general and I wanted to redo that from scratch before going into that further. As I have to rebuild the Altus anyway after my recent crash I will set it up with 8.0 from scratch and see how it behaves. It was well behaving in 7.1 with just the basic tuning (Autotune, Angle trim, P2T and bank angles. @rts18 can you please open another issue ticket for the corrupted logs with the same info. Also please post a dump (and not a diff) from the affected craft, some of the corrupt logs and the SD card models you tested? Its something that should be tracked and noted. |
After testing on HITL I get the impression altitude control is possibly best with lower P, higher I and turn up However, this is just based on HITL testing which I'm not convinced is great when it comes to accurately simulating dynamic stability so take the above as a rough guide. |
I agree. the sim is useful. But its flight dynamics leave a bit to be desired, when comparing to many real models. I found that increasing
The Velocity controller certainly appears to react more responsively to a call to change altitude, and to halt at the target. But it seems to have issues maintaining the target window under certain conditions. |
There isn't really that much difference between using velocity and using position as far as the PID controller is concerned. It effectively just looked at the error between desired and actual position before and now looks at desired and actual velocity. However, the desired velocity is just based on: position error * Or ... 0.2 * position error if So it is using a smaller error to work with. However, checking the previous position based code again I'd forgotten that the inputs used by the PID controller, desired and actual energies, were effectively just the positions factored down by around 10. This 10 figure is gravity / 100, gravity in m/s2 and the 100 to convert centimetres to metres, to give you potential energy (ignoring the mass). I compensated for this by reducing the PID setting factors for P, I and D by 10 (they were previously factored down by 10 so are now factored down by 100). So the working error is smaller around the control point with the velocity based control which could explain the poorer response in some cases (possibly made worse by estimated velocity being less accurate than estimated position ?). However, I'm also thinking that factoring down the PID settings probably isn't the same as factoring down the actual error inputs to the PID controller so maybe this should be changed to make it the same as the previous position based control. I also changed the D term calculation from using measurement to error which is a significant difference given measurement tracking appears to link D term to whether or not you're climbing or descending rather than the altitude error itself increasing or decreasing (which seems more relevant ?). However, this could be changed back to see if it improves things. |
I will this time set up a plane from scratch and see how it behaves. Probably testing tomorrow after my Altus is repaired |
That is interesting. Because I'd noticed with the Pos controller, that elevator up was applied in the crosswind quarter of the loiter circuit, before it would turn to the downwind quarter. Which seemed to help it hold altitude with the tail wind.
I would agree with that line of thought.
From looking over the logs again. The times altitude oscillations are most noticed, when comparing the Vel with the Pos controller. Is after the airplane makes a turn, and looses altitude. And that especially if the turn takes it on a downwind heading. |
@breadoven I will close this now. Your change in #10334 has made some improvement. However I still feel it would be beneficial to lower the default velocity controller gains across all fixedwing platforms. |
Was the problem you had before with loss of accuracy mainly during WP missions or in all modes, Cruise etc ? #10334 was a definite bug but would only have improved WP missions, not other modes. I am working on trying to improve the PID tuning side of things, just haven't had much time to test stuff for real due to various reasons, mainly crappy weather. It's probably better to adjust the PID correction factors to make the current default PID settings work better as they are. I've also tried adding a filter on the vertical velocity input which seems to improve things. There's also the possibility of adding an FF PID term but from HITL testing I'm not sure it makes that much difference. I'll do a PR for these changes so others can test and see if they help. |
It was noticeable in Cruise mode. But I observed it more often in missions that had altitude setpoint changes throughout. |
@rts18 Any chance of posting some Diffs for various airframe types, would be useful for optimising the current default PID settings. Really just after the |
@breadoven I left some settings in the first post. But that was before you made the linear climb revert. The present default presets for the To negate a long winded explanation. I also found the settings you posted to work optimally across most of the aircraft I flew. I found
We've found it to cause altitude target overshoot and the occasional oscillation on some airframes if pushed beyond 28 with the aforementioned climb rate. But I haven't exhaustively tested it because it can't be adjusted in-flight like the velocity PIDs. |
I ran tests using 8.0 from the master. And encountered a porpoising or dolphin effect in all modes that hold altitude.
I proceeded to run auto level trim and altered pitch2throttle related settings, showing no difference. I did not expect anything to change, as this aircraft was already tuned with 7.1.2.
I later reduced
nav_fw_pos_z_p = 29
and increasednav_fw_pos_z_i = 8
. This appears to have removed the effect. However it does not appear to track altitude as well as the previous release.It reaches the target altitude and slows down correctly with the adjustment of an apparent new setting
nav_fw_alt_control_response
. However there is more drift either side of the setpoint altitude, than while using 7.1.2.The text was updated successfully, but these errors were encountered: