How to make a Project Mercury Atlas launch autopilot (or historic launch in general)

asbjos

tuanibrO
Addon Developer
Joined
Jun 22, 2011
Messages
695
Reaction score
247
Points
58
Location
This place called "home".
So I got some question about the Atlas autopilot in my recent Project Mercury X addon, and thought that I would write about it here. There are several reasons, one being to help the users understand what's going on the hood. Second, I got tired of coding. Third, I have spent 6 months studying Project Mercury in detail, so I thought this was a good chance to write a summary of a small part of it. Fourth, I hope that this can be found useful, either for people trying to model Project Mercury, or any launch in general.

The entire Atlas autopilot is something like 700 lines of code, so I will mainly gloss over the specifics, and instead talk about the bigger problems.
I will add some code though. For the non-programmers of you, I try to explain the code in the paragraph beneath the snippet.

Let's begin!


A Mercury-Atlas launch can be divided into four phases:
  1. Ignition and liftoff going straight up until T+2 seconds.
  2. Roll program until T+15 seconds to attain correct heading.
  3. A general pitch program for roughly two minutes, ending with booster stage separation and escape tower jettison.
  4. Active guidance targeting the intended orbit

The difficult thing about modeling a historical space project is that the information often is very sparse, and diverging. Especially for a space program such as Mercury, where things were in its infancy, and changed fast.

Making the Mercury-Atlas:
The Mercury-Atlas is probably the simplest manned orbital launch vehicle. It had just one fuel tank, with a centre engine burning continuously from liftoff to orbit insertion. In addition, using the same fuel tank, we have two vernier engines, small rockets that can gimbal, used for attitude control.
Finally, we have the powerful booster stage, surrounding the centre engine, with two less efficient, but more powerful rocket thrusters.
Both the centre and booster thrusters are gimbaled, to provide attitude control together with the verniers.

This is quite easily modeled in Orbiter.
The important thing to note, is that as we have physical thrusters, there is an inertia (or lag) to the engines: if you turn hard right, it takes some time for the engines to gimbal to the set direction.
As long as this time is short enough, it should not be a big problem, but if done wrong, the autopilot will be confused. Let's say your turning left, but the autopilot suddenly wants to go right. You will then keep accelerating left in the time it takes for the engines to gimbal from left to right.

First phase, ignition and liftoff:
Quite easy, just light up, stay attached to the launchpad, then release and go up. This is made a bit more complicated by the Earth's surface not being flat in Orbiter 2016, but for LC-14 (where Mercury-Atlas was launched from, this deviation is something like 1 degree from the zenith (up).

Second phase, roll program:
Historically, the Mercury-Atlas was launched toward a heading of 72.55 degrees. But, in an effort to make this launcher more generic, I implemented an algorithm to launch towards any coordinate on Earth.
To accomplish this, I used the algorithm outlined in the paper by T. Skopinski and the late Katherine Johnson. In this algorithm, we input the coordinates
 
Top