A new version is out. Get it [ame="http://www.orbithangar.com/searchid.php?ID=2802"]here[/ame].
New features are:
- Autopilot: added pitch programme individual for each vessel and for each planet
- Autopilot: support for roll program and for upside down flying vessels, like the Space Shuttle
- Autopilot: PID values can be adjusted in a running simulation
- Bugfix: the AP wouldn't work when the engines were started outside cockpit
Let me copy & paste changes made to the manual:
HOT! PID autopilot manual configuration
The PID autopilot is as universal as possible, meaning that its values are configured only once for DeltaGlider and hardcoded. For each different ship class, there's a calculation performed, which compares the current vessel's angular accelerations and compares them to that of the DG. This ratio lets the PID increase or decrease its values, so the AP works on the same settings.
If however they don't work, there's a possibility of defining the PID values by hand for each vessel class. The values can be adjusted in a running simulation with
[Shift 1] for X & Y axes and
[Shift 2] for bank. Both types have to be adjusted for atmospheric and space PIDs. The currently used PID is displayed on the bottom of main MFD page. The same PID type would be adjusted in the moment of pressing
[Shift 1] or
[Shift 2].
Once you are satisfied with your values, you'll be interested in saving them in a config file, so that they can take effect after you restart the simulation. The PID definitions are searched for in
Config\MFD\LaunchMFD\ directory. The exact config file name can be obtained through the PID tuning input box with
[Shift 1]. Exactly the same file with the same path need to be created. Therefore, sometimes creating a subdirectory may be necessary.
The available and read tags and their expected data are:
[FONT=Nimbus Mono L, monospace]SPACE_XY = (vector) [/FONT]
[FONT=Nimbus Mono L, monospace]SPACE_BANK = (vector) [/FONT]
[FONT=Nimbus Mono L, monospace]ATMO_XY = (vector) [/FONT]
[FONT=Nimbus Mono L, monospace]ATMO_BANK = (vector) [/FONT]
[FONT=Nimbus Mono L, monospace]ATMO_CONTINUOUS_CONTROL_SWITCH_ANGLE = (float) [/FONT]
[FONT=Nimbus Mono L, monospace]ATMO_BANK_TARGET_WINGS_LEVEL_SWITCH_ANGLE = (float)[/FONT]
A vector consists of three space separated floating point values, while float is one floating point value. The vectors' are used to pass PIDs' values - proportional gain, or Kp, derivative gain, or Kd, and integral gain, or Ki.
[FONT=Nimbus Mono L, monospace]SPACE_XY[/FONT] and [FONT=Nimbus Mono L, monospace]SPACE_BANK[/FONT] PIDs are used for X and Y axes control as well as bank control, correspondingly. Both in space. The same philosophy is used for atmospheric autopilot.
[FONT=Nimbus Mono L, monospace]ATMO_CONTINUOUS_CONTROL_SWITCH_ANGLE[/FONT] is an angle in degrees, for which the PID AP switches on, and brings its smooth control. Beyond that angle, the RCS and control surfaces work with full power, because only such behaviour makes sense for winged craft. Increasing value of this variable increases the spectrum of angles, in which the AP works in its whole scale, this means that it's function of power( distance ) will be stretched on this distance. For non winged craft it makes less sense to limit the continuous control spectrum, because they are already pitched to 90°, so reaching the target attitude wouldn't take much time. To disable the limit completely, a value of 180 degrees must be chosen, because the maximal angular distance is in range (-180°, 180°). Such setting would also eliminate a visible sudden jump in control when switching from atmospheric PID to space PID.
[FONT=Nimbus Mono L, monospace]ATMO_BANK_TARGET_WINGS_LEVEL_SWITCH_ANGLE[/FONT] is an angle in degrees, for which the AP changes its bank from target marker to wings level. Before that, it tries obtain such bank, that the target marker remains directly above the ship, so that it can reach it much quicker by pitching, rather than yawing later on.
A typical definition for the DeltaGlider would be:
[FONT=Nimbus Mono L, monospace]SPACE_XY = 2.5 16.0 0 [/FONT]
[FONT=Nimbus Mono L, monospace]SPACE_BANK = 1.0 12.0 0 [/FONT]
[FONT=Nimbus Mono L, monospace]ATMO_XY = 2.0 2.5 0 [/FONT]
[FONT=Nimbus Mono L, monospace]ATMO_BANK = 3.0 6.0 0 [/FONT]
[FONT=Nimbus Mono L, monospace]ATMO_CONTINUOUS_CONTROL_SWITCH_ANGLE = 10.0 [/FONT]
[FONT=Nimbus Mono L, monospace]ATMO_BANK_TARGET_WINGS_LEVEL_SWITCH_ANGLE = 20.0[/FONT]
Shift 1 = tune atmo/space PID for X & Y axes
Shift 2 = tune atmo/space PID for bank
HOT!Pitch program
In case the default PEG algorithm's pitch guidance doesn't suit you well, as it probably won't in cases other than in winged craft, you can override it by defining your own pitch program in the same config file where you place your PID definitions. An exemplary pitch program could look like the following:
[FONT=Nimbus Mono L, monospace]
PITCH_PROGRAM[/FONT]
[FONT=Nimbus Mono L, monospace]
Earth[/FONT]
[FONT=Nimbus Mono L, monospace]
0 90[/FONT]
[FONT=Nimbus Mono L, monospace]
10.5 80[/FONT]
[FONT=Nimbus Mono L, monospace]
22.7 75.8[/FONT]
[FONT=Nimbus Mono L, monospace]
40 45[/FONT]
[FONT=Nimbus Mono L, monospace]
60 30[/FONT]
[FONT=Nimbus Mono L, monospace]
END_PITCH_PROGRAM[/FONT]
The first column denotes altitude (argument), while the second column denotes the according pitch (value). The values for arguments between the designated altitudes are linearly interpolated. Therefore if you need a more precise and oval pitch profile, you need to increase the granularity, by inserting more altitude-pitch pairs.
For each planet, defined by the first line of the programme, there can be one pitch program defined. They should be placed in the same file with their own start and end markers, for example:
[FONT=Nimbus Mono L, monospace]
PITCH_PROGRAM[/FONT]
[FONT=Nimbus Mono L, monospace]
Earth[/FONT]
[FONT=Nimbus Mono L, monospace]
0 90[/FONT]
[FONT=Nimbus Mono L, monospace]
10.5 80[/FONT]
[FONT=Nimbus Mono L, monospace]
22.7 75.8[/FONT]
[FONT=Nimbus Mono L, monospace]
40 45[/FONT]
[FONT=Nimbus Mono L, monospace]
60 30[/FONT]
[FONT=Nimbus Mono L, monospace]
END_PITCH_PROGRAM[/FONT]
[FONT=Nimbus Mono L, monospace]
PITCH_PROGRAM[/FONT]
[FONT=Nimbus Mono L, monospace]
Mars[/FONT]
[FONT=Nimbus Mono L, monospace]
0 90[/FONT]
[FONT=Nimbus Mono L, monospace]
15 70[/FONT]
[FONT=Nimbus Mono L, monospace]
30 50[/FONT]
[FONT=Nimbus Mono L, monospace]
40 35[/FONT]
[FONT=Nimbus Mono L, monospace]
END_PITCH_PROGRAM[/FONT]
If no planet name has been chosen, Earth is assumed by default.
If you are able to fine tune a spacecraft's pitch programme, then please share your work in
this thread on Orbiter-Forum.
HOT! Roll program
There are two additional configuration boolean switches available for each craft: [FONT=Nimbus Mono L, monospace]ROLL_NEEDED[/FONT] and [FONT=Nimbus Mono L, monospace]UPSIDE_DOWN[/FONT]. The first one tells the AP, that roll should be performed right after launch, and the second one tells that the craft should ascend in an upside down manner, such as the Space Shuttle. Also, [FONT=Nimbus Mono L, monospace]UPSIDE_DOWN[/FONT] implies [FONT=Nimbus Mono L, monospace]ROLL_NEEDED[/FONT], so an entry in Shuttle Atlantis config file could look like the following:
[FONT=Nimbus Mono L, monospace]UPSIDE_DOWN = TRUE[/FONT]
[FONT=Times New Roman, serif]Currently, the roll is performed after the craft reaches a pitch of 88.5 degrees or below, because only then the AP can be sure in which direction to roll.[/FONT]