Spacecraft Control Toolbox To The Moon

Today, I will discuss two functions in release 2020.1 of the Spacecraft Control Toolbox (SCT) which can be used to get your spacecraft into a lunar orbit. They are LunarTargeting.m and LunarMissionControl.m. They are demonstrated together in the script LunarMission.m.

LunarTargeting.m produces a transfer orbit that starts at a Low Earth Orbit (LEO) altitude and ends up passing by the Moon with a specified perilune (periapsis of the Moon) and lunar orbital inclination. Its novel approach to the patched-conic-sections model of multibody orbital transfers uses the solution to Lambert’s problem to target a point on the gravitational boundary between the Earth and the Moon. Then it numerically optimizes over points on that surface until the initial velocity of the transfer is minimized. LunarTargeting.m requires the MATLAB optimization toolbox.

LunarMissionControl.m implements a control system which enables a spacecraft to propulsively enter lunar orbit. Like the other control systems implemented in the SCT, it stores its active state and degrees of freedom in a data structure, and accepts a list of commands as arguments. The commands we’ll see used here are ‘initialize,’ ‘lunar orbit insertion prepare,’ ‘align for lunar insertion,’ and ‘start main engine.’

LunarMission.m ties them both together and simulates a spacecraft, down to the attitude-control level. The simulation includes power and thermal models. The spacecraft can be controlled by reaction wheels or thrusters. Forces from the Sun, Earth, and Moon are included. The spacecraft starts on the trajectory returned by LunarTargeting.m, then acts in accordance to commands to LunarMissionControl.m. It takes the spacecraft 4.5 days to get to perilune, at which point it inserts itself into lunar orbit. Let’s take a look!

A figure produced by LunarMission.m. This figure shows the whole trajectory, from Low Earth altitude to a complete orbit around the Moon after insertion.

Take a look at the above figure. This is the entire mission trajectory in the Earth-Centered Inertial (ECI) frame. We can see the initial transfer orbit as the red line. Then it approaches the blue line (the Moon’s orbit), and begins corkscrewing around it after orbital insertion. Let’s look at that insertion in close-up:

One figure produced by LunarMission.m. This figure shows the lunar orbit insertion.

The above figure shows the final part of the trajectory in Moon-centered coordinates. The red line starts as the spacecraft passes the imaginary gravitational boundary between the Earth and the Moon. It falls closer to the Moon, and at its closest point, fires its engines to reduce its velocity. You can’t see it in this figure, but that process is actually resolved on a 2 second timescale. The spacecraft is commanded to point retrograde using a PID controller, waits until it has pointed correctly, then fires its engines for a prescribed duration. If you look closely, you will see that moon has a 3 dimension surface courtesy of the Clementine mission.

Let’s finish this post off with some technical details:

On the far left, you can see the reaction wheel rates. They stay at zero for 4.5 days, as the spacecraft coasts. Then, when the craft is commanded to point retrograde for its orbital insertion, you can see wheels 2 and 3 spin up. Wheel 1 stays near zero; its vertical scale is 10^-16. Then in the center, you can see fuel use. The only fuel use is the insertion burn, so fuel stays constant until 4.5 days in. Less than 2 kg of fuel is used for this example, as the spacecraft is a 6U cubesat. On the right, the components of the body quaternion are displayed. Again, they are constant until 4.5 days in, when the craft is commanded to point retrograde.

I hope you’ve enjoyed this demonstration of how to simulate a lunar mission with the SCT! For more information on our toolboxes check out our Spacecraft Control Toolbox for MATLAB. You can contact us directly by email if you have any questions.

Lunar Landing Control System

The first soft moon landings were accomplished in the 1960’s by the Soviet Luna 9 and the U.S. Surveyor Spacecraft. These were followed by the U.S. Lunar Module landings during the Apollo program. The Soviets had their own LK Lander lunar lander for landing humans on the moon but it never flew. China’s Chang’e-3 landed on the moon on December 13, 2013. India plans to land the Chandrayaan-2 on the moon in 2018.  South Korea intends to land a spacecraft on the moon in 2020.

The U.S. Lunar Module was flown by a crew but had a digital computer that performed guidance, navigation and control. A great new book by Don Eyles, Sunburst and Luminary an Apollo Memoir explains how that was accomplished with a computer less powerful than those in toaster ovens today. Don played a key role in saving the Apollo 14 mission when an abort light appeared on the crew’s console prior to descent. Read the book for for the whole story.

NASA intended follow-ons to the Lunar Module that would have been fully automated for delivering materials to the moon in preparation for a permanent human presence. Unfortunately, those plans never materialized.

As we are always looking for new missions for testing our Precision Attitude Control System, we added guidance, navigation and control for lunar landings. We use a really simple guidance algorithm called 2nd order guidance. It is nothing more than a Proportional Derivative (PD) controller with the landing spot as a target. You can adjust the damping ratio and undamped natural frequency of the controller to mimic more sophisticated, “optimal” guidance algorithms. The 2nd order guidance works until the lander gets near the surface and then it switches to landing algorithm that hovers, nulling any remaining translational velocities and then descends to the surface. Lidar would be used as guidance. Once it is hovering it would need to search for a flat spot for landing. NASA has developed Hazard Detection Software for Lunar Landing that uses lidar. It is available for licensing from Caltech.

Here is one simulation in our Simulation Framework. Once the descent is initiated, the spacecraft reorients so that the main engine thrust vector is in the desired direction. The display on the left shows the attitude errors (the two boxes) and the throttle setting (which is zero during the attitude maneuver.)

A close up of the attitude display. Pitch and yaw are offsets of the green rectangle. Roll is rotation of the rectangle. This is quite primitive but it is easy to add your own displays if you know a little OpenGL!

Descent starts and the throttle is about 50% at this point. The two plots are of altitude and velocity. The maneuver starts at 15 km and the target is 600 km along track. The lander has solar panels on a two-axis gimbal and a high gain antenna, also on a two-axis gimbal.

The propulsion page shows two attitude thrusters firing and the main engine.

The spacecraft has landed! You can see the terminal descent phase on the altitude and velocity plots. The lunar surface is featureless because we have not added close up maps of the landing zone to the planet display.

The descent page shows the throttle settings. You can monitor the guidance force demand and simulated force.

This is the propulsion page. The attitude thrusters get very busy during the terminal descent phase. Note that we have a lot of fuel left! We could have hovered for quite some time.

The graphics are from our VisualCommander product that runs on Mac OS X.

This GN&C system is capable of autonomous flight from LEO all the way to the moon. It uses our Optical Navigation System, developed under a NASA Phase II SBIR for trajectory determination on the flight to the moon and lunar orbit entry.

For more information contact us directly!