## Space Shuttle - TAEM original guidance simulation

Discussion about development and usage of spacecraft

### Space Shuttle - TAEM original guidance simulation

A topic speaking about the work I am doing about TAEM and Autoland original guidances to not overload the main dev topic with that long term goal.

Documentations

*Space Shuttle TAEM guidance code sum up: https://ntrs.nasa.gov/citations/19920010688
*TAEM/Approach Handbooks there: https://forum.flightgear.org/viewtopic.php?f=87&t=38777

Overview

The last link mentionned above is pretty interesting to see the evolution of TAEM guidance and how it was handled.
The main document I used include the Optional TAEM Targeting (OTT) logic that has been used since STS-5 (before the HAC was a circle with less Energy options for test flights).

After STS-5, HAC could be flown with the different options we are used to see .
Overhead or Straight-In HAC; and Nominal Entry Point (7Nm in final) or Minimal Entry Point (4Nm in final)

Another option called - final radius shrinking - is included in that TAEM guidance version.
It allows the final HAC radius (2.3 Nm) to decrease up to 0.8 Nm if we are low during the HAC

The whole logic is organized through several functions that are called during all the TAEM phase at a rate between 160 and 980ms.
It ends at 10000 feet (Approach and Landing interface) where the Auto Land logic kicks in ( quite the same logic with tighter gains).

Let's go briefly through each functions.
The first function that is not mentionned is a frame coordinate converter from a Greenwhich frame into a runway centered frame.

1) TGXHAC

It is the initial TAEM computation where the HAC is defined following what we choose in the Spec 50 display (Runway / Overhead or Straight-In / NEP or MEP / etc)
Aim point is also taken into account (7500 feet or 6500 feet)

Another important factor that is calculated there is the Final Glideslope value for the A/L final path (starting at 10000 feet / 6Nm)
It can be either 18° for a heavy weight (more than 220000 lbs) or 20° for a lighter Shuttle.
That was changed later in the STS program to take into account the nominal mid-value for Speedbrake effectiveness ( 65° ).
That slope combination was then choosen.

In the dev branch, we can clearly see it now at Approach/Landing Interface in the HUD and PFD glideslope deviation.
Left HUD for Heavy / Right for Light

2) GTP (Ground Track Computations)

The distance to the runway is computed in that function.

*Left and Center Picture (Before and into the HAC): The range to go is the sum of the distance to be flown while aligning with the HAC entry point(ARCAC), the distance to be flown to that tangent WP1 (RTAN), the distance to be flown into the HAC up to the threshold (RPRED2)
*Right picture: Once close enough to the final runway course, distance forecasted becomes a direct distance to the runway threshold.

3) TGCOMP (General Computations)

All the computations for reference parameters are done there.

*The Altitude reference
A mix between linear and cubic segments.
Up to 40 Nmish in blue, a low slope linear profile ( 6° ish of slope)
Between A/L interface ( 6Nm) and 40 Nm, the green cubic segment where the slope increases up to the final Gamma targeted (18/20°)
At A/L interface, the red linear segment for final slope.

*The Specific Energy reference
That allows to shape the Nominal Energy path based on the True Airspeed and Altitude.
S-turn / Nominal / Low Energy boundaries.

Left picture is the Energy lines I took as a reference (closer to the latest Energy profiles flown in the later part of STS program )
Right picture shows that those lines are "just" some linear functions with some breakpoints here and there.

*Dynamic Pressure Reference Profile
It is basically the EAS targeted.

I adjusted it also to be closer to the latest QBAR profile flown (a tad higher, 305 psf targeted at A/L ie. 300 kts instead of 275 kts)
It will be coherent with the EAS visible in the Vert Traj display.

4) TGTRAN ( Transition between TAEM phases)

Here is handled the boundaries between the different part of the TAEM and Autoland ( Acquisition / HAC / Pre final / Outer Glide Slope / etc )
It works like a big Lego, and it will be easy for example to link it later to the RTLS logic with the phases 4 for 6.

