Howto:Implement pushback: Difference between revisions

Jump to navigation Jump to search
Syntax highlighting
m (→‎Systems/pushback.xml: <output> is needed)
(Syntax highlighting)
Line 6: Line 6:


'''Please note: this system does not work over a [[Howto: Multiplayer|multiplay]] network.'''
'''Please note: this system does not work over a [[Howto: Multiplayer|multiplay]] network.'''


== For JSBSim ==
== For JSBSim ==
=== Systems/pushback.xml ===
=== Systems/pushback.xml ===
Create the following directory, if not present <tt>[[$FG ROOT]]/Aircraft/.../Systems</tt> and create a file named pushback.xml with the following content:
Create the following directory, if not present <tt>[[$FG ROOT]]/Aircraft/.../Systems</tt> and create a file named pushback.xml with the following content:
Line 71: Line 68:
  </system>
  </system>
</syntaxhighlight>
</syntaxhighlight>
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.
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.


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


<syntaxhighlight lang="xml">
   <system file="pushback"/>
   <system file="pushback"/>
</syntaxhighlight>


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).
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).


<syntaxhighlight lang="xml">
  <external_reactions>
  <external_reactions>
   
   
Line 96: Line 97:
   
   
  </external_reactions>
  </external_reactions>
</syntaxhighlight>


=== -set.xml ===
=== -set.xml ===
Between the <model> tags in the -set.xml file add the definitions for the speed-hold controller:
Between the <model> tags in the -set.xml file add the definitions for the speed-hold controller:
<syntaxhighlight lang="xml">
  <model>
  <model>
   <pushback>
   <pushback>
Line 107: Line 110:
   </pushback>
   </pushback>
  </model>
  </model>
</syntaxhighlight>
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 values for kp, ki and kd control how the cruise control reacts and may be adjusted depending on the mass of the aircraft.


Line 113: Line 118:
Below the </sim> tag, we add our [[Menubar|menu]] dialog. A generic one is available at <tt>$FG_ROOT/gui/Dialogs/pushback.xml</tt>. 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.
Below the </sim> tag, we add our [[Menubar|menu]] dialog. A generic one is available at <tt>$FG_ROOT/gui/Dialogs/pushback.xml</tt>. 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.


<syntaxhighlight lang="xml">
  <menubar>
  <menubar>
   <default>
   <default>
Line 129: Line 135:
   </default>
   </default>
  </menubar>
  </menubar>
</syntaxhighlight>


=== Models/ .xml ===
=== Models/ .xml ===
Line 138: Line 145:
Both models can be found in the <tt>$FG_ROOT/Models/Airport/Pushback</tt> directory. The following example uses the Goldhofert, but by changing the path to Military.xml the military truck can be implented.
Both models can be found in the <tt>$FG_ROOT/Models/Airport/Pushback</tt> directory. The following example uses the Goldhofert, but by changing the path to Military.xml the military truck can be implented.


<syntaxhighlight lang="xml">
  <model>
  <model>
   <name>Pushback</name>
   <name>Pushback</name>
Line 147: Line 155:
   </offsets>
   </offsets>
  </model>
  </model>
 
</syntaxhighlight>


== For YASim ==
== For YASim ==
For YASim we have to fake the external forces with the thruster. A thruster in YASim is a very simple "thrust only" engine object which not consume any fuel etc.
For YASim we have to fake the external forces with the thruster. A thruster in YASim is a very simple "thrust only" engine object which not consume any fuel etc.


=== .xml (FDM) ===
=== .xml (FDM) ===
So we add this following lines to our yasim.xml:
So we add this following lines to our yasim.xml:
<syntaxhighlight lang="xml">
   <thruster x="19.246"  y="0.00" z="-2.7" vx="1" vy="0" vz="0" thrust="20000">
   <thruster x="19.246"  y="0.00" z="-2.7" vx="1" vy="0" vz="0" thrust="20000">
   <control-input axis="/sim/model/pushback/target-speed-fps" control="THROTTLE" src0="-1" src1="1" dst0="-1" dst1="1"/>
   <control-input axis="/sim/model/pushback/target-speed-fps" control="THROTTLE" src0="-1" src1="1" dst0="-1" dst1="1"/>
   </thruster>
   </thruster>
</syntaxhighlight>


For the coordinates use the same like the ccordinates of the Nosegear. The thrust itself is in lbs- don't set it too high! 1/3 of the of the aircraft's empty mass should be enough!
For the coordinates use the same like the ccordinates of the Nosegear. The thrust itself is in lbs- don't set it too high! 1/3 of the of the aircraft's empty mass should be enough!
Line 163: Line 172:
Then we just have to add our [[Menubar|menu]] dialog. A generic one is available at <tt>$FG_ROOT/gui/Dialogs/pushback.xml</tt>. 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.
Then we just have to add our [[Menubar|menu]] dialog. A generic one is available at <tt>$FG_ROOT/gui/Dialogs/pushback.xml</tt>. 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.


<syntaxhighlight lang="xml">
  <menubar>
  <menubar>
   <default>
   <default>
Line 179: Line 189:
   </default>
   </default>
  </menubar>
  </menubar>
</syntaxhighlight>


=== Models/ .xml ===
=== Models/ .xml ===
And like in JSBSim, 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).
And like in JSBSim, 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).


<syntaxhighlight lang="xml">
  <model>
  <model>
   <name>Pushback</name>
   <name>Pushback</name>
Line 192: Line 204:
   </offsets>
   </offsets>
  </model>
  </model>
</syntaxhighlight>


Note: If the aircraft author didn't use gear/gear[0]/steering-norm for ground steering, the pushback model won't be turn with the nosegear  
Note: If the aircraft author didn't use gear/gear[0]/steering-norm for ground steering, the pushback model won't be turn with the nosegear  

Navigation menu