Regarding the custom PID controller script: I could have sworn the Linux kernel had a generic PID controller available as a module, which you could setup via the device tree, but I can't seem to find it! (grepping for 'PID' doesn't provide very helpful results lol).
I think it was used on nVidia Tegra systems, maybe? I'd be interested to find it again, if anyone knows. :)
I think it was used on nVidia Tegra systems, maybe? I'd be interested to find it again, if anyone knows. :)