The S-Turns are also commanded in that function for example.
A sanity check is done to turn away from the HAC. Once the Total Energy is closed to the Nominal One, IPHASE 0 is exited and we go back to the Acquisition logic (IPHASE 1)

5) TGNZC ( Nz Commanded)

The output for the Pitch AP is done there, under the form of a Radial Acceleration that will be converted later on to a Pitch Rate and sent into the AP loop.
All the functions calculated in the TGCOMP will be used there to limit that commanded Nz (NZC).
MIDVALUE function is like a Nasal clamp function.

The first NZC computed is for the altitude error, then it goes through an Energy error check, then QBAR, and finally a Max Nz filter to clamp the NZC between -0.5 g and +0.5g.

An example.
If we are low: positive NZC computed to Pitch Up and come back to the reference altitude.
If we are high on energy, a less positive NZC is then outputted to not go too high on energy.
If we are too close to QBAR boundaries, NZC is adjusted to stay away from a hazardous aerodynamical pressure condition.
Finaly, if we are approaching the max radial G's tolerated, the NZC is limited again to avoid breaking the wings.

A quite strong and intricated pitch command loop.

6) TGSBC (Speedbraked Commanded)

It handles the SB logic.
SB setting is fixed to 65° until Subsonic.
In Subsonic, position commanded is a function of reference Energy and Qbar errors until final where the logic is blended into a QBAR error only up to 3000 feet.
From there,a fix setting is commanded for Pre-Flare ( Highlighted in the second page there: https://forum.flightgear.org/viewtopic.php?f=87&t=38777&start=15).

7)TGPHIC (Bank commanded)

Here is done the bank commanded sent to the AP.
It depends on the Phase we are in.

From Left to Right.
*IPHASE 0 (S-turn): A constant bank is commanded away from the HAC
*IPHASE 1 (HAC acquisition): A bank proportionnal to the delta azimuth (DPSAC) with the WP1 is commanded (2.5 * delta azimuth)
*IPHASE 2 (In HAC): A bank proportionnal to the the HAC cross range and radial velocity is commanded.
*IPHASE 3 (Pre Final): A bank proportionnal to the final axis cross range / cross range variation /cross range integral is commanded.

For the Autoland phases , it is similar to the Pre Final with different Gains.

Last edited by GinGin on Fri May 14, 2021 12:17 pm, edited 4 times in total.
GinGin

Posts: 1526
Joined: Wed Jul 05, 2017 10:41 am
Location: Paris
Callsign: Gingin

### Re: Space Shuttle - TAEM orginal code emulation

Today's commit concerned all the functions mentionned above except the Pitch Channel (still driven by the difference in vertical speed for now) and the Speedbrake channel.
Manual speedbrake will be necessary until Approach and Landing interface.

I will push soon the new function for it and a correction to the SB FDM L/D ratio.
Wind datas tunnel that I used for the SB L/D don't have the same SB neutral position (25°) that the one used by Dilao and Fonseca for their Cd/Cl parametrization that we use below Mach 4 ( fully closed).
For now, I pushed a proportionnal adjustement factor that will work well with the nominal AOA green band.

Also, the AutoLand function works nicely for the Roll channel up to the touchdown and for the Pitch channel up to the Pre-Flare at 2000 feet ( I will extend it up to the full landing once the NZ commanded function will be finished).
It is quite fun to do some Cat I Shuttle Landing in Auto.

GinGin

Posts: 1526
Joined: Wed Jul 05, 2017 10:41 am
Location: Paris
Callsign: Gingin

### Re: Space Shuttle - TAEM original code emulation

I pushed a commit which is mainly about the Speedbrake function explained above: TGSBC
It brings back the Automatic Speedbrake modulation.
That replicates with a great accuracy the original Speedbrake logic. Fix setting above Mach 1 (65°) and Energy/Qbar modulation in Subsonic.
Once in final, Speedbrake will control the EAS error (300 kt targeted on Outer Glide Slope).

Small interesting points

*Function takes into account the rate limitation depending on the number of hydraulic systems operational.
If more than one system is op, SB opening rate is 5°/s and closing rate is 10°/s
If just one system is op, SB opening and closing rate is 5°/S

