This particular blog entry is going to be a throwback to some of the control systems work I did in my college days. Essentially, control systems engineering involves the design and analysis of the motion of a given system, in this case, an idealized rigid spacecraft. For any given system, or body, there is a set of equations of motion that can describe that system. Usually this involves things like translational velocity, angular velocity, translational accelerations, angular accelerations, and so on. Once the equations of motion of a body are understood, the state of the body, meaning the attitude and motion of it, can be controlled via commands to controlling devices. The process of studying these equations of motion, simulating them, and employing those simulations to develop computer code and hardware specifications is known as control systems engineering.
Next, I need to introduce quaternions. A quaternion is, essentially, a mathematical construct made up of a three component vector and a scalar component. The vector portion of the quaternion describes a vector in space that can be related to the body axes of a spacecraft. The scalar portion represents the rotation about that vector that a spacecraft would need to undergo to complete a desired maneuver. Essentially, the body axes of a spacecraft can define the spacecraft attitude as a set of angles rotated through from an inertial axis set. The quaternion can represent the same rotation through a single rotation about a particular vector. Thus, the scalar and vector components of a quaternion work together to describe the attitude of a spacecraft. For the purposes of this discussion, the quaternion vector will be called 'q' while the quaternion scalar will be called 'q4.' For more information regarding quaternions you can consult Wikipedia, refer to the authoritative source on quaternions, or explore the applications quaternions have in spacecraft.
Finally, in order to describe the full state of a spacecraft, we need to refer to the mass properties of the spacecraft, meaning the moments of inertia about our chosen set of body axes. These properties can be stored in an inertia tensor which we will call 'J.' We also need to discuss whatever outside forces will be acting on our spacecraft. Thus, we will be referring to external moments enacted upon the spacecraft bus as 'M.'
Equations of Motion of a Spacecraft
Linearized Model and Equilibrium Point
rigid body spacecraft system
Knowing this to be an equilibrium point gives us the ability to, 'linearize,' the system described by the equations of motion. This requires us to take the Jacobian of the equations of motion. In other words, we need to take the derivative of each of the above equations (1 through 3) with respect to each of the state vectors (w, q, and q4). We can then plug the equilibrium point in equation 4 into the resulting equations to derive a state coefficient matrix (A) that we can employ in a linear state-space system. It is important to remember that, when utilizing this linearization method, the results will only be valid very close to the equilibrium point. The further we move from the equilibrium state, the less accurate such an approximation becomes.
idealized, rigid body spacecraft about
the equilibrium point depicted in equation 4.
Each of the Jacobian elements relates to each of the block derivatives of the equations of motion. So, for instance, the derivative of w_dot with respect to w yields the first element. The derivative of w_dot with respect to q yields the second element, and the derivative of q with respect to w yields the fourth element. For reference, I_vector in the equation above represents a single 3 x 1 unity vector. The I matrix (without the arrow) represents a 3 x 3 identity matrix. Q represents the cross product matrix of the q vector which has the dimensions of 3 x 3.
Once we plug the equilibrium state of the system from equation 4 we find this system simplifies to the state matrix, A, in equation 6. Notice how this linearization leaves q reliant entirely upon constant coeffecients of 1/2. This is because the zero and unity elements of the equilibrium state end up simplifying many of the equations in the Jacobian matrix. For instance, the cross products with w and q always drive to zero since the cross product of a zero vector yields a zero result. As a result, w and q4 do not respond to changes in the system itself at all. Instead, changes in these state variables will be reliant upon the input vector M, and the effects must be studied with an input matrix.
linearized spacecraft system.
Finally, to round off our state-space system, we need to develop an output matrix, C, and a feedthrough matrix, D. For the purposes of our model, we are going to assume perfect observability and an output that is equal to the state vector output. Thus, the C matrix will be a 7 x 7 identity matrix. We will also be neglecting a feedthrough loop because it is unnecessary for our control system design. Thus, D will consist of a zero matrix with a 7 x 3 dimensionality. These two components are depicted in equations 8 and 9 below.
So, now that we have an ideal state-space system derived to model our spacecraft near the equilibrium point, we can start to simulate the system. I employed Matlab and Simulink in order to model this system. I tried to use the open-source analysis suite of Scilab and Xcos. However, Xcos proved to be so buggy that I couldn't get the models implemented without crashing the program. Hopefully the program will mature with time. For now, however, we will be using the proprietary programs to do our analysis.
Linearized Model and Analysis
The script runs the model for 30 seconds. During this time, at about 15 seconds, a small impulse moment named 'M' in the script is input to the model using a pulse generator. The input moment is applied to the model for 1 second at 15 seconds into the simulation. This is meant to simulate an off axis micro meteor impact, or, perhaps, it could simulate a small, temporary leak in a fuel line. Either way, I applied a moment input vector of [5.0; 1.7; 2.2] Nm about my body axes. This gave me the opportunity to study the response of a linearized system given some sort of unexpected external event. The Simulink model I used to simulate this response is depicted in Figure 1.
Finally, I also plotted and monitored the input moments to the linear plant (State-Space block). These input moments are reflected in figure 2.
This also starts to depict why this sort of analysis is known as a linearization technique. The response to the inputs is rather 1 dimensional. As the moment input to the system increases, the angular rates increase proportionally. That's pretty much the definition of a linear response. So let's see if that trend holds true for the quaternion vector. See figure 4..
If we observe the A matrix of our system, we note that the q vector response is coupled, entirely, to the spin rates (w vector) of our spacecraft. Now, there is a 1/2 coefficient to lessen the drama of the response, but, we still see that as the spin rates increase due to the moment input, the quaternion responds in kind by spinning all to hell. In the end, the induced moment causes our spacecraft to spin out of control in such a manner that it becomes useless. If our spacecraft is spinning uncontrollably, then we can't do much useful science with it can we? So this model starts to show us how disastrous something like a micro meteorite impact on a cubesat could be.
But let's move on and see how the quaternion scalar is impacted by such a moment on the spacecraft. see figure 5.
Once we properly simulate the system, then we can begin trying to control the system via feedback loops and various controller methods. Luckily for you, I am going to be furthering this analysis in exactly this manner over the next few weeks. First, I will model the nonlinear spacecraft equations and compare them to this model for reference. Next, I am going to show how you can utilize a feedback loop with a simple gain imparted on your state signal (via something like an op amp) to damp out and control your response to a moment like the one we simulated here.
Until then, however, I hope you enjoyed this brief introduction to spacecraft control systems. One interesting thing to note is that this type of analysis can be carried into any system, including things like robotic joints and rover motions, or, hell, even cybernetic enhancements to the human body. In other words, as long as the equations of motion of a system can be determined, the analysis and control methods I am discussing will be applicable to those systems. So you can see how exciting this field of engineering and analysis can be. As I progress through the means of controlling a system via simulation, hopefully I will start to apply some of the same control techniques to actual hardware, like my Ardie platform. This type of project is a ways off in the future, but I look forward to bridging that gap between theory and reality.
So, until next time, good luck and good hacking!
Brady C. Jackson