Sunday, January 26, 2014

PID Controllers

I have a few ongoing projects where a feedback loop that considers a moving goal and adjusts to achieve that goal is essential. One of these projects is a two wheeled self balancing robot. This type of problem is perfect for a PID control loop. I have been procrastinating biting the PID bullet because I was under the impression that PID was not easy to learn or implement. Thankfully, after much searching, I have found a very straightforward and intuitive overview of PID.






After the above overviews I dug around to find some PID Controller pseudocode.
previous_error = 0
integral = 0 
start:
  error = setpoint - measured_value
  integral = integral + error*dt
  derivative = (error - previous_error)/dt
  output = Kp*error + Ki*integral + Kd*derivative
  previous_error = error
  wait(dt)
  goto start

I am no longer intimidated by PID. Should be fun.

Thursday, January 2, 2014

Photomosaics: framed

In college in 2008 I did a research project on photomosaics. More info can be found in another blog post. One of the mosaics I created was of Albert Einstein's eyes. It even captured the twinkle. Ever since then it has been a source of inspiration for me. This xmas I asked for it to be framed so that I could hang it in my workshop. Here it is behind my desk.



So happy right now...