Hacker News new | ask | show | jobs
by PennRobotics 1625 days ago
The best demonstrations of control theory I've seen are water filling a tank (or water filling a tank that has a hole that fills another tank), balancing a ball on a rotating stick or tilting board, car cruise control (especially with hills added)...

In my opinion, the biggest obstacle is being able to sense your target. For the pendulum, you'll need a magnetic angle sensor or an encoder or a good/fast OpenCV angle identifier. For the water tank, you have different feedback options: resistive, floating ball (that can be tied to a regular sensor or identified by OpenCV), weight (although most household scales don't have a clean method of exporting to your controller), and more. I would only do a ball balancing demo with OpenCV.

The difficulty with OpenCV is having to run it on a computer and communicate with your motor controller OR having to run it on a fairly powerful evaluation board (e.g. Raspberry Pi). For this reason, I wouldn't recommend it unless you're comfortable connecting to your controller via USB/serial port.

Changing your goals will really highlight the differences between algorithms: getting to a stationary point, getting to a stationary point as accurately as possible, getting to a stationary point as quickly as possible, following a steadily changing predefined path as accurately as possible, traversing the same path as quickly as possible, following the path without overshooting any boundaries.

Just replace "path" with the appropriate physical system e.g. filling the double tank as quickly as possible without spilling from either tank; speeding up a motor with inertia as quickly as possible without exceeding some angular velocity.

When you want to move to really cool but reasonably difficult demos, look for videos and papers (Google Scholar) on "ball and plate", such as https://www.youtube.com/watch?v=wqmP-y-a2qY