Howto:Implement pushback

From FlightGear wiki
Revision as of 07:48, 6 May 2009 by T3r (Talk | contribs) (New pushback implementation with cruise control)

Jump to: navigation, search
A KLM Boeing 747-400 ready for pushback at EHAM. This is the Goldhofert truck.

Currently, pushback is only used on JSBSim planes. It should be possible with YASim aswell, but it has never be done yet.

Please note: this system does not work over a multiplay network.


Create the following directory, if not present $FG_ROOT/Aircraft/.../Systems and create a file named pushback.xml with the following content:

<?xml version='1.0' encoding='UTF-8' ?>
<system name="pushback">
 <channel name="Pushback">

   <switch name="systems/pushback/linked">
     <default value="-1"/>
     <test value="0">
       /sim/model/pushback/position-norm gt 0.95
       /gear/gear/wow == 1
       gear/unit[0]/wheel-speed-fps lt 50

   <summer name="systems/pushback/speed-error">

   <pid name="systems/pushback/force">

   <switch name="systems/pushback/output">
     <default value="0"/>
     <test value="systems/pushback/force">
       systems/pushback/linked == 0


This is the "cruise control" for the pushback truck. You define the cruise speed at the dialog and the controller varies the external force in a way that the actual speed matches your given value. The working horses here are the summer, which compares actual and reference speed, and the PID controller which calculates the resulting force. A basic description is: "the more actual and reference speed differ, the more force is applied (kp) plus the more time passes until the reference speed is reached, the more force is applied (ki)". The switches check, if the pushback truck is actually linked to the aircraft.

.xml (FDM)

After the </propulsion> tag we add a reference to the pushback system:

 <system file="pushback"/>

And at the end of the FDM, the following is needed to attach the forces of the pushback to the aircraft. The location should be somewhere near the nose wheel of the aircraft (where the pushback truck is connected).


 <force name="pushback" frame="BODY">
  <location unit="IN">
   <x>  -139 </x>
   <y>    0.0 </y>
   <z>  -71.0 </z>



Between the <model> tags in the -set.xml file add the definitions for the speed-hold controller:

  <kp type="double">100</kp>
  <ki type="double">25</ki>
  <kd type="double">0</kd>
  <position-norm type="double">0</position-norm>

The values for kp, ki and kd control how the cruise control reacts and may be adjusted depending on the mass of the aircraft. The pushback dialog allows changing of these properties at runtime. Note: if the model tags are already there, you do no need to add them again. Just place the stuff between them. If you want the truck to be connected on startup, position-norm to 1.

Below the </sim> tag, we add our menu dialog. A generic one is available at $FG_ROOT/gui/Dialogs/pushback.xml. Add the following lines to include it in the Equipment menu of the aircraft. Note: if the menubar and default tags are already there, you do no need to add them again. Just place the stuff between them.

  <menu n="5">
   <item n="10">


Models/ .xml

In your planes model file, we add a reference to one of the generic pushback models, or a custom made truck, shipped with your plane. Edit the offsets to fit your plane; the z offset should be at ground level, while the x offset is at the nosewheel(center).