Our Mechatronics II class asked us to create a system exhibiting a 4th-order dynamics control system. You can see a picture of it below. Our system was comprised of two 2nd-order systems: first, controlling the angle of the bar with two brushless DC electric motors, and second, to control the position of a free-sliding carrraige on the bar with an inner and outer loop PID control system. We designed all of the parts /assemblies in Solidworks and fabricated on either a 3D printer or laser cutter to be robust and safe. I developed the embedded software to control the system in C++ on an Arduino microcontroller.
No project goes completely smoothly: As we spec’d out our sensors and actuators, we ran into difficulty with a cheap IMU sensor. We tried tried to identify the root cause of sensor malfunction, and we ultimately discovered it was inherently imprecise and inaccurate in its measurements. We switched to an ultrasonic range sensor system, accurate to ~3 degrees, to extrapolate the angle of the bar.