Abstract:
Apparatus for controlling at least one variable output parameter in response to a variable predetermined input parameter in a process system, such as a digital thermostat. The apparatus provides adaptive control of the output variable by utilizing a controller means that includes an adaptive controller means, an identifier means and a tuner means. The identifier means defines a model having parameters which represent the operational characteristics of the process system, and the identifier means monitors the operation of the adaptive controller means and selectively changes the parameters of said model to improve the operation of the adaptive controller means. The tuner means receives the model parameters from the identifier means and calculating robust and reliable values of said predetermined gain factors and applying the same to the adaptive controller means for use thereby.

Description:
CROSS REFERENCE TO RELATED APPLICATIONS 
     Direct Digital Control Thermostat, Ser. No. 08/078,605 filed Jun. 16, 1993, by Gorski, et al. 
     This is a CIP application of application having Ser. No. 08/279,716, filed Jul. 25, 1994, which is a CIP application of Ser. No. 08/078,733, filed Jun. 16, 1993, both now abandoned. 
    
    
     FIELD OF THE INVENTION 
     The present invention generally relates to a process controller that has either proportional-integral control functionality or proportional-integral-derivative control functionality, and more particularly to such a controller that has adaptive control capability. 
     There has been a need for controllers for controlling a single variable in many kinds of processes that provides effective control. One of the applications for such controllers is readily apparent to all individuals in an indoor environment is that of temperature control. Ineffective temperature control of an indoor environment is readily apparent to those who are uncomfortable, and there is a continuing need for effective control of heating, ventilating and air conditioning systems in all types of buildings. 
     Controllers have been developed which are increasingly more sophisticated, and with advancements in electronic technology, more robust control capability can be achieved and implemented at reasonable cost. Controllers which control a single loop, i.e., control a single variable such as temperature, humidity or the like, by controlling an output have been implemented, and improved control has been achieved by implementing control schemes which include three separate factors or components. These include a proportional gain factor, an integral gain factor and a derivative gain factor. Such PID controllers can provide better control because they determine the derivative as well as the integral of change of the error over time, in addition to the error that is determined at a particular time, to control the controlled variable. 
     While such PID controllers offer many advantages over controllers which merely provide proportional control, there is a need for improved PID controllers for particular applications and uses. 
     Accordingly, it is a primary object of the present invention to provide an improved PID controller that has adaptive control capability that has many possible applications. 
     Another object of the present invention is to provide an improved PID controller having adaptive control capability that is particularly suited for controlling a single control loop, i.e., a single variable is controlled and provides a single output. 
     Yet another object of the present invention is to provide such an improved adaptive controller for controlling a single loop, but also has the capability of operating in series with other single control loops. 
     Still another object of the present invention is to provide such an improved adaptive controller that has the capability of operating in a cascaded configuration of control loops. 
     Another object of the present invention is to provide such an improved adaptive controller that utilizes an internal model of the application that is to be controlled, which model matches the expected application, and which during operation, tunes itself in response to load, equipment or time changes. 
     A related object lies in the provision of examining the input, comparing the input with what it should be and then changes the parameters within the internal model to move actual conditions closer to the desired condition, and provide control of the output in accordance with the changed internal model. 
     A detailed object of the present invention is to provide an improved thermostat which also has the capability of providing adaptive control, i.e., during operation, it will monitor itself in terms of its effectiveness in control, and will generate more effective operating parameters within specific algorithms to provide more accurate control. 
    
    
     Other objects and advantages will become apparent from the ensuing detailed description, while referring to the attached drawings, in which: 
     FIG. 1 is a perspective view of a thermostat embodying the present invention; 
     FIG. 2 is a schematic diagram of a unit ventilator shown with a thermostat embodying the present invention; 
     FIG. 3 is a perspective view of internal structure of the thermostat shown in FIG. 1; 
     FIGS. 4 a,    4   b  and  4   c  together comprise a detailed electrical schematic diagram of the circuitry of a thermostat embodying the present invention; 
     FIG. 5 is a block diagram of the adaptive loop control system showing the relationship between the control system and the room; 
     FIG. 6 is a block diagram of the adaptive controller; 
     FIG. 7 is a detailed flow chart of the adaptive controller, and particularly illustrating the controller shown in FIG. 6; 
     FIG. 8 is a detailed flow chart of the adaptive control system and particularly illustrating the identifier shown in FIG.  6 . 
    
    
     DETAILED DESCRIPTION 
     The present invention is directed to a PID controller that has adaptive control capability. The controller may be operated in many PID process control applications, and is ideally suited for various applications in the HVAC art. It is adapted for use in controlling a single loop, i.e., controlling one variable with one output, and can be optimized for a particular application such as room temperature control. Other examples of use where a single adaptive loop is desirable and for which the present invention is suited are: room temperature control of a unit ventilator or a constant volume damper application; humidity control in a duct or room; discharge air temperature control by controlling a valve, coil or bypass damper; flow control; mixed air/water control; and static pressure control. 
     Single adaptive loops can be strung together in series. For example, one adaptive loop can control the air temperature in a supply duct, while another can control the temperature of a room by modulating a damper in the supply duct. Such series loops are not interlocked and can be controlled by two separate control algorithms. Single adaptive loops can be interlocked in a cascade arrangement. For example, a unit ventilator uses discharge temperature control, and one adaptive loop can control the discharge air temperature by modulating a coil valve or bypass damper. Another adaptive loop can control the room temperature by setting the discharge air temperature setpoint for the inner adaptive loop. Such cascaded adaptive loops can also be used in dual duct control, and can be controlled by one controller running both adaptive algorithms. 
     While the present invention is suited for the above applications, as well as others, the present detailed description describes an application of the controller in a thermostat of the type which can be used in a unit ventilator of the type which has pneumatic controls. 
     It is well known that many building heating, ventilating and air conditioning systems are controlled through the use of pneumatic controls wherein the pressure in the pneumatic lines are controlled and the variable pressure in turn controls pneumatic control valves. The control valves are then used to control the position of dampers, as well as valves which admit heat to heating coils and the like. Prior art thermostats for such systems have the capability of adjusting the temperature set point for the room or other enclosed area which the thermostats are intended to control, and the thermostats normally operate to provide a controlled pressure in a pneumatic line which is connected to control elements such as dampers, valves and the like and such thermostats operate to admit increased pressure from a pneumatic supply line for the purpose of increasing the temperature and to decrease the pressure in the control line when the temperature is to be reduced. The controlled pneumatic pressure typically adjusts the position of the valves, dampers and the like to regulate the temperature in the controlled area. Additionally, there are many buildings which are controlled by pneumatic thermostats which control the operation of unit ventilators, such as are often used in schools. Such unit ventilators are typically stand-alone units and have a fan for circulating air, a heating coil through which steam or hot water may circulate with the amount of flow therethrough being regulated by a valve. While such mechanical pneumatic thermostats adequately control the temperature in the area which they are located, they are generally stand-alone units from a system standpoint, except for the capability of being switched between day/night operation by changing the pressure in the supply pneumatic lines, as is well known in the art. 
     The controller embodying the present invention can be incorporated into a digital thermostat which is capable of use in a pneumatically controlled temperature control system of the type which has a pneumatic supply line which extends to various components of the control system and wherein the control elements of the system are controlled by varying the control pressure that is communicated to such elements. For example, pressure within pneumatic control lines may vary to adjust the position of dampers, control valves or the like which control the volume of steam, air and water to heating coils, radiators or the like, or in the case of dampers, controlling the amount of air that is forced into the space that is being controlled. 
     Such systems generally have been controlled by a pneumatic thermostat that is essentially mechanical in nature and wherein adjustment of the set point for the desired temperature has been performed by manual manipulation and except for the capability of providing day/night modes of operation, very little control is possible through the thermostat. The thermostat embodying the present invention is intended to be operable with such a pneumatic control system and is capable of stand-alone operation or with an integrated supervisory and control system if desired. Because of its superior design, it is capable of being merely substituted for a prior pneumatic thermostat without any other alterations or modifications to the control elements or the heating apparatus. 
     The thermostat embodying the present invention can be substituted for a pneumatic mechanical thermostat which controls a unit ventilator of the type which has been commonly used in school systems and the like. Such unit ventilators generally have a fan, a heating coil of which the heating element is steam, hot water or electrical. Such unit ventilators generally do not provide air conditioning in the true sense, but have outside dampers which are capable of admitting outside air which may often be cooler than air in the room. Typically, such unit ventilators are operable in a stand-alone mode and do not have system-wide capabilities which are extremely desirable in terms of efficient energy usage. 
     Another advantage of the thermostat is that it can be either battery powered or can be connected to an independent power source and it can also be connected via a two wire cable to a communication network, commonly a local area network or LAN, so that it can be operated as a part of a total supervisory and control system. The thermostat embodying the present invention includes a processing means having internal memory and is therefore capable of running relatively complex control algorithms which are capable of providing proportional control, integral control, as well as derivative control, among other control schemes, such as a Smith predictor type of control scheme. 
     Day/night and heat/cooling modes of operation can be achieved, with different temperature set points for each mode of operation. The thermostat is manually adjustable so that its set point can be adjusted at the location of the thermostat to suit individual needs if desired, or it can be programmed so that it is not responsive to such individual controls during certain time periods or the like. 
     Turning now to the drawings, and particularly FIG. 1, a thermostat embodying the present invention, indicated generally at  10 , is illustrated and includes an outer enclosure  12  having opposite end walls  14 , opposite sidewalls  16  and a front wall  18 . The sidewalls preferably have a plurality of openings  20  therein through which air may pass so that a temperature sensing device located within the enclosure will measure the temperature of ambient air in the area which the thermostat is intended to control. In the front face  18  of the thermostat  10 , a display  22  is shown. 
     The display is preferably a liquid crystal display which will illustrate the time and current temperature, but may display other information, including the temperature set point of the thermostat, whether it is operating in one of the day or night control modes and the like. The thermostat preferably has a pair of switches  24  and  26 , which are illustrated to be up and down arrows and are provided to enable the temperature set point of the thermostat to be either increased or decreased upon pushing the appropriate pushbutton. 
     Since the thermostat must effectively interface pneumatic lines and electrical circuitry, it is preferred that the electronic components be constructed using a printed circuit board such as is shown in FIG. 3. A processing means  28  is provided, as is a temperature sensing device, preferably a pair of thermistors  30  and other electrical components, which are illustrated in FIG. 4, and which are mounted on a printed circuit board  32 , but which are not shown in detail in FIG.  3 . Connectors  33  are provided for connection to the display  22  and switches  24  and  26 , with the number illustrated in FIG. 3 not being the total number of such connectors but being diagrammatic of the intended construction. It should be understood that a ribbon or zebra connector  35  may be utilized or other appropriate conductors and connectors which are well known in the art. 
     The connectors  34  are intended to connect the circuitry of the printed circuit board  32  with the electrical pneumatic components that are attached to a base  36  and additional connectors  38  are provided to provide connection to the local area network and to a source of power. The base  36  has a number of openings, not shown, through which the power and LAN connectors may pass. The base plate also has internal ports to which pneumatic lines can be attached, and to this end, the pneumatic supply port  44  is shown connected to an electropneumatic valve  46  to which another pneumatic port  48  is attached and which comprises the controlled output. The port  48  is also connected to a second valve  50  which in turn is connected to a bleed port  52 .It should be understood that the electropneumatic valves  46  and  50  are shown to be generally cylindrical and may be in the form of conventional solenoid valves. However, it should be understood that any suitable control device may be used which is operable in response to appropriate electrical signals being applied thereto. It is conventional practice that the pneumatic pressure in the control port  48  is variable within the range of the supply pressure and atmospheric pressure, and the controlled pressure may be adjusted by operating one or the other of the control valves  46  and  50 . 
     The valves operate to selectively communicate air among the ports  44 ,  48  and  52  when they are open and isolate one from another when they are closed. In this regard, the pressure in the controlled output port  48  may be increased by opening the valve  46  which communicates the higher supply pressure to the controlled output port. Similarly, if it is intended to decrease the control pressure within the port  48 , the valve  50  may be opened to bleed pressure to atmosphere via port  52 . The output port  48  may have a small molded manifold piece which is in communication with port  48  and which also includes a pneumatic transducer element, diagrammatically illustrated at  54 , for providing an electrical signal to the circuitry of FIG. 4 which is indicative of the controlled pressure in port  48 . 
     The thermostat  10  is adapted for use with apparatus such as a unit ventilator, the schematic diagram of which is shown in FIG. 2, and which has a fan  60  and a pneumatic electric switch  62 , for turning the fan on when it is otherwise placed in condition for operation. The thermostat  10  is shown with power lines  64  and LAN lines  66  which can be connected to a remote central control station  67 . The thermostat  10  has a pneumatic supply line  44 ′ attached to port  44  and an output line  48 ′ attached to port  48 , which line  48 ′ extends to a valve  68 that admits hot water, steam or the like to a heating coil  70 . The pneumatic line  48 ′ also extends to a pneumatically controlled damper control  72  and to another valve  74  which controls the flow of steam, hot water or the like to an auxiliary radiation coil  76 . 
     With respect to the electrical schematic circuitry of the thermostat  10 , and referring to FIGS. 4 a,    4   b  and  4   c,  the circuit components which have been previously identified have been given the same reference numerals in this figure for consistency. The circuitry is driven by the processing means  28 , (FIG. 4 a ) which is preferably a model 68HC11 micro-controller manufactured by Motorola. The micro-controller is driven by a clock circuit comprising a crystal  80  that is connected to pins  7  and  8 . Pins  9 - 15  extend to the display  22 , via a display driver integrated circuit of conventional design which is not shown. 
     The valves  46  and  50  are illustrated in FIG. 4 a  as being solenoid valves and the solenoid which increases the pressure  46  is driven by lines from pins  37  and  38 , through a driver circuit  82 , while lines from pins  35  and  36  operate the pressure reducing solenoid  50 . In this regard, when the solenoid is initially actuated, the up line from pin  37  is activated and it is held by a signal on line from pin  38 . The circuitry also includes a power up/down reset circuit  84 . Power lines  64  (FIG. 4 c ) are preferably 24 volt alternating current lines that are applied to a full wave rectifier, indicated generally at  86 , (FIG. 4 c ) which is applied to a switching mode power supply circuit  88 , preferably a Model MC34129 manufactured by Motorola. It supplies plus and minus 5 Volts D.C. (VDC) on lines  90  and  92 , respectively, which are distributed to various portions of the circuitry as illustrated. 
     Additionally, lines  90  and  92  are connected to an integrated circuit  94  which provides a reference voltage of 1½ VDC on line  96  and a 4.1 VDC reference voltage on line  98 , both of which are respectively connected to pins  51  and  52  of the micro-controller  28 . The switches  24  and  26  are connected to pins  49  and  47 , respectively, for adjusting the set point of the thermostat and lines  100  are provided as spares for other functional input signals that may be desired. The temperature measuring function is performed by the pair of thermistors  30  connected in parallel with one another which provide an electrical output to the micro-controller at pin  45  that is proportional to the temperature that is sensed. In this regard, two thermistors are used to provide an average value for use by the micro-controller  28 . 
     The pressure transducer  54  has positive and negative outputs which are connected to an amplifier circuit, indicated generally at  102 , which provides an amplified signal to pin  43  of the micro-controller. Communication with a LAN network via line  66  is provided by circuitry associated with a RS485 transmission receiver integrated circuit  103  which has lines  104 that extend to pins  20  and  21  of the micro-controller and a select line  106  that extends to pin  42  thereof. 
     The flow chart for the adaptive control algorithm that controls the operation of the thermostat is shown in FIG.  5  and has a room temperature set point applied by a control dial switch on the thermostat itself or is supplied by a remote control station via the LAN communication. The adaptive controlling algorithm continuously calculates robust controller gains required for accurate temperature control in a room. As the properties and characteristics of the room change, the algorithm adjusts the controller gains appropriately to maintain robust control. The algorithm adapts particularly well to gradual changes in room parameters. Sudden changes, such as a large rise or drop in the temperature of the water going to a heating or cooling coil, cause temporary fluctuations in room temperature, as they would with any controller, but the adaptive controller retunes itself and returns the room to good control. 
     The algorithm is a single loop controller. One input, Y q (n), from the room temperature sensor  108  is applied via line  110  to the controller  112  and it provides an output U(n) on line  114  to block  116  which represents the dynamics of the room and the actuator. The output X(t) represents the temperature rise or fall in the room due to the operation of the actuator. The room model symbolically has a summing junction  118  which receives the units of temperature X(t) and the load and the room temperature is represented by Y(t) on line  120  which is sensed by the sensor  108 . The load is defined as any temperature effect in the room which is not a direct result of the control efforts as applied through the actuator. The room temperature Y(t) is sampled by the sensor and quantized by no more than 0.25 degrees F., generating signal Y q (n). 
     As is shown in FIG. 6, the adaptive controller  112  itself consists of three primary blocks, which consist of a controller block  122 , a tuner block  124  and an identifier block  126 . These blocks define an algorithm for room temperature control. The controller  122  uses the room temperature setpoint r(n) on line  128  and the measured room temperature Y q (n) to create a control signal U(n). This signal drives an actuator in such a way as to keep the measured room temperature at the setpoint. The identifier  126  uses the control signal from the controller and the actual room temperature signal to recursively calculate appropriate parameters for a second order room model, and outputs the parameters in the form of a vector Q aux , identified at  130 , and a factor k on line  132  which represents the number of controller sampling periods in the calculated room time delay. Each room has different model parameters, and these parameters can change over time. The identifier is able to zero in on these parameters and track them as they move. The tuner block  124  uses the room model parameter estimates generated by the identifier and calculates appropriate controller gains, i.e., the proportional gain factor K p  on line  134 , the integral gain factor K i  on line  136  and the derivative gain factor K d  on line  138 , for the controller  122  to use. 
     Referring to FIG. 7, the controller  122  is illustrated and comprises a Smith Predictor structure with an imbedded PID controller. The estimated room model is used in the structure, but it is divided into two parts. The first part contains the dynamic elements of the model and the second part contains only a time delay. The principle of the Smith Predictor is simple; if the estimated room model is exactly right, then the signal C(n) will be equal to the output of the room, X(n) . The signal (Y q (n)−C(n)) will then be equal to the load. The problem of controlling the room, with its time delay, is then reduced to the problem of controlling the dynamic part of the estimated room model with no time delay. The Smith Predictor limits if not eliminates the effects of a time delay. 
     The structure of the controller  122  is shown in FIG. 7 to have a PID controller  140 , a room dynamic model  142  and a room delay model  144  interconnected as shown. The output U(n) is applied via line  114  to the room dynamic model  142  and the model block  142  provides an output A(n) on line  146  that is applied to the room delay model  144  and to a summing junction  148 . The output of the room delay model  144  is C(n) on line  150  and it is compared with the sensed room temperature Y q (n) on line  110  and the difference determined by summing junction  152  is applied to the summing junction  148  via line  154 . The output of the summing junction  148  appears on line  156  that is compared with temperature set point r(n) from line  128  at summing junction  158  to provide an error signal e(n) on line  158  that is applied to the PID controller  140 . 
     The PID in the controller is a standard digital PID. The P, I and D terms are calculated separately and added together and limited between given high and low limits to create the output U(n). The formulas are as follows:          P        -        term     =       K   p     *     e        (   n   )                   I        -          term        (   n   )         =       (       K   i     *     e        (   n   )       *     T   s       )     +     I        -          term        (     n   -   1     )                     D        -        term     =         K   d     *     (       e        (   n   )       -     e        (     n   -   1     )         )         T   s                       U        (   n   )       =                  (       P        -        term     +     I        -        term     +     D        -        term       )                   limited                 between                 given                              high                 and                 low                 values                                  
     where e(n)=input error signal, (temp., setpoint, r(n), minus the prediction error (line  156 , FIG.  7 )), T s =controller sampling period. The foregoing discussion relating to the controller shown in FIG. 7 also applies to a controller having only proportional-integral control functionality. In such a controller, the above defined D-term would not be present. 
     The room model includes effects from the actuator, the temperature sensor, and the room itself. The dynamic part of the room model is represented by the second order equation:            A        (   z   )         U        (   z   )         =           b     1      Q       *     z     -   1         +       b     2      Q       *     z     -   2             1   +       a     1      Q       *     z     -   1         +       a     2      Q       *     z     -   2                                    
     which can be rewritten into the following vector equation: 
     
       
           A ( n )=(− A ( n− 1)− A ( n− 2) U ( n− 1) U ( n− 2))* Q   aux   
       
     
     where Q aux =(a 1Q  a 2Q  b 1Q  b 2Q ) T , a vector containing the room parameters. 
     The room delay model simply delays the signal A(n) by the time k*T s . The formula is: 
     
       
           C ( n )= A ( n−k ) 
       
     
     where k is the time delay length in sample periods. 
     The tuner  124  calculates PID gains for the controller using the Zeigler-Nichols tuning formulas. Instead of going through the painstaking and time-consuming process of raising the P-gain in successive trials in order to find the “ultimate gain” (K max ) and the associated period of oscillation (T 0 ), as the classic tuning procedure requires, the ultimate gain and the period of oscillation are calculated analytically, directly from the auxiliary room model parameters. The formulas for these calculations are:          K   max     =       (     1   -     a     2      Q         )       b     2      Q                 h   =     0.5   *     (       a     1      Q       +       K   max     *     b     1      Q           )                 T   o     =       Ts   *     (     2   *   π     )           tan     -   1                (     1   -     h   2       )       (     -   h     )                                    
     The following formulas are then used to produce robust PID gains:          K   p     =     0.6   *     K   max                 K   i     =       2   *     K   p         T   0                 K   d     =     0.125   *     K   p     *     T   o                              
     In the event a proportional-integral controller is employed, the following formulas are then used to produce robust PI gains: 
     
       
           K   p =0.45 *K   max   
       
     
     
       
           K   i =1.2 *K   p   /T   o   
       
     
     The identifier shown in FIG. 8 is comprised of six blocks: the two difference operators  160 ,  162 , a time delay identifier  164 , a functional coefficients identifier  166 , a coefficients filter  168 , and a stability supervisor  170 . 
     The difference operator blocks  160 ,  162  simply subtract the previous value from the current value. These blocks are required because the two identifier blocks  164  and  166  require only the change in a value from sample time to sample time, not the actual value itself. The signals which pass through the difference operators are the output from the controller (U(n)), and the measured room temperature (Y q (n)). The equations used are: 
     
       
           Ui ( n )= U ( n )− U ( n− 1) 
       
     
     
       
           Yi ( n )= Y   q ( n )− Y   q ( n− 1) 
       
     
     The coefficients identifier determines recursively the values of a set of model parameters which cause predicted model outputs to most closely match the room response to the controller&#39;s action. 
     The algorithm used is the Recursive Instrumental Variables algorithm. The actual algorithm used, in vector/matrix formulation, is as follows:        T   =       (       -     Yi        (     n   -   1     )         -       Yi        (     n   -   2     )                       Ui        (     n   -   k   -   1     )                       Ui        (     n   -   k   -   2     )           )     T             W   =       (       -     h        (     n   -   1     )         -       h        (     n   -   2     )                       Ui        (     n   -   k   -   1     )                       Ui        (     n   -   k   -   2     )           )     T               h        (   n   )       =       W   T     *     Q   aux                 e        (   n   )       =       Yi        (   n   )       -       T   T     *   Q               K   =         P        (     n   -   1     )       *   W       (     β   +       T   T     *     P        (     n   -   1     )       *   W       )                 Q        (   n   )       =       Q        (     n   -   1     )       +     K   *     e        (   n   )                             P        (   n   )       =                  (     1   /   β     )     *     (     I   -     (     K   *     W   T       )       )     *     P        (     n   -   1     )                       (   covariance                                matrix                 update     )                                             
     where β is a forgetting factor. 
     The coefficients filter  168  filters each of the estimated model parameters held in vector Q. The filter  168  is required to ensure that model estimates change very smoothly, which will allow the controller to control more smoothly. The filter  168  used is as follows: 
     
       
           Q   aux ( n )=(1− r )* Q   aux ( n− 1)+ r *( Q ( n )) 
       
     
     where r is the filter factor, initially set to 0.01. 
     The coefficients stability supervisor  170  checks the parameter estimates coming out of the coefficients identifier  166  to make sure that the estimated model is stable. It also checks that K max , coming from the tuner  124  is positive, a necessary condition for loop stability. 
     A stability test is performed according to the following criteria. The model is unstable if any of the following occurs:                1   +     a     1      Q       +     a     2      Q         ≻   0           1   )                 1   -     a     1      Q       +     a     2      Q         ≻   0           2   )                      a     2      Q            ≺   1           3   )                 K   max        0           4   )                                
     where the subscript Q indicates a parameter from Q vector (not the Q aux  vector) 
     If any one of these conditions is satisfied, the supervisor does three things: 
     1. Resets the covariance matrix to all zeros with 0.1 on the major diagonal; 
     2. Sets the new Q aux  to the old Q aux , skipping the coefficients filter&#39;s Q update; 
     3. Sets the new K max  to the old K max , skipping the tuner&#39;s K max  update for (K max ≦0 only) . 
     The time delay identifier  164  estimates the time delay by evaluating a cost function, J(kt), for different values of kt. The value of kt which results in the lowest J is selected as the estimated time delay, k. 
     The cost function is evaluated for all integers between the predefined k max  and k min . The cost function is: 
     
       
           J ( kt,n )=β k   *J ( kt,n− 1)+( Yi ( n )− Yi ( n,kt )) 2   
       
     
     where β k =forgetting factor and Yi(n,kt)=predicted output difference for given possible delay time. 
     The cost functions run constantly, each evaluating using a different possible time delay, kt. The value for the time delay which is selected and used for parameter estimation and control is the value which results in the lowest J. 
     From the foregoing, it should be understood that a controller has been shown and described which has many desirable attributes and advantages. The adaptive capability of the controller enables it to be installed in an application, such as the thermostat that has been described, and it will be self-starting and self-tuning in the sense that the parameters of its internal model will be modified in response to load, equipment or time changes. Such capability ensures effective control without external manipulation. 
     While various embodiments of the present invention have been shown and described, it should be understood that various alternatives, substitutions and equivalents can be used, and the present invention should only be limited by the claims and equivalents thereof. 
     Various features of the present invention are set forth in the following claims.