2,561
edits
m (fixing some typos) |
|||
Line 1: | Line 1: | ||
Flightgear Autopilot is a modular system based on PID controllers. Here are some tips to help | The Flightgear Autopilot is a modular system based on PID controllers. Here are some tips to help tuning such a controller. There is lot of documentation all over the Internet about how to tune the parameters, having this you will have to figure out how the Flightgear PID controller implementation works. | ||
First of all, have a look at the code where you will see the algorithm wich is used for our autopilot. | First of all, have a look at the code where you will see the algorithm wich is used for our autopilot. Checking existing autopilot configurations in Flightgear aircraft will also help. | ||
There is actually a doc about filters in Flightgear documentation. Filters can be applied on input or ouput values, in other words, before and after the PID controller. | There is actually a doc about filters in Flightgear documentation. Filters can be applied on input or ouput values, in other words, before and after the PID controller (execution). | ||
=== FlightGear PID | === FlightGear PID Controller === | ||
Knowing the algorithm is mandatory, certain values are forbidden, for example they can lead to a division by zero. Then you will have to understand where the parameters apply to act on the choosen correction module. See the schema wich is a good reminder while doing the tests. | Knowing the algorithm is mandatory, certain values are forbidden, for example they can lead to a division by zero. Then you will have to understand where the parameters apply to act on the choosen correction module. See the schema wich is a good reminder while doing the tests. | ||
Line 15: | Line 15: | ||
=== Getting graphs of Controler action === | === Getting graphs of Controler action === | ||
While it's possible to tune a PID controller by testing directly the aircraft behaviour under the autopilot control, it can be really | While it's possible to tune a PID controller by testing directly the aircraft behaviour under the autopilot control, it can be really useful to get everything in graphical view. | ||
[[Image:pid_cotroler_data_graph.png|thumb|Datas of an Auto-trim PID Controler displayed as graphs]] | [[Image:pid_cotroler_data_graph.png|thumb|Datas of an Auto-trim PID Controler displayed as graphs]] | ||
First of all you'll have to turn the PID | First of all you'll have to turn the PID Controller's debug mode on. That is in the autopilot.xml you are working on. (I didn't try to turn on more than one PID controller's debugging support at the same time). | ||
Then you will get 6 new values displayed on the console at each FG loop. You will need to catch them and format the values in one line. Here is an exemple of a parser script written in Perl: | Then you will get 6 new values displayed on the console at each FG loop. You will need to catch them and format the values in one line. Here is an exemple of a parser script written in Perl: |
edits