*At 3000 feet, there is a first SB retract that takes into account many parameters explained page 2 of that topic: https://forum.flightgear.org/viewtopic.php?f=87&t=38777&start=15
The complete logic page 73 (4-4) of that Handbook: https://gandalfddi.z19.web.core.windows.net/Shuttle/JSC-23266%20-%20Approach,%20Landing%20and%20Rollout%20Flight%20Procedures%20Handbook%20-%20Rev%20B%20200505.pdf
I have added another parameter since then, the Altitude Density variation which is a function of the ISA deviation.
High ISA deviation leads to a thiner atmoshpere and a longer flare forecasted, hence a higher SB setting to avoid that over energy situation (and Vice-Versa).

An example there with an ISA deviation of 30 °.
Density altitude is 6129 feet and pressure one is 2264 feet (120ft in addition for every degrees above ISA)
That gives a SB retract of 28° instead of 15° with ISA 0

*At 500 feet, the windshift between 3000 and 500 feet is taken into account to adjust one last time the SB position.
That is useful in case of gusty conditions with some late wind changes close to the ground.

An example with a stormy and gusty day (up to 30kt).
We lost 15 kt of effective wind since we have past 3000 feet AGL. That is some additional tailwind then and the SB will retract from 23 to 15° to take into account that sudden loss of lift caused by the windshear in order to avoid a hazardous sink rate.

GinGin

Posts: 1526
Joined: Wed Jul 05, 2017 10:41 am
Location: Paris
Callsign: Gingin

### Re: Space Shuttle - TAEM original guidance simulation

New commits about Pitch channel and guidance logic that allow a fairly accurate simulation of Autoland logic (starting at 10000 feet when TAEM is finished).

1)Pitch channel

The TAEM pitch command loop is based on a commanded radial acceleration (NZC) converted into a pitch rate which is sent to the AP loop for the correct elevon deflection.
Gains and refresh rate depends on TAEM and Autoland phases.
Everything is filtered several times to have some stable outputs.

*Delta Nz commanded is based on the altitude and altitude rate error ( glidepath deviation).
*It goes then through an Energy filter to avoid to be too high or low on energy ( right ladder on MM 305)
*Next filter is a dynamic pressure one to avoid over/underspeed situations.
*Last filter is a Pitch Nz limit (0.5 g) to avoid to break the wings (2g for a 60° of bank turn plus 0.5g for the max pitch commanded ----> 2.5g max for structural considerations)

2)From TAEM to Autoland handover

Landing site threshold coordinates need to be very precise.
They have been adjusted for KSC/VBG/EDW/ZZA/FMI/IPC so far.

At 10000 feet, the TAEM logic is ended and Autoland logic kicks in.
It is fairly similar to the TAEM one, with tighter deadbands and additionnal closed loop guidances for the last part (flare,...)

Three parts: Outer Glideslope tracking up to 2000 feet (blue) / Circular pull up flare to decrease the glideslope from 19°ish up to 1.5° (red) / 1.5 ° Inner Glide Slope and final flare (green)

*Outer Glide Slope tracking.
Either 18° or 20° depending of the weight.
Aim point will also slightly modified the downrange and final flare

*Flare and Inner Glide Slope intercept
At 2000 feet, a 1.3gish pull up is commanded to transition from the steep glideslope to a shallower one. (combination of open and closed loops)
An exponential decay to the inner glide slope allows a smooth transition during that pull up maneuver.
Aim is to have at least 5 seconds on the 1.5° slope before the final flare.

*Final Flare
At 80 feet QFE, another pull up is commanded to decrease the rate of descent.
Aim is to land 2500 feet past the runway threshold.
There are however some dispersions due to winds, ground effect, and some unforseen parameters.
The guidance is quite resilient for a wide range of situations and should be able to bring down safely the Orbiter not far from the targeted touchdown zone.

More time to watch the sunset
GinGin

Posts: 1526
Joined: Wed Jul 05, 2017 10:41 am
Location: Paris
Callsign: Gingin

### Re: Space Shuttle - TAEM original guidance simulation

Looks fantastic!!! Impressive work and bibliography!!

