Mark: A new boiler surely the least enjoyable way to spend £1,000. At least throwing the money out of the window you’d see the scrabbling masses, the hate filled faces. I have spent a cool Grand on acquiring the resumption of an equitable temperature.
Jez: Yeah too right I’m freezing let’s whack it up to 29.
Mark: 29° are you insane?
Jez: I don’t actually want it to be 29 but you got to give it something to aim for! It’ll get hotter quicker!
Mark: No it won’t; it’s either on or off! You set it, it achieves the correct temperature it switches off.
Jez: Oh sure you set it to 23 it’ll be puttering along “oh yeah 23 easy yeah nearly there”. Wouldn’t you rather “FUCK 29!? Christ let’s get cracking got to generate some serious heat” and then when it hits 23 we’re suddenly all like “‘click’; sorry already there”. And the boiler will be like “what the fuck?”.
Mark: You want to try to trick the boiler…
Jez: yes.
Mark: And you seriously think this will work?
Jez: yes.
[Marks eyes glaze over. In the next room the stereo system begins playing ‘Bam Bam’ by Sister Nancy on BBC Radio 4.]
Mark: Yes Jeremy? Do you ever stop to think about the words that come out of your mouth?
Jez: Yes I do actually… Look at you pretending like you know how the boiler works! Look man, it’s your boiler, I’m just saying we need to have these machines doing what we want them to do..
Mark: And you intend on achieving that through this chicanery? It’s a piece of impartial electrical circuitry for fuck sake. When the temperate is less than the desired temperate, as measured by the thermostat, the controller turns the boiler on!
Jez: No it doesn’t. If the temperature is like freezing your balls off then the boiler comes of full wellie. But if it’s only 1deg below what we want, it’s barely going to do any thing about.
Mark: is he right? this would be very embaressing if he were right, I’m just going to cut this off and do some research later on my computer when he’s not looking.
Mark: Right Jeremy I don’t have time for your non-sense right now, I’m going to play laser tag with Do… on my own.
[Mark brushes past Jez on his way to the door.]
Jez: Whatever.
[Later that evening Mark arrives home, and loads up NetScape on his Dell OptiPlex workstation and begins researching the inner workings of boilers. An increasingly pronounced wrinkle develops on his forehead while he clicks through from the wikipedia page for ‘Heating Systems’ to ‘HVAC Control System’ and then to ‘Control Theory’. But is at once relaxed when the text under ‘Bang-Bang (On/Off) Control’ slides up from the bottom of the screen and he begins reading. I have you now Jeremy you stupid bastard. “[Bang-Bang Controllers] are used in applications requiring feedback control where the plant is restricted to two states, for example a boiler which is completely on or off. Most common residential thermostats are bang-bang controllers.”
Mark stretches back in his wheeled ergonomic office chair and interlocks his hands upon his forehead, palms out. And blows a long exhale, reveling in the comfort of being right, again. Its was a dry 10 minutes of research but it’s good to be sure about these things.
Some 20 seconds pass for Mark in this tense stretch when a most uncomfortable sensation begins to stir him. He closes his eyes and his brain thus begins disregarding the input of his sight. In a clamor of thought cycles from the depths of his cranium comes a whisper, then a word, then a shout of a trailing off sentence: “Most common resid……..”, “MOST”, most?? Oh God no…. On and on and on these words scurry around in him as his heart rate quickens. Before he knew it the screen and keyboard were racing toward him as he jolted upright and forwards. Another short paragraph shot up from the bottom of the screen under the heading “P, PI, and PID Control”….
### BEGIN WIKIPEDIA ARTICLE ###
P, PI, and PID Control
Proportional Control
Proportional control is a rudimentary control method rarely used in isolation. By taking a measurement at each time-step of the plant output and subtracting this from the desired plant output we arrive at an ’error’. By multiplying error by a constant ‘K’ (here called the proportional gain) we can generate a signal to send to the back into the plant which instructs it on how much to change its output and in what direction.
$$ P = K_p e $$The issue with proportional control is that in essence it doesn’t consider that future / the result of how high or low it is setting the plants operation; thus in systems where the plant may carry some inertia it is prone to overshooting the target.
Integral Control
Proportionally controlled systems also suffer from a concept called steady-state error where by vice of environmental or load conditions the system cannot maintain its desired state once arrived at. An essential metaphor / hypothetical for understanding this is a central heating system. If, say, 40% heating power is required for a room to maintain it’s desired temperature of 21deg - i.e. to combat the heat lose throught the walls, then the error term must be non-0.
To combat this we introduce the integral of the error; thus preserving some history of measurement values over time, not just from the previous duty cycle:
$$ I = K_i \int e\,dt $$Derivative Control
A combination of Proportional and Integral control is enough for may applications as the desired state will be reached and maintained eventually. However the use of an integral term will still allow the system to over shoot its target; do combat over shooting a third term my be introduced that measures the rate of change / acceleration. In effect, the system will begin slowing down / decelerating as it approaches its target state.
$$ D = K_d \frac{de}{dt} $$PID Control
PID control systems are used in any and all applications leveraging electronic actuation and regulation: elevators accelerating and decelerating toward their target floor in a building, electric motors in cars, garage doors, farm equipement, giant ‘chop sticks’ for catching rocket boosters, and many more.
Comparison of P, PI, and PID Control.

Diagram showing how PID control systems

### END WIKIPEDIA ARTICLE ###
Mark: Oh for crying out loud!
BA BA BA BADA BA!
…
BA BA BA BADA BA!
[Mark returns to the living room in the late evening look quite worse for ware. His eyes seem sunken and the remains of several digestives biscuits. are clinging to his night-gown. Jez listening to something on his Sony Walkman.]
Jez: 🎵 Bam-bam, bambam bee-dam, bam-bam 🎵. You look like shit!
Mark: Yea Jez, I’ve been meaning to talk to you…
Jez: Look if this is about the digestives, I know… and I’m sorry but it really couldn’t be helped…
Mark: No, Jez, look, I wanted to talk to you about what I said earlier about the boiler…
Jez: What?
Mark: The boiler Jez, look, I know this isn’t something you care too deeply about, but I need to come clean… I have recently, shall we say Jez, come to the understanding that the new boiler actually does have a much more, lets say, autonomous way about it.
Jez: … an autonomous way about it? What the fuck does that even mean, are you saying this thing might try to kill me Mark?
Mark: NO! Jez it’s more like..
Jez: it’s more like the boiler is going to fuck me Mark is that it?!? Is that what you are telling me!?
Mark: NO Jeremy! I’m just trying to say that it’s possible that the boiler may be tricked in to… doing what you want it to do…
Jez: Oh.. God.. Mark.. I know you and… but this is too strange man, you’re really beginning to make me uncomfortable..
Mark: The Fucking temperature Jeremy, you can trick it into making the flat warmer, faster for fuck sake.
Jez: oooooh the temperature, yea I’m freezing now that you mention it. Turn that shit up to 29deg to make it get warm fast!
[Mark rolls his eyes in total dejection. Exacerbate he goes to bed and dreams a strange dream of driving a tram, pushing and pulling two levers until such time passes that they no longer operate smoothly. All of a sudden the tram is hurtling towards a bend and… GASP… he bolts upright in bed. Fucking hell!]
Mark: Jeremy what hell are you doing on my computer.
Jez: Watching youtube :)
Mark: It’s… *checks alarm clock* It’s nearing 2am Jeremy!
Jez: Look at this one haha youtube.com/watch?v=P4_6e5IaQXM
Mark: :o
