Proportional-Integral-Derivative Control Loops

Our code was heavily modified from the sample code provided at the beginning of the project. We were able to implement a PID control loop as opposed to just a proportional control loop, adjusting motor setpoints in response to not only the current measured velocity error, but also the rate and cumulative error. Additionally we were able to sample our velocity near-instantaneously, measuring its value and updating accordingly as soon as motor movement is detected. We do this by attaching the motor encoder output to trigger velocity calculation and PID algorithm on interrupt, as opposed to sampling over a long interval. While this increases noise, expressing our velocity as only a three-term moving average dropped our margin of error to only 5%, while maintaining a ~1000Hz polling rate.

Moving Bar Project

For this project we were tasked with moving a vertical, unsupported footlong bar of 1” aluminum extrusion to and from a given distance. To do this we needed to build a car from scratch and implement a closed-feedback control system using an Arduino Uno. While we ultimately finished third, the project was a great experience!

Theoretical Maximum Acceleration?

By solving for the horizontal acceleration such that the moment imparted upon the bar by gravity is equal and opposite to the moment imparted by accelerating the bar in a given direction, we found that the theoretical maximum acceleration for an upright prismatic bar is equal to gravity times the ratio of its width over its height. This computes to 32.17in/sec^2. By modeling the bar and moving platform in SolidWorks and analyzing the support reactions we were able to find exactly the same solution, 32.17in/sec^2, as well. We used Gruebler count analysis to properly constrain the system to exactly one degree of freedom.

Car Design and Environmental Challenges

While our calculated maximum acceleration was quite fast, we knew our actual competition speed would be significantly slower than that number, due to the slightly uneven floor and a lack of suspension. This proved a real challenge for us as we struggled to keep the platform stable even at slow (under 50% max) accelerations. Eventually our car required a set of redesigned parts that were slightly more compliant with the floor, had tighter tolerances, but also with lower friction allowing for a lower minimum speed (crucial for smooth stops, starts, and transitions)