I wonder if we could dump out some data to push the AI Shuttle scenario to wheels stop at Edwards'!!
eatdirt

Posts: 980
Joined: Wed Aug 15, 2018 2:06 pm

### Re: Space Shuttle - TAEM original guidance simulation

@Eatdirt: Thanks Chris.

I pushed a small commit today.
I started to work on the Entry guidance original simulation and went for a proper Geodetic to Runway frame converter with conversion matrix.
I was using some polar coordinates to runway frame converter before.

TAEM guidance is more stable now, and large angle HAC are flown much smoother.
I also adjusted a bit the initial conditions for TAEM scenario when starting with just an airport and a runway as input parameters
It is a good scenario to test 360° HAC with all the energy logic to bring the Shuttle on glidepath and subsonic at HAC interface.

Code: Select all
`###ZAZ TAEM--aircraft=SpaceShuttle-TAEM--airport=LEZG--runway=12L`
GinGin

Posts: 1526
Joined: Wed Jul 05, 2017 10:41 am
Location: Paris
Callsign: Gingin

### Re: Space Shuttle - TAEM original guidance simulation

Very good. I am giving it a try these days with flightgear-next. The Shuttle is very beautiful with the compositor, the shadows in space are gorgeous!

I've done a bad RTLS at KSC due to me not engaging BFS soon enough (Hard Failure Scenarios), then I ended up having far too much energy and overshoot the HAC. Switched to manual then and landed the shuttle in VFR.
But a lot of messages from the TAEM guidance were keeping popping out, I guess we would need to add some conditionals to switch them off if we are way-off the HAC or in CSS?
eatdirt

Posts: 980
Joined: Wed Aug 15, 2018 2:06 pm

### Re: Space Shuttle - TAEM original guidance simulation

I ended up having far too much energy and overshoot the HAC

For RTLS, I need to activate S-turn and transition to GRTLS earlier than for a nominal TAEM.
The energy curves are also bit different for GRTLS. It was planned to be high on energy at TAEM transition.
I have done some tests and normally the current TAEM logic should bring back the Shuttle on track after overshooting the HAC and depleting some extra energy.

I guess we would need to add some conditionals to switch them off if we are way-off the HAC or in CSS

Don't know about that one. They pop up to warn you that you might be low on energy and consider to do something about it ( MEP, Straight In, ...)
They don't pop up again once you clear them and don't do an I/O reset with the keyboard.
GinGin

Posts: 1526
Joined: Wed Jul 05, 2017 10:41 am
Location: Paris
Callsign: Gingin

### Re: Space Shuttle - TAEM original guidance simulation

All right, I think I got them as well while bailing out very far from KSC, I should check this twice next time I am swimming
eatdirt

Posts: 980
Joined: Wed Aug 15, 2018 2:06 pm

### Re: Space Shuttle - TAEM original guidance simulation

@Eatdirt: Speaking of RTLS, I added some extra logic.
45° bank angle for Sturn vs 30° for normal TAEM.
Also some extra range computations to take into account the higher Mach flown during GRTLS during turn acquisition.
That works better to deplete the extra kinetic energy.
I will push that next week.
GinGin

Posts: 1526
Joined: Wed Jul 05, 2017 10:41 am
Location: Paris
Callsign: Gingin

### Re: Space Shuttle - TAEM original guidance simulation

I added another small logic for Low Energy handling that I forgot to enable before: HAC radius shrinking.

The final HAC radius (past 90° into the HAC) is 14000 feet (2.3 Nm).
In case of Low Energy once into the HAC and before the 90° HAC angle to go, the final radius will shrink depending on how Low we are in Potential Energy (up to a final radius of 5000 feet).
Basically, it means to be 4000 feet ish low on the glidepath once into the HAC.

An example below.
Right picture: Nominal energy situation (final radius of 2.2Nm
Left picture: Slightly off nominal energy situation, HAC final radius shrinked to 1.8 Nm and Shuttle was smoothly brought back on the glide.

GinGin

Posts: 1526
Joined: Wed Jul 05, 2017 10:41 am
Location: Paris
Callsign: Gingin