Yes, at least two of us have implemented it now, and there is some code for it in the repository. It’s included in the Emisar lights, Crescendo, and the FSM toolkit… and I’ve been dragging my feet about patching something into Narsil.
While not PID, Narsil already has thermal step-down. It was tuned for the Q8, but didn’t respond fast enough for use on a D4 (much smaller, similar power level). This is what I measured on a D4v1 light (which was way too hot from about 30s to 4m):
Yeah… these things take an inordinate amount of time to test, and I’ve found it tends to be really sensitive to small changes.
I tested a DrJones H17F driver’s thermal response recently, and it looks like his solution was to make the regulation response relatively slow and gradual. In my test, it took almost 8 minutes to reach a stable state… which was fine on the heavy copper host I used, but would be way too slow for something like an Emisar D4. However, it was very smooth and had no significant oscillations or noise. It merely stepped down one PWM level at a time, one channel at a time, until it was no longer overheating. And when ice was held against it afterward, it stepped back up just as slowly. I wouldn’t really say it’s a PID algorithm though, since it didn’t act like one. The I term seemed to be zero, I couldn’t tell if there was a D term or not, and if there was a P term it seemed to have only two states — two steps per second, or one step per second.
My attempts to make a more responsive PID regulator have been less than ideal. It works, but I’m not totally happy with it. After reaching a stable state, it’s still more noise-sensitive than I’d like, and occasionally I’ve measured rather undesirable behavior like oscillations. The response is proportional though, and fairly heavy on the derivative term so it can anticipate and “steer into” the turns, but I’ve mostly only used the integral parts as a way to reduce noise. And, as already mentioned, it’s still not at a point where I’m happy with it. Sensor readings are low-resolution and noisy and subject to thermal lag due to having the sensor in the MCU, and my attempts to deal with the lag have made it even more noise-sensitive.
Here’s FSM’s behavior compared to a H17F:
So… long story short: Yes, but it’s still a work in progress.