What Does it Take to Land a Rocket? Part 1 - Understanding the Challenge
Motivation
Ever since taking my Introduction to Controls class, I have desired to learn more about modern control strategies, mechanical design of mechanisms, PCBA design, and firmware development. While I would be able to learn these concepts from literature, I would understand the material in greater depth if I were to apply them in the context of a project. As a result, I will be spending the next few weeks (or months, depending on how much time I have) designing and building a vertical take off and landing model rocket. Since the goal of this endeavor is to broaden and deepen my engineering skill set, I will focus on understanding the theory behind different aspects of the project. There are three reasons for doing this: to showcase my work, to record a snapshot of my knowledge base at the time of the project, and to create a resource for others who may be interested in these topics.
I am aiming to provide a general overview of the whole process with detail in areas I think are important or have struggled with. I will document my work with the assumption that you already have an understanding of calculus, physics, dynamics, and introductory linear algebra. I will try to leave links to resources for more difficult concepts.
Project Description
The goal for this project is to design and build a vertical take off and landing model rocket using engineering processes I’ve learned at work and at school.
Requirements
A concept that I have learned from my peers is that good design best meets its requirements. The requirements should be quantifiable. For instance, instead of specifying that a lamp needs to light up a desk, you should specify that the lamp needs to produce 300 lumens and have a field of view of 70°. This way you can evaluate the performance of different designs.
Here are the requirements for the VTVL rocket project. Keep in mind that as you go through the design process, you may find that certain requirements are physically impossible to achieve. If this is the case, you can modify the requirements and redesign.
- Reach at least 100m in altitude using a solid model rocket booster
- Land vertically at a predetermined location within a 2 meter radius
- Land optimally using the least amount of energy physically possible. This is to emulate the tight fuel constraints of a real rocket.
- Cost less than $1000
- Vehicle can withstand all forces while minimizing weight
- Complete mechanical design for first iteration in 36 hrs or less
Approach
First, my current approach is to de-risk the most difficult aspects of the project, then iterate on each subsystem, integrate, test, and finally revise. Given my current knowledge base, I am the least familiar with the controls subsystem of this project. This includes control theory, designing a PCBA, and writing firmware. Thus, I will begin by learning how to design a feedback controller.
Dynamics of a Rocket… Actually… More Like a Flying Stick
When designing any system, we need to understand how it will behave under our intended use cases. For example, how much will a beam deflect if you press on the end of it with a given amount of force? There are mathematical models based on physics or empirical data that we can use to answer these questions. However, all models are just an approximation of what happens in reality. It is important to understand their limitations and assumptions so that you know the limitations of your design.
Since we are primarily interested in learning about control theory, we won’t spend too much time on building a super accurate rocket model. We just need something that captures enough of the dynamics of a rocket so that we can test different controllers on it.
Simplifying Assumptions
A real rocket has many different parts and can be very challenging and time consuming to model accurately. Since I know that we will need to linearize the system later on to build a state space controller, we will make assumptions about our rocket that makes it easier to linearize.
A real rocket changes mass as fuel is expelled. In our system, we will assume that it doesn’t and that a force is magically produced (or produced with an electric fan).
Our rocket will also be simplified to a stick flying in the X-Y plane. Since we are doing this in state space, it shouldn’t be too difficult to generalize what we learn here into 3D later on.
We will also assume that we have infinite fuel, infinite force, and that the rocket nozzle can rotate 360° in the X-Y plane (left and right and up and down plane). Using these assumptions, we write our equations of motion.
Simulating the Open Loop Dynamics
The next step is to simulate the rocket. Below is the MATLAB code that plots the orientation and trajectory of the rocket given a force and angle (radians).
This is the result from the code above:
What’s Next?
Now that we have our open loop rocket simulation working, it is time to look into how to control it. Below is a super high level overview of the concepts we will go over in the next post. I’ve linked resources that have helped me understand the more complex concepts.
Linear Quadratic Regulator LQR
To understand the linear quadratic regulator, it is useful to understand pole placement first. Here is a set of videos that I watched to get familiar with the topics. Since the videos do a really good job of explaining pole placement and LQR, I won’t repeat that here. I will instead provide a high level overview of what LQR is.
There is a set of linear equations that govern the dynamics of an open loop system (often called a plant). In our rocket example, this set of equations relate forces and moments to position, velocity, and acceleration of the rocket but can relate any input to any state for other systems. The eigenvalues of this set of linear equations tell us if the system is unstable. These eigenvalues are known as the poles of the system. Pole placement and LQR are ways to move these poles by multiplying the open loop system with some gain matrix. LQR is an optimal way to pick where these poles are given how quickly you want the system to stabilize and the cost of actuation energy.
Model Predictive Control MPC
Model predictive control is a control method that optimizes a control input subject to constraints. Here is a video that explains at a high level how it works. In summary, for every time step, the MPC controller looks at the current state of the system, the previous input, the desired output, and calculates the optimal input trajectory for the next n time steps. It then picks the first input and implements that one. It does this at every time step. I am using this book to learn how to implement the controller.