Mini Reflection on past projects

So back in undergrad and shortly afterwards, I pursued various personal projects that I sorta had an idea they were related to controls but didn’t full grasp the meaning of them yet.

One in particular would be the Inverted Pendulum project. Basing it off other publicly documented project breakdown of their builds, namely the SimpleFOC project and Ben Katz’s blogs, I tried following along the process but went about it in a reverse way. Rather than starting with theory then application, I started application then thought… yea I’ll figure out theory later (given I had a much stronger hardware background).

Unfortunately, my knowledge of control system analysis was extremely patchy and poor. A combination of post-Covid de-motivation, lack of study partners from quarantine, and doubts over whether I actually enjoyed engineering at all made it pretty difficult to absorb course content (especially if it was dense on theory).

Flash forward to today and with a renewed fascination with the actual principles behind engineering, I thought to myself… maybe I should try revisiting these projects? Currently at UC Berkeley, I am taking ME231A and ME232, Experiential and Advanced Control Systems, which have helped with my reflection in trying to make sense of the past. There’s two project in particular I’d like to revisit: The inverted Pendulum and my Senior Year research project.


First up, the Inverted Pendulum aka Furata Pendulum.

As mentioned before, this project fell short at the theory part and my attempts at controlling it with undergrad PID was lackluster. Typically with PID, a linear system like a pole and cart would be much more practical to start (as many introductory demonstrations appear to show), but that also assumes that the system is sufficiently powerful enough to accelerate the cart as needed. My BLDC motors were definitely not.

So to start fresh, I should derive equations of motion and relate them to torque required by the motor. Following that, proper motor sizing can then be made without any guesswork. Implementing and hand-tuning a PID controller after that would be the more simple method but I intend to fully implement an optimal control using whatever I learn from ME231A. That is the current plan and it shares similarities with the methods of Ben Katz, including the intention to make it easy to manufacture and make the project opensource (hopefully pass some along to my professor so it can be used for practical demonstration as well)


Second and more long-term is my senior year research project. I have always felt that this project fell short on research application since it never produced a working physical prototype but I realized now, taking both an optimization controls class and introduction to robotics, that this project demonstrated my research aptitude a lot more than I gave myself credit.

You see, the more interesting part was the robotic simulation, a feature I totally glossed over during my symposium presentation as I treated it like a footnote to my physical prototyping (giving it like 30s of showtime)

It was a MATLAB visualizer I cooked up in like a month because I got fed up with physical parts being delayed where it simulated a robotic actuator moving to discrete positions to change the individual pin’s heights, then deciding where next to go to create a fully rendered image.

The robot chose it’s next position by calculating the weights of various parameters *per* pin like distance away from a set-point, distance from robot, if it was rendered or not, and etc. Then the controller would take the lowest sum and give pass direction to the robot for it’s next action until it requests a new one.

You may be able to see some direct comparisons with MPC optimization as writing optimization problems follow the same steps with cost functions defined by physical characteristics rather than summing arbitrary weights. My project approached it as an unbounded problem and opted for a brute-force method of calculating the cost value of every single point within a simulated region.

In addition, comparisons can be drawn between my visualizer and how ROS is fundamentally set up with publishers, topics, subscribers, and service. Instead of separate nodes running each processes however, I bundled it together in MATLAB with a single object with nested functions, running a ***serial process loop*** that performed both optimization, communication between low-level controlled robots and optimizer, services printing in-process log data from robots, and the actual visualization. It was terribly slow because it did everything serially so it could only be run after rendering the simulation 1 time step per 15-30seconds, slowing down significantly every time the robot finishes its task and calls the optimizer.

Thinking about it now, this gives me some hope and direction that maybe the type of research I’ve been looking for was MPC control instead of AI and RL applications that I did not find personal enjoyment in. I need to establish stronger connections with Berkeley’s MPC lab to get a better understanding moving forward but at-least my 231A professor is the lab’s director.

As for revisiting the project, I was thinking this could be a neat physical simulation of simple optimal control. I will need to continue brainstorming ideas later but it could be interesting if there was some way to implement simple swarm-like behaviors and path planning in an exhibit style showcase, where participants would implement control algorithms in an abstracted but approachable way like block coding and Scatch.


Fun things to consider and it’s making me excited on ways to encourage academic outreach and connection between advanced topics and academia with youth and general public.

Leave a comment