Stage II is restartable, and fires twice. The first burn occurs during the final portion of the boost phase and is used to insert the second and third stage spacecraft stack into a low Earth orbit. The second stage is programmed to shut itself off once the rocket and spacecraft are in orbit around Earth.
The rocket and spacecraft orbit Earth until it arrives at just the right spot that lines up on the correct path to depart for Mars. Once the spacecraft is at the right angle, the second stage engine re-fires. This short re-firing of the second stage engine provides the final alignment and velocity for the third stage and MER spacecraft.
Keeping the Spacecraft in the Right PositionTo keep the spacecraft in the right position, the second stage engine, like the first stage engine, slides back and forth on large, straight gimbals through hydraulic pressure (by a fluid under pressure). Gimbals are devices that keep objects suspended in a horizontal plane regardless of motion by the use of two rings mounted on axes at right angles to each other. Gimbals work in conjunction with gyroscopes that spin like tops. The gyroscopes note their own spin. If they they are getting out of balance, they signal the gimbals to move. Just as you would move your hand to balance a tall broom handle on the middle of your palm, the engine slides back and forth on the gimbals to provide two different kinds of control during flight: pitch (up and down) and yaw (right and left).
To control any spinning of the second stage, a cold nitrogen gas system provides roll control during powered flight. When the second stage engine also shuts down for a while, this gas jet system can direct the second stage stack in all directions: up, down, right, left, roll clockwise, or roll counterclockwise. This ability allows what is known as "three-axis attitude control."
The inertial flight control assembly (RIFCA) avionics system uses data from ring laser gyros and accelerometers to perform the onboard navigation, guidance, and sequencing functions. This system is essentially the brains of the rocket. It senses accelerations and judges them against pre-programmed values. If the data is different from what was expected, it issues commands to get the rocket back on the correct path. Two of these control assemblies are on the rocket just in case one malfunctions. This backup system helps enhance mission assurance during a critical phase of the mission.