A basic PID controller is very little code at all. Here is an off-the-cuff attempt in the .comp format.
Code:
component tpid "A pid component for temperature control";
pin in float command;
pin in float feedback;
pin out float output;
pin in float Pgain;
pin in float Igain;
pin in float Dgain;
license "GPL-2.0+";
author "andypugh";
;;
static double prev_error;
static double integ;
double diff;
double error = command - feedback;
integ += error * Igain;
diff = (prev_error - error) * Dgain;
prev_error = error;
output = error * Pgain + integ + diff;
if (output < 0) {
output = 0;
integ = 0; // Might be right, might be wrong.
}
I haven't actually tried to compile or run this (it's late here). But something very like this, with a few tweaks, would probably do all that is required.
Note that this implementation is absolutely _not_ robust against changes in the servo thread rate. If you change that setting it would need completely re-tuning.