Explore Feedback & PID Control
Practice incorporating feedback, then coding and tuning a PID controller.
Table of contents
Feedback
- From the
laboratoy
repo you previously cloned, open the notebooklaboratory/control/simple_feedback_control.ipynb
in VS Code. - Complete the
TODO
code in the Controller section to return a proportional command. - Complete the
TODO
code 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_pid
repo:cd ~ git clone git@github.com:BWSI-UAV/simple_pid.git
- Implement the PID controller: open
simple_pid.py
and edit lines 53, 54, and 57 to calculate your P, I, and D terms (look forTODO
in the code). - Tune your PID controller: open the notebook
Implementing PID in Python.ipynb
and tune the “gain” values kP, kI, and kD to generate a reasonable system response (again, look forTODO
in 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.