Analogue PID motor controller board
A PCB with an op-amp PID controller, DC motor drivers, a gyroscope and accelerometer, and an ESP32 that sets the controller gains through digital potentiometers.
- Goal
- Measure an angle and correct it with an analogue PID controller. Required settling time 2 s.
- My role
- Chassis design, motor selection and soldering. I also helped with the electrical design.
- Team
- 4 students
- Tools
- KiCad (PCB), Onshape (chassis), ESP32 WROOM DevKit V1
- Course
- Control Systems project, Year 2, Quarter 1, Hanze University of Applied Sciences
Problem
The system measures an angle and corrects it with an analogue PID controller. The course required a settling time of 2 s.
Design
The controller is analogue. Op-amp stages implement the proportional, integral and derivative terms and add them together. Digital potentiometers set the gain of each term, so the ESP32 can change the gains in software. The board also has:
- an ESP32 WROOM DevKit V1,
- a gyroscope and accelerometer module for measuring the angle,
- a DAC,
- transistors and connectors for two DC motors,
- a 3.3 V regulator with a potentiometer to set its output,
- two battery connectors and a power switch,
- measurement points for checking signals with an oscilloscope.
We first made a digital model of the system, then chose the gains by trial and error. The notes for this course are in Control Systems.
Build
I designed the chassis in Onshape and selected the motors. Another team member designed most of the PCB in KiCad, and another wrote most of the code. I soldered the surface-mount parts under a digital microscope. The board sits in the 3D-printed chassis.
Test
Some components arrived late, and we did not have time to tune the controller. We did not measure the overshoot or the settling time.
What I would change
- Make the chassis taller.
- Leave more time for tuning the controller.





