For my final project for my Feedback Control Design course, I was tasked with designing a "smart train" system. The goal of the project was to control the speed of each train in the system so that it maintains a certain following distance to the train in front of it. Each train was equipped with an ultrasonic "ping" sensor to measure distance and a MOSFET to control the motor speed using an Arduino-generated PWM signal.
To solve the control design problem, I determined the transfer function by determining how following distance changed with changes in the PWM signal output by the Arduino. Using Bode plots, the Nyquist stability criterion, and a Simulink model, I designed a PID controller for the system that met given stability requirements. I also analyzed the string stability of the train chain as I added more vehicles to the system. In the video below, it can be seen that while the following distance between the first two cars is relatively stable, the system becomes less stable for cars further back in the chain.