The goal of PID is to give you more practice implementing your own Proportional-Integral-Derivative Controller that you learned about from the PID lesson on Udacity. The main objective of this project is to write your own PID controllers to solve certain problems that are more easily solved using such controllers. The project is split into two sections, Part A and Part B. It is suggested that you use a PD controller to solve Part A and a PID controller to solve part B but any approach that can solve the student testing suite will be accepted. You may also use Twiddle to fnd an optimal solution, but it is not required. This project requires the SciPy library and you will need the
Matplotlib library to get the full beneft of the
testing suite (graph output).
PART A:
All rockets need precise control of the pressure for the feed system of liquid oxidizer and fuel into the engine turbopumps. A failure of engine turbopumps to supply the pressure to meet feed demands of the engine could force an abort of the launch or a disaster after liftof. The main purpose of Part A will be to solve the problem of maintaining the fuel mixture pressure supplied by the rocket’s turbopumps. In order for the rocket to leave the launchpad, the pumps must be pressurized up to their max level of 100 as quickly as possible. Once there, they must be maintained for the duration of the launch. Therefore, the goal will be to create a
simple PD based controller that can make adjustments to the pump’s output in order to meet pressure demands. The PD controller will give adjustments that will be in the range of -1.0 to 1.0. Where 1.0 is the max adjustment per time step to increase the pump’s pressure, and -1.0 is to reduce the pump’s pressure. These adjustments will modify the pressure change rate to the turbopumps. The
pressure change rate can operate between -10.0 and 10.0. For example, if for the past 10 time steps the PD controller has given a +1.0 command to the turbopumps, then the pressure change rate will now be maxed out at 10.0. This means for every time step the pressure will increase in the turbopump by this amount, 10.0. If the turbopump pressure goes below 0 or above 105, it will result in damage to the engines (and your grade). For Part A complete the “pressure_pd_solution” function in RocketPIDStudent_submission.py. To test your pressure PD controller, see the “test_running_pumps” test case located in “RocketPIDStudent_tester.py
PART B:
The second part of the assignment is a slightly more difficult adaption of the PID controller for controlling a rocket launch and reentry. It
requires your controller be able to control the output of rocket engines on a simulated rocket ship such that it is able to successfully maintain speeds through diferent atmospheric fight regimes and as parameters such as thrust, weight, and air drag are constantly changing. You will be given an evaluation fle that you can use to
determine how well your PID solution and parameters are working. Various information about the rocket’s fight path and other telemetry can be viewed in a matplotlib output similar to as seen on Udacity in the testing fle. The controller can only operate the throttle on the rocket’s engines in a range of [0,1] and the rocket engine only pushes the rocket upwards (only gravity pulls the rocket downward). When enough throttle is applied, the rocket will “liftof” and continue to ascend until it runs out of fuel or “lands”. The fight plan required for the rocket consists of maintaining an upward velocity of 0.25 km/s +/- 0.01 for 90 seconds and then 0.5 km/s +/- 0.01 for 40 seconds. Once the rocket has completed its fight plan, it will be required to descend through gravitational forces and NOOT by using the rocket ( which only act in the upward direction, and can be used to slow the rocket as it approaches the ground). The rocket should then “land” by approaching the ground below a “safe” landing velocity of 0.1 km/s +/- 0.01. For Part B, complete “rocket_pid_solution” in RocketPIDStudent_submission.py that satisfes the given constraints. To test your PID controller, use the test case “test_launch” in the RocketPIDStudent_submission.py fle to import your throttle controls and test it on a simulated rocket.