Explore Feedback & PID Control
Practice incorporating feedback, then coding and tuning a PID controller.
Table of contents
Feedback
- From the
laboratoyrepo you previously cloned, open the notebooklaboratory/control/simple_feedback_control.ipynbin VS Code. - Complete the
TODOcode in the Controller section to return a proportional command. - Complete the
TODOcode in the Simulation Script section to assign a value for the proportional gain (kp). - Answer the questions in the notebook.
- Upload your completed code (with question answers) to your student repo.
NOTE: Be sure to comment out the raise NotImplementedError() lines in steps 2 & 3 above after adding your code.
PID Controller
- Clone the
simple_pidrepo:cd ~ git clone git@github.com:BWSI-UAV/simple_pid.git - Implement the PID controller: open
simple_pid.pyand edit lines 53, 54, and 57 to calculate your P, I, and D terms (look forTODOin the code). - Tune your PID controller: open the notebook
Implementing PID in Python.ipynband tune the “gain” values kP, kI, and kD to generate a reasonable system response (again, look forTODOin the code). - Try to beat the response shown at the bottom of the notebook and answer the question about what makes your response “better”.
- Upload your completed code (with question answer) to your student repo.