Summary

Since last time I’ve worked on a basic PID controller for class and run into some more problems in research, but I’ll focus PID controller because it’s more interesting.

PID Controller

For the mobile robotics class, we were on the topic of controls. We talked about a few fancy control algorithms in class (model predictive controllers, cascade controllers) but the TA Arun said that oftentimes in industry, PID controllers are the first thing they throw at a problem because they just work.

They are formulated like so:

Screenshot 2023-10-12 at 11.38.53 PM.png

where u is the output for input t. e(t) is simply the error from set point which is the point you want to reach: $e(t) = setpoint - t$.

There are three ‘parts’ of this system to consider. Generally they can be seen as control to account for the past, present, and future error.

<aside> 💡 Note that for a lot of applications a PI controller is actually enough!

</aside>

I learned from tuning my PID controller that they’re pretty finicky, and it was pretty hard for me to predict the behavior of the system after each change. In class we learned that there are a few tricks to tune PID controllers, but generally it’s black magic and often times it is brute forced (but you need a simulation model for this because there is significant cost associated with brute forcing the real systems) or there are specialists who get paid a lot of money because they’ve learned to understand them to some extent.

Of course, you could also have a reverse PID controller if all the gains are negative.

Here are some pics of a the results of PID controllers I tuned for a basic robot with 4 fixed wheels, with it’s only method of turning is changing one side’s wheel speeds.

I tuned two separate PID controllers, one for the forward velocity of the robot, and one for the angular velocity of the robot. Calculating errors for the heading was a little geometrically involved, but nothing too bad.

The results were pretty good, I measured the results using X and Y RSME from the target path

Screenshot 2023-10-13 at 12.04.24 AM.png

Screenshot 2023-10-13 at 12.05.06 AM.png