An archive of as of Saturday January 26, 2019.

PID library for Esquilo


As promised here's a PID library for dc motor control (or oven temperature or anything else that needs a loop controller) - pid.nut was taken directly from the Arduino library and seems to be working with a printer carriage and the Esquilo running a simple test that seeks to two alternating Setpoints.

Code: pid.nut
Any improvements, suggestions, etc welcome - I'm not a professional coder.

Video of it in action:

You can just barely hear the 1khz pwm motor whine wink

Next is learn how to use the Timer to fire off a periodic Pid::Compute() and adjust motor settings, while the main loop is controlling the Pid::Setpoint.


That's great! Thanks a lot for sharing.


We added this to the algorithms directory in the Esquilo Squirrel library on Github so everyone can have easy access to it.