Automated investigation, evaluation and optimisation of simple heating circuits in building automation

. The majority of all control devices of heating circuits, which are maintained by the building management of the city of Cologne, was set according to standard parameters and for this reason show either very slow control behaviour or an increased tendency to oscillate. Specialists who can only optimise the controllers of these systems at great expense of time are often not available. By optimising the controller parameters, however, the controller performance, which is part of the overall building performance, can be improved. This paper deals with a developed system solution that can automatically investigate, evaluate and optimise simple heating circuits with PT n behaviour. The system solution has already evaluated the controller performance of 24 heating circuits from five schools in the city of Cologne. 54% of the rated heating circuits have very sluggish control behaviour and 4% are poorly tuned. The remaining 42% have an intermediate control behaviour. Two schools were also optimised in addition to the evaluation of the control behaviour. After optimisation, six out of eight heating circuits were rated better by at least one performance class than in the initial state.


Introduction
The municipal building management in Cologne maintains several hundred schools, kindergartens and administrative buildings. Thousands of control loops can be found in the technical building systems of the city of Cologne, where some of them are simple control loops with PTn behaviour. Since each controlled system has its own characteristics, the parameters of the controller should be individually adapted to the plant in order to guarantee optimum operation [1]. However, only a few of these heating circuits are optimised, since the controller is usually set according to standard parameters. Less than 20% of these heating circuits have controllers whose parameters are variable and adapt themselves to the control range during operation. An analysis showed that one third of the controller parameters of 241 heating circuits in Cologne schools were set to the same parameters (Table 1). Non-optimised control devices lead to poor response times or an increased tendency to oscillation. In addition, poor control quality can have a negative effect on energy consumption and increase wear on the system components if the control loop is not optimised [2]. The facility managers of the city of Cologne often do not know how the controlling of their heating circuits behaves. In addition, many of those involved lack the know-how or the expert knowledge to be able to improve the controller performance manually. For these reasons, an automated solution is needed to evaluate and optimise these control loops. Figure 1 describes the approach of this automated investigation, evaluation and optimisation concept. First, the control loop characteristics of all heating circuits of the automation station are read out and documented. The evaluation of the heating circuits provides the object supervisor with information on how the control system behaves. The control loop's step response after a setpoint change will be recorded. In order to make the statement of these quality criteria understandable, the control loops are divided into performance classes according to Swanda [3]. For the optimisation, the plant is analysed. The optimised parameters of the control system are calculated with the determined plant parameters. The process of investigation, evaluation and optimisation takes place after a short adaptation of the general conditions without further intervention on the part of the user.

BACnet-Communication via Python
Python is a multiparadigmatic programming language. This programming language has a standard library from which various functions can be imported and called in the program code. The community-based development model allows the standard library to be extended by many modules, which were developed by programmers worldwide and made available free of charge [4][5].
The external library BAC0 is used for the connection with the BACnet automation stations. The system solution connects to the network via BACnet/IP. BAC0 provides simple functions that read and write the objects and their properties on the automation stations in the network. For communication, the local address and the address of the automation station must be specified. [6]

Investigation of control loops
Such an automated investigation can only be conducted if the BACnet objects were created according to certain requirements and have uniform system identification keys. If loop objects are present on the station, only the appropriate properties need to be read out to identify the manipulated variable, the control variable and the reference variable. If no loop objects are available, the control loop characteristics are determined using string comparisons. Substrings must be entered in an Excel table for the manipulated variable, the controlled variable, the reference variable and the limit values of the reference variable. These substrings contain abbreviations based on the system identification key and the requirements for the description of the identification of the control loop characteristics mentioned. The designation of a manipulated variable (here: mixing valve) of the city of Cologne, for example, is 21001HZG401VA01AS01. HZG401 stands for a heating circuit with the corresponding number, VA stands for an analogue control valve and AS stands for the control command of the valve. A score weighting must be assigned to the substrings. These key-value pairs are then loaded in Python into the dictionaries and enable a score evaluation of each BACnet object. Each of these objects receives a score for each of the five control loop parameters of a heating circuit to be identified. The five parameters with the highest value are then the output. This procedure has been tested for systems that have been implemented according to requirements of the city of Cologne. The solution for automated investigation of control loops presented here only works if said implementation has been carried out correctly.
If the BACnet objects have not been created according to the requirements or system identification keys, the control loops to be evaluated and optimised can be entered manually. Here the user is asked to enter a heating circuit designation as well as the object identifiers of the control loop parameters.

