Side note for anyone else following this conversation.
The initialism PID has two distinct definitions here:
- PID in context of communicating with the PCM/ECM stands for "Parameter ID", or essentially an identifier of a floating value stored in the ECM that monitors the status of a particular sensor, switch, etc. For example, your OBD-II reader can read PIDs for coolant temperature, road speed, fan status, locker relay status, gas tank level, oxygen sensor voltage, etc.
- PID in terms of a control system stands for Proportional-Integral-Derivative control. PID control is a mathematically-based control scheme that is widely used in industry when you are trying to maintain a fixed state of a variable to the maximum extent practical, when you only have the measurements of that variable itself. PID control reacts to Proportional and Integral like @freedom_in_4low mentioned, as well as Derivative, which reacts in accordance with the rate of change. Most PID control schemes are self-tuning to a degree, meaning they refine their parameters over time to maintain more accurate performance.
A classic example of PID control we are all familiar with is cruise control. Cruise control, in the TJs, is fully controlled by using PID control on the vehicle speed (which is a Parameter ID in the ECM, or the other "PID" term).
Proportional is very simple. Is the speed lower than your set speed? If so, the throttle is set in proportion to the instantaneous difference between your set speed and your actual speed. Meaning it will set high throttle if you're 10 mph below, but minimal throttle if you're 10 mph above.
Integral is a bit more complex. Basically, the controller observes the difference in set speed and actual speed over time. If you're consistently 1 mph below target, integral adjusts the throttle in proportion to the sum of the differences times the time delta of the differences. So it will ramp in even if the proportional status can't change. This is important because load conditions are always changing. Have a headwind? You now need more throttle to maintain the same speed than you would with a tailwind. Integral is slow to react, but seeks to eventually resolve any differences not made up with propotional control.
Derivative is the "oh shit" part of the control scheme. It watches the rate of change of the parameter, and reacts to how fast the parameter is changing. For example, if your speed begins to slowly drop due to a slight hill, proportional and integral control will keep the speed close enough that the speed doesn't rapidly change. However, if you hit a big incline, the speed drops rapidly, and the Derivative function reacts to that by suddenly adding throttle, even where Proportional and Integral would not do so nearly as aggressively, at least not right away. This also helps prevent your speed from rapidly rising when you crest a hill, since the Integral function takes far more time to react. It also helps attenuate rapid corrections in speed that Proportional and Integral might try by themselves, so the end result is smoother rather than jerky.
The other most common control scheme is called "Bang-Bang". Literally this is "on" at a given setpoint, and "off" at a given setpoint. Your water heater thermostat is a perfect example. Is the water temperature below your set value? Turn the element on. Is the water heater above your set value by an amount equal or greater to than the built in hysteresis? Turn the element off again. (Hysteresis is the difference between the "on" and "off" values, and is intended from keeping the device from rapidly cycling on and off.) Back to TJs, an example of Bang-Bang control is your A/C clutch. Is the pressure too low/high? If so, cut the clutch. Is the pressure back within acceptable parameters? If so, engage the clutch.