ModSlaveSim help v3.04 - 4.3.4. Room heater - proportional controller

Download manual: HTML

4.3.4. Room heater - proportional controller Introduction and Guide

This variation on the room heater - on/off controller in the previous section has an identical environment (which is explained in the previous section), but uses a proportional controller to control a variable-output heater.


(To load this simulation select the file Room heater proportional controller from File->Simulation Examples....)

When ready to start press Run Slave Simulation. Press it again to stop or pause the simulation.

At the start when you run the simulation, you will see that everything has already stabilized: the heater output is constant and the room temperature is also constant, although lower than the desired temperature of 20 (Temp Set Point), but quite close to it. Unlike the on-off controller, where the room temperature repeatedly goes up and down, the proportional controller maintains a steady temperature. However, it never quite reaches the desired temperature.

Now try changing the outside temperature to -5 and you will see the room temperature falling and the heater output increasing as it struggles to get RoomTemp close to the desired temperature. Eventually the heater output stabilizes and the room temperature stabilizes again at a point below the desired temperature.

Reset OutsideTemp to 5, then change the desired temperature (Temp Set Point) to 23. You will see the heater on full initially (Heater Output is 1), but it starts to reduce as the room temperature gets close to 23, and again everything stabilizes when the room temperature has not quite reached the desired temperature.

If you want a simulation that gets to the desired temperature (or other set point), albeit by overshooting to some degree, skip this and go to the next simulation.

For further guidelines see Running Example Simulations

The program listing and explanatory notes for the simulation follow. Before looking at them, please read the short sections Introduction to programming simulations and Language: Quick Start Guide Slave 1: room heater proportional controller

The table below shows the simple program underlying the simulation.

Table 5. Slave 1: heater controller
Statement Notes
$0 Heater Output
if $2 < 0 then 0
else if $2 > 1.0
then 1.0 else $2
$1 Temp Set Point   SP
$2 Heater OP Unlimited ($1 - $41) * 0.8 CO Unlimited
$40 OutsideTemp    
$41 RoomTemp
$$ + (3000 * $0 + 105 * 
($40 - $$ )) * CycleTime / 15000


  • Heater Output. A thermostat that turns off when the room temperature exceeds the desired Temp Set Point, turns on to full when the temperature exceeds a lower threshold and turns on by a proportional amount in between the upper and lower thresholds.

    if $2 < 0 then 0	- turn off heater
    else if $2 > 1.0 then 1 - turn heater on full
    else $2			- use proportional output

    (Note that the upper and lower limits of heater output are implicit here as constants 0 and 1 - there is no separate register for 'CO Min' and 'CO Max' as there is in the proportional controller section.)

  • Heater OP Unlimited.The proportion of heat to output. It is based on the difference between the desired temperature (Temp Set Point) and actual temperature (RoomTemp) multiplied by the constant 0.8. The constant 0.8 is the controller gain Kc referred to in proportional controller.

    This simulation never quite gets the temperature to the desired temperature, because the heat output is proportional to the difference between the actual and desired temp: the smaller the difference the less heat output. Heat output reduces, therefore, until heat loss exactly matches output, at which point the room temperature and heat output stabilize. If reaching the target temperature exactly is important, have a look at the next simulation.

  • OutsideTemp, RoomTemp See on-off controller example for an explanation.

Note that the correspondence between register names and the names in the techniques section is contained in the Notes column.