Evaluation of the heating circuits
On the one hand, the evaluation of the heating circuits serves to determine whether an optimisation of the controller parameters is necessary. On the other hand, reference values are determined which make a comparison possible after optimisation. In order to be able to evaluate the control behaviour of the heating circuits, a setpoint step from 35°C to 55°C is applied. For underfloor heating circuits, the setpoint value is changed from 25°C to 45°C. Subsequently, the manipulated variable and the controlled variable are recorded for 15 minutes. In addition, the control error is calculated and documented. The sampling interval is one second. To ensure that the acceptance of the other heating circuits in the building does not influence the step response of the heating circuit to be analysed, all other valves are closed beforehand. In order to be able to evaluate the quality of a closed control loop, classical key figures -like rise time, settling time or the maximum overshoot -are first determined from the available step responses. [2].
In addition to the classic key figures, further quality criteria are determined. With the aid of these criteria, the control error and the control effort of a control loop are considered in particular. In order to make these quality criteria comparable, they are standardised after the calculation and thus divided by the number of recorded step response values.
JA defines the absolute manipulated variable travel. For this purpose, the sum of the paths between the value of the manipulated variable and the previously recorded valve position is calculated. An increased actuating effort also increases the wear of the actuator and can indicate an oscillation [3]. In order to evaluate the control error over the entire recording of the step response, the integral of the absolute control error (IAE) is calculated, which allows the areas between the reference variable and the deviating controlled variable to be considered. The IAE is often used to evaluate the control performance [7]. Based on the previously determined settling time and the IAE, the heating circuits are divided into performance classes according to Swanda [3].

Optimisation of the control parameters
So that the parameters of the control system can be optimised and adapted to the plant, the necessary controlled system parameters are first determined. These are the proportional coefficient KS, the compensation time Tg and the delay time Tu.
Since the controlled system characteristics of the heating circuits are not identical and it cannot be assumed that the travel range between 10% and 100% remains constant, the operating range in which the highest temperature rise takes place is determined. The controller parameters are optimised based on this determined proportional coefficient. To determine the characteristic curve, the control valve of a cooled heating circuit is opened from 0% to 10% until the controlled variable has again reached a steady state. The valve is then opened by a further 10%. This process is repeated until the valve is completely open (Fig. 2). All other valves remain closed. The recorded step response with the largest KS is then used to determine the time constants. The required time constants of the controlled system are then iterated. The Python library Scipy is used to model the transfer function of a PT 1 controlled system with random compensation time Tg and random delay time Tu. After modelling, a step response is simulated based on this transfer function (Fig. 3). Subsequently, the deviation between the real and the virtual step response is calculated. As long as the error does not fall below the the maximum error, this process is repeated. The transfer function that contains the proportional coefficient and the compensation time of the plant represents the PT1 element. The delay time is equivalent to the time shift of the PT1 element when approaching the real step response. The system parameters determined are used to calculate the optimised controller parameters according to the tuning rules of Chien, Hrones and Reswick [1]. These parameters are intended to improve the control behaviour of the heating circuit after the disturbance variable has changed. For each heating circuit, PI and PID parameters are calculated and suggested to the user of the system solution.

