8,805
edits
m (fixing some typos) |
m (wiki cleanup) |
||
Line 1: | Line 1: | ||
The | 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. Checking existing autopilot configurations in Flightgear aircraft will also help. | 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. | ||
Line 6: | Line 6: | ||
=== FlightGear PID Controller === | === 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. | ||
[[Image:pid_controler.png|thumb|PID parameter's application]] | [[Image:pid_controler.png|thumb|PID parameter's application]] | ||
[[Image:pid_cotroler_data_graph.png|thumb|Datas of an Auto-trim PID Controler displayed as graphs]] | |||
You can find good explanations on how to practically tune the controller. [http://en.wikipedia.org/wiki/PID_controller Wikipedia's article on the PID Controler] | You can find good explanations on how to practically tune the controller. [http://en.wikipedia.org/wiki/PID_controller Wikipedia's article on the PID Controler] | ||
=== 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 useful to get everything in graphical view. | 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. | ||
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). | 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). | ||
Line 24: | Line 21: | ||
<pre> | <pre> | ||
#!/usr/bin/perl -w | #!/usr/bin/perl -w | ||
# prints: "input reference P I D output" | # prints: "input reference P I D output" | ||
Line 37: | Line 33: | ||
} | } | ||
} | } | ||
</pre> | </pre> | ||
Line 43: | Line 38: | ||
<pre> | <pre> | ||
alexis@linear:~/fgfs$ /usr/local/bin/fgfs 2>&1 | ./PIDcontroler_parser.pl > my_file | alexis@linear:~/fgfs$ /usr/local/bin/fgfs 2>&1 | ./PIDcontroler_parser.pl > my_file | ||
</pre> | </pre> | ||
If you use Linux, You can run Kst simultaneously to read the datas on the fly and watch them displayed together in real time while testing the aircraft. | If you use Linux, You can run Kst simultaneously to read the datas on the fly and watch them displayed together in real time while testing the aircraft. | ||
* [http://kst.kde.org/ Kst, real-time large-dataset viewing and plotting tool] | |||
[http://kst.kde.org/ Kst, real-time large-dataset viewing and plotting tool] | |||
== Alternative Method == | == Alternative Method == |