My first little PID: please comment

johnwasser:
Since the AVR compiler uses the same size float for both float and double there is no real need to make that data type adjustable.

Hahaha, didn't know that.

johnwasser:
Is your DeltaTime in seconds, milliseconds, or microseconds?

Does it matter? The idea is that the user of the class uses what he/she needs. High sample rate probably uses microseconds, lower sample rate probably uses milliseconds. Don't think seconds would be to useful assuming you would want a sample rate of at least a couple a times a second...?

johnwasser:
If you have multiple PID loops running at different sample rates, how do they get their individual DeltaTime from BaseT::getDeltaTime()?

The idea of the class is that it only implements the PID process algortithm, nothing else. You have to stack (template) classes on top of each other in order to get what you need. So in this case the base class would be responsible for managing the delta time.

johnwasser:
I would use member functions to set setpoint, gainP, gainI, and gainD rather than pass them as arguments each time.

I purposely did not do that. The thinking here is that first I do not want to make that assumption for the user (taking up extra RAM bytes) - remember this is a library. The only bytes taken are needed for the algorithm. Second the method parameters are the input-values that can change, while the BaseT::Xxxx methods are the information it needs to perform the algorithm. This also allows specifying constants without permanently taking up RAM bytes.

Thanx. Did you see any errors in the math?