PRACTICAL APPLICATION RESULTS
With the help of the developed system solution, five schools of the municipal building management in Cologne were evaluated and two schools were subsequently optimised. In order to reduce disruptive influences and not impair school operations, the performance and route analyses could only be carried out in school-free operation. Figure 4 shows the percentage distribution of Swanda's performance classes of the 24 previously tested heating circuits at Cologne schools. About 58% of these heating circuits are either excessively sluggish or poorly tuned. The other 42% have been rated as intermediate. None of these heating circuits are high performing, which leads to the assumption that there is a large optimisation potential in the controller performance.  The first case investigated concerns a heating circuit, which is used to heat various classrooms. The heating system is about 10 years old. The heating circuits, which are available on the automation station, were investigated automatically. The control loop was then evaluated based on the aforementioned quality criteria. Figure 5 shows the distribution of the manipulated variables and shows that the valve works almost exclusively in the range between 70% and 80%. Figure 6 shows, among other things, the behaviour of the controlled variable in the initial state. It takes a few minutes to reach the corresponding set point after the influence of the setpoint step. Due to the difficulty of the control loop, the D component of the controller was added to the optimised controller settings. In the initial state, only one PI controller was set.  Figures 7 and 8 show the control behaviour of the same control loop after optimisation. Here, too, the same setpoint step was given. The manipulated variable is within a similar range as before. One difference here is that the valve opens completely at the beginning of the step response in order to reach the reference variable as quickly as possible. After optimisation, the controlled variable reaches the tolerance range of the reference variable in less than one minute. Table 2 shows the change in some quality criteria between the control behaviour of the heating circuit in the initial state and the control behaviour after setting the optimised controller parameters. The reductions in the time values are noticeable. Both the rise time and the settling time were reduced by more than three minutes. The IAE shows that the control error was reduced by more than 60%. The controlled variable reaches the reference variable faster and persists there for the further course of the recording. Only the actuating effort has increased. This is due to the fact that the valve initially opens more in the optimised state than the valve in the initial state in order to reach the setpoint value as quickly as possible. Then, as can be seen in the graphs, both manipulated variables behave similarly stable in the range from 70% to 80%. The performance class according to Swanda has improved significantly. The second case concerns a heating circuit from another school in Cologne, which is also responsible for heating several classrooms. Figure 9 shows the distribution of the manipulated variables. Here it can be seen that the manipulated variable ranges between 50% and 100%, but for the most part works in the range between 70% and 80%. Figure 10 shows that the flow temperature reaches the setpoint in about two minutes. The control command of the valve oscillates and reaches 100% valve opening at the beginning of the step response. For this reason, the flow temperature does not enter the tolerance range of the reference variable for the last time until after more than ten minutes.   Figures 11 and 12, which show the optimised state, show that the flow temperature reaches the setpoint as quickly as in the initial state and that the manipulated variable is distributed over an even smaller control range than before. The control command of the valve is significantly more stable and the control variable remains within the tolerance range after about four minutes. Since the D component of the controller was not available to the user, only the optimised proportional coefficient KPR and the optimised reset time Ti were set, regardless of the difficulty of the control loop.  Table 3 shows the calculated quality criteria for evaluating the control behaviour. The settling time was reduced by about 67%, whereas the rise time even increased more than threefold. The controller's proportional coefficient in the initial state was higher than in the optimised state. For this reason, the controlled variable reached the setpoint faster, but did not remain within the tolerance range for long due to the oscillations that occurred. It took more than ten minutes for the controlled variable to stabilise. In the optimised state, the flow temperature required more time to reach the setpoint but remained within the tolerance range earlier because no oscillations occurred there. This also reduced the IAE by more than a third. The stabilisation of the manipulated variable also reduced the amount of work required to actuate the valve. The maximum overshoot of the controlled variable over the reference variable increased by about 1K. The control behaviour was improved by one performance class through optimisation. Table 3. Quality criteria for the evaluation of the control behaviour in the initial and optimised state (second heating circuit) Figure 13 shows that at the two schools that have been optimised, the control behaviour of six out of eight heating circuits could be improved by at least one performance class with this automated optimisation concept.

CONCLUSION
The first analyses of heating circuits in the municipal building management have shown that there is potential for improvement in terms of controller performance. Most heating circuits react very slowly or oscillate. The control behaviour can be improved with optimised controller parameters that are adapted to the plants and do not contain standard values. This automated investigation, evaluation and optimisation enables the user to carry out an analysis and optimises the controller performance after a short adaptation of the framework parameters, even without a sound knowledge of building automation or further intervention.