PID Course(TA)

Photo by Jingyi HUANG

Overall introduction


This course is designed to give students an intuitive understanding of PID controllers by conducting experiments on a simulation platform. We have designed a simple PID controller in the simulation platform, and through parameter tuning of this controller, students can gain an intuitive understanding of the principles of PID controllers. We have also designed a simple second-order dynamics model for quadrotors in the simulation platform. By controlling the quadrotor to follow a set path, students can verify the control effect of the controller.

Course content


Teaching Content of the Code

  1. PID Controller Principles: Students can learn how a PID controller works through the implementation of the PidControl class. The comments and structured design in the code help students understand how the proportional, integral, and derivative components are calculated independently and combined to form a control signal.
  1. Trajectory Tracking: The desired_trace function provides a target trajectory, showing students how to set target positions based on the change in time.
  1. Dynamic System Simulation: The SecondOrderDynamics class demonstrates a simplified dynamic system model, helping students understand the relationship between state updates and control inputs.
  1. Real-time Simulation: The main loop simulates the operation of a real-time control system, where students can observe how the controller responds to errors and updates control inputs at each time step.
Real-time Simulation
Real-time Simulation
  1. Data Visualization: Through plotting, students can visually comprehend the controller’s performance, such as the comparison between the actual and target trajectories, and the error over time.
Data Visualization
Data Visualization

Student Activities

  1. Understanding the Code: Initially, students need to read and comprehend each part of the code, including how the PID controller operates, system dynamics, target trajectory setting, and the simulation loop.
  1. Modifying Parameters: Students can alter the kp, ki, kd parameters in the PidControl to see changes in the controller’s performance. This helps them understand the impact of these parameters on system behavior.
  1. Experimenting and Observing: Students can run the code and observe the quadrotor’s flight path and behavior under different PID parameters. By comparing the actual trajectory to the target trajectory, they can learn how to adjust PID parameters to improve system performance.
  1. Adjusting the Target Trajectory: Students can modify the desired_trace function to try different target trajectories and observe how the PID controller performs with various paths.
  1. Problem-Solving: If issues arise during the simulation, such as the quadrotor deviating from the target trajectory, students are expected to analyze the cause of the problem and attempt to solve it, which helps develop their problem-solving skills.

Results


The students conducted the simulation and saw the motion of the quadrotor. They got a better understanding of the PID controller and the quadrotor’s dynamics. They also learned how to tune the PID parameters to improve the controller’s performance. The students were able to complete the course and achieve the expected learning outcomes.

Jingyi Huang
Jingyi Huang
Master Student

My research interests include AI in robotics, multi-agents formation control and path planning.