The attached is example code for controlling a temperature chamber. The question is where and when to use PID Gains? This code looks as though the PID Gain is used for the variable/parameter temperature (i.e. the temperature is the controlled variable).
So would there be just one PID Gain per controlled variable/parameter (temperature in this case) or would each device controlling temperature in the system get a PID Gain?
In this example, the fan and lamp are controlling the temperature.