3 ms·
I wrote a super basic 2 axis "autopilot" with Python for X-Plane. The concepts are super simple. Getting the controller tuned properly is not. For a surprising
by auspiv 3y ago
I wrote a super basic 2 axis "autopilot" with Python for X-Plane. The concepts are super simple. Getting the controller tuned properly is not.
For a surprisingly large number cases, setting a P value in the 1-3 range and a I value as P/10 works extremely well.
I now write Python for my day job. This code was written before that and now that I look at it, it is quite ugly:
https://austinsnerdythings.com/2021/10/19/coding-a-wing-leveler-autopilot-in-x-plane-with-python/ https://austinsnerdythings.com/2021/10/19/coding-a-wing-leve...
A different part of my day job includes, tangentially, tuning PID control parameters for 200-500 HP electric submersible pumps in oil wells. Again, it is amazing how setting an P value in the 1-3 range and an I value P/10 works there as well.
A slightly more advanced autopilot with altitude set and hold (code is even more ugly):
https://austinsnerdythings.com/2021/12/06/coding-a-pitch-roll-altitude-autopilot-in-x-plane-with-python/ https://austinsnerdythings.com/2021/12/06/coding-a-pitch-rol...
- hexane360 3y agoDoes that rule-of-thumb assume specific units/value ranges for the input and output signals?
- belzebalex 3y agoYes it does, you have to manipulate the expression to make it adimensional. But this rule-of-thumb is only valid for systems whose response time is less than 500ms.
- TheRealPomax 3y agoWriting your PID controller is a few minutes work. Tuning your PID controller is a day job. Most people just don't actually make it their day job =D