Adam has often wondered how PID controls work and how they are implemented. Is PID tuning challenging? Do external factors on the robot affect PID tuning? Watch Adam build a parking robot using PID to accelerate, decelerate, and keep track of the distance from other objects.
Watch the Video:
Adam takes on the challenge of using a PID (Proportional Integral Derivative) controller in a robotics project. He is interested in robotics and has experience with Halloween animatronics, but PID control presents a new level of complexity. PID is commonly used in advanced robotics projects. Examples include balancing robots or systems that require precise control to stay centered, such as a platform with a bouncing ping-pong ball.
Adam's project involves creating a basic self-driving car that can accelerate and decelerate within a one-meter distance without overshooting the target. He has designed a robot with two beefy motors (120 RPM, 12 watts each) for the left and right sides. Power management is a concern, so he is considering using a cable instead of a battery. The robot will be driven by an Arduino Uno R4 Minima, which is a compact and capable microcontroller board that interfaces with the motor driver and an ultrasonic sensor to implement the PID control.
To realize his design, Adam has iterated through various prototypes and 3D-printed parts for the robot. He used M3 screws for all components to avoid the need for hot glue or modifications. The robot features two large tires, and Adam plans to add electrical tape for better traction on hardwood surfaces. Despite the challenges during the design phase, he is excited about the potential success of the final product.
During the PID tuning process, Adam faces some difficulties. He turns to a chatbot for code assistance, but the provided code has some inaccuracies for his specific setup. Regardless, the code from the chatbot gives him valuable insights and prompts him to think about setting PWM limits and stopping when the target distance is reached. This process highlights the complexities involved in fine-tuning PID controllers for individual systems.
After adjusting his code and robot setup, Adam sees significant improvements in performance. Although there are still some issues with overcompensation and occasional tipping, the robot is now much closer to achieving its desired behaviour. PID tuning is an art form, it requires patience and understanding of numerous factors beyond just the constant values.
Throughout the project, Adam encounters challenges related to the ultrasonic sensor and weight distribution, but with the Arduino Uno R4 Minima at its core, he can efficiently program and fine-tune the PID controller to achieve the desired performance of the self-driving car. This powerful yet compact microcontroller empowers makers like Adam to explore advanced robotics concepts and experiment with PID control in their projects. Despite the difficulties, he is excited about the progress made and looks forward to further improvements in his robot's behaviour.
Bonus Content:
Bill of Material:
Product Name | Manufacturer | Quantity | Buy Kit |
---|---|---|---|
3D Printer Filament, PLA, White | MULTICOMP | 1 | Buy Now |
Sensor Board, Ultrasonic Distance Sensor, PING | PARALLAX | 1 | Buy Now |
ARDUINO UNO REV4 WIFI ROHS COMPLIANT: YES | Arduino | 1 | Buy Now |
Additional Parts:
2x 100 RPM 12V Gear Motor High Torque |
DC Motor Driver, DROK L298 |
Various M3 Screws |