Control Engineering Practice 10 (2002) 1357–1370 A new pulse modulation adaptive controller (PMAC) applied to HVAC systems Timothy I. Salsbury* Johnson Controls, Inc., 507 East Michigan Street, Milwaukee, Wisconsin, 53202, USA Received 14 June 2001; accepted 29 April 2002 Abstract The paper proposes a new switching control law (pulse modulation adaptive controller, PMAC) that implements pulse-width– pulse-frequency modulation. Pulse durations are determined to maintain the amplitude of variation in the controlled variable at or below a user-defined level. In addition to providing quantifiable control performance, PMAC can reduce component wear by issuing fewer switches than conventional control schemes. The control law is developed around a first-order system characterization but incorporates an adaptive loop, which allows application to a wide range of non-first-order and also time-variant systems. Test results are presented from applying PMAC to both simulated and real HVAC systems. r 2002 Elsevier Science Ltd. All rights reserved. Keywords: Pulse modulation; Adaptive control; Switching law; HVAC 1. Introduction Many systems have continuous (analog) outputs but discrete (binary) input domains that only accept two values: typically, on and off. In these systems, regulation of an output at a desired value (setpoint) can only be achieved by switching inputs between discrete states at a rate rapid enough that system capacitance provides an averaging effect enabling outputs intermediate to the two states to be attained. Except in the simplest control tasks, it is desirable to have some form of switching control law that can generate the binary input to the discrete system based on an analog input. By coupling the switching law to the discrete system, an analog input can then be used to control the analog output. This provision enables the system to be controlled using conventional feedback control law, such as PID. The most common types of switching law are variable structure/sliding mode control (VSC) and pulse-width and/or pulse-frequency modulation. Variable structure control (Itkis, 1976) has been applied widely to aero- space and robot applications where high levels of instrumentation allow measurement of the full state vector. In situations where the state vector is unable to be fully measured, observers are required and robustness problems can ensue if they are not correctly designed and implemented (Bernelli-Zazzera & Mantegazza, 1995). Pulse width modulation (PWM) is easier to implement than VSC and has been employed as a switching law in various applications. Sira-Ramirez (1989) showed how PWM can be interpreted as a sub- domain of VSC. Pulse-width–pulse-frequency modula- tion (PWPFM) is an extension of PWM that varies cycling frequency in addition to pulse duration (Skoog & Blankenship, 1976; Van Varseveld & Bone, 1997). In all types of switching law, there is a trade-off between switching frequency and setpoint tracking performance. Increased switching frequency improves control performance but at the expense of greater component wear. In applications where the device being switched is of high capital cost, this trade-off becomes an important design issue. Heating, ventilating, and air- conditioning (HVAC) applications in buildings are an example where on–off control of expensive equipment is found in several types of control strategies, e.g., duty- cycling of compressors in chiller systems (Zaheer-Uddin & Zheng, 1994). In HVAC control applications, *Tel.: +1-524-274-4660; fax: +1-524-274-5810. E-mail address:
[email protected] (T.I. Salsbury). 0967-0661/02/$ - see front matter r 2002 Elsevier Science Ltd. All rights reserved. PII: S 0 9 6 7 - 0 6 6 1 ( 0 2 ) 0 0 0 9 9 - 0 specifications are often made as to how well a setpoint must be maintained, e.g., to 711C on a room temperature control loop. In these cases, the aim would be to regulate the controlled variable according to the design intent, but with a minimum amount of equipment cycling to reduce wear and maintenance costs. Although PWM control methods have been applied to the control of variable speed drives in HVAC systems (Mallinson, 1998), application to other on/off devices in the HVAC field has been limited with ad hoc deadband-based switching schemes prevailing. This paper describes a new type of switching control law (pulse modulation adaptive controller, PMAC) that implements a form of PWPFM. A control strategy based on variation of cycling frequency in addition to pulse width can reduce switching of the controlled device and hence reduce wear (Nagai, Nagura, & Nakoaka, 1993). In US commercial buildings, approxi- mately 30% of total electrical energy use can be attributed to on–off and staged electrical devices (EIA, 1998). Reduced switching and better quantifiable con- trol performance of systems in buildings can thus have large impacts on energy use in addition to operating costs, and comfort conditions. The rest of the paper is organized as follows. Section 2 describes incorporation of PMAC in a conventional feedback control loop. Section 3 provides a detailed description of the PMAC control law and Section 4 summarizes the equations in a form suitable for implementation. In Section 5, results are presented from testing PMAC on simulated and real air-conditioning systems. Finally, Section 6 provides conclusions and a summary of the work. 2. Incorporation of PMAC in a feedback control loop The design goal in developing a new switching control law was to be able to incorporate it in a conventional feedback control strategy. Fig. 1 depicts an implementa- tion of this sort, where rðtÞ is a setpoint, yðtÞ a controlled variable, and uðtÞ a control signal generated by a feedback controller, such as PID. PMAC converts the analog control signal to a digital value (0 or 1) suitable for input to some discrete system �pðtÞAf0; 1g: The PMAC input DrðtÞ is a user-selected value that relates to the maximum desired amplitude of variation in the system output when subjected to a pulse train at a constant control signal, i.e., when the feedback loop is in steady state. The controlled variable is measured by PMAC in order to evaluate its actual variation and make adjustments to pulse durations in order to maintain the desired value DrðtÞ; as conditions change. The feedback of the controlled variable to PMAC constitutes an adaptive loop. The DrðtÞ value is also used as a deadband in the feedback controller, as explained below in Section 2.1. In practice, it can be reasonably straightforward and intuitive to develop control logic for single stage systems using bespoke expert rules, deadbands, and time delays. There are a number of these ad hoc solutions in existence and performance varies depending on tuning and design. A more challenging control problem less amenable to the development of such ad hoc control logic entails controlling multiple discrete systems (or ‘stages’) in series. PMAC is easily applied to the multistage problem by using it to control individual stages and by using sequencing logic to move control from one stage to another. Results from applying PMAC to both single- and multi-stage air-conditioning systems are presented in Section 5. 2.1. Deadband for feedback controller In closed loop, oscillations in the controlled variable brought about by PMAC-generated pulses will cause the feedback controller to issue an oscillating output. It is desirable to reduce the sensitivity of the feedback controller to the output variations induced by PMAC, Nomenclature C cycle period Cmax maximum allowable cycle period Cmin minimum achievable cycle period Dr user-specified amplitude of variation in system output d normalized amplitude of variation in system output da achievable d value, given saturation of cycle period dmax maximum allowable d value dmin minimum allowable d value e error signal used in feedback controller f maximum of minimum on and off times j cycle period number K static gain of controlled system k sample number p pulse signal (0/1) r setpoint for feedback controller Tmin;off minimum off time Tmin;on minimum on time Toff off time Ton on time t time t time constant u control signal y system output %y effective fractional system output T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–13701358 but at the same time ensure that the controller responds to other disturbances. The method adopted to deal with this is to incorporate a deadband that results in the error, as seen by the controller, being set to zero when the following condition applies: IF jejpDr=2 THEN e0 ¼ 0; ð1Þ where e is the setpoint error, e0 is the error passed as input to the feedback control law. Dr is the user-defined maximum amplitude of variation in the system output, which is used as a deadband in the feedback controller. Note that most controllers typically have a deadband facility already built-in. The following condition is also normally implemented: IF jej > Dr=2 THEN e0 ¼ e � Dr=2: ð2Þ For typical HVAC applications, it is expected that the dominant time constant will be of a high enough magnitude to make the variations in the output signal due to device switching relatively small compared to the variations caused by other disturbances on the con- trolled system. In this situation, incorporation of a deadband would not severely hamper the ability of the controller to reject genuine disturbances. 3. Description of the PMAC control law The PMAC control law is designed to generate a pulse train based on an input control signal, uðtÞ: A pulse train is comprised of a sequence, in time, of on and off epochs, with an on state occurring when pðtÞ ¼ 1 and an off state when pðtÞ ¼ 0: A cycle period, denoted by C; is the time between the instigation of two chronologically sequential on states. The on time within one cycle period is denoted as Ton and the relationship between the control signal uðtÞ and pulse output pðtÞ is expressed as follows: pðtÞ ¼ 1 for tkotptk þ Ton½uðtkÞ�; 0 for tk þ Ton½uðtkÞ�otptk þ C½uðtkÞ�; ( ð3Þ tkþ1 ¼ tk þ C½uðtkÞ�; ð4Þ Ton½uðtkÞ�pC½uðtkÞ�: ð5Þ Fig. 2 depicts a graphical representation of a single pulse cycle relating the nomenclature used in the above equations. Note that both Cð:Þ and Tonð:Þ are shown as functions of uðtÞ: This type of control law is known as PWPFM. PMAC is an implementation of PWPFM, where the on time and cycle period are functions of the control signal. In the more commonly used PWM, the cycle period is constant such that C is a fixed user-selected value. Typically, in PWM control, the cycle period is selected to be as short as the controlled device will safely allow thereby providing close control, but at the expense of equipment wear. Instead of pulsing at a fixed frequency, PMAC varies both the on-time and cycle period in order to induce variations in the controlled variable that have an amplitude equal to or less than a user-selected value (Dr). Functions for calculating the on-time and cycle time are derived in the following two sections. Fig. 1. Implementation of PMAC in a feedback control scheme. Fig. 2. Pulse form. T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–1370 1359 3.1. Calculation of pulse on time—Ton The effective fractional output ( %y) of the controlled system is defined as the fraction of time within one cycle period over which the system is in an on state: %y ¼ Ton C ; ð6Þ where Ton is the pulse duration, C is the cycle period and 0p %yp1: In all physical systems, there will be a minimum time period over which a particular on or off state can be maintained, defined as Tmin;on and Tmin;off ; respectively. As with conventional PWM con- trol, PMAC increases the pulse duration as a function of the input control signal uðtÞ: In order to operate within the minimum on and off time constraints, the pulse duration becomes Tmin;on when uðtÞ ¼ 0 and C � Tmin;off when uðtÞ ¼ 1: PMAC has been developed so that the cycle period is always equal to a maximum value Cmax at either end of the control signal range, i.e., when uðtÞ ¼ 0 or 1: Since the pulse duration and cycle period are defined at the ends of the control signal range, the effective fractional outputs of the system at these points are given by %yu¼0 ¼ Tmin;off Cmax ; %yu¼1 ¼ Cmax � Tmin;on Cmax ¼ 1� Tmin;on Cmax : ð7Þ A controllable range (r) can now be calculated from the above as follows: r ¼ %yu¼1 � %yu¼0 ¼ 1� 1 Cmax ðTmin;on þ Tmin;off Þ: ð8Þ The reason for setting the cycle period to a fixed value (Cmax) at the ends of the control signal range is to make the controllable range r invariable to changes in the control signal uðtÞ: In practice Cmax can be set to a large value so that the controllable range is maximized and cycling of equipment is minimized. From a control perspective, it is desirable that the effective fractional output of the system is a linear function of the control signal so that the use of linear control law (e.g., PID) yields consistent control performance across the control range. To achieve linearity, a relationship between fractional output and control signals can be formulated as follows: Ton C ¼ ur þ k; ð9Þ where 0pup1 is the input control signal and k ¼ Tmin;on=Cmax: Hence, a function for calculating the on time from the control signal is given by Ton ¼ Cður þ kÞ: ð10Þ Note that the off time is simply the cycle time minus the on time since the cycle time is defined as C ¼ Ton þ Toff : ð11Þ So far, the cycle period has only been defined at the extremities of the control signal range. In the next section, a function for calculating the cycle period for all other values of the control signal (i.e., 0ouðtÞo1) is defined. 3.2. Calculation of cycle time—C In HVAC systems that require on/off control, the controlled system is usually dominated by a long time constant, such as in room temperature control. It is thus postulated that a first-order characterization is reason- able for these systems. The controlled system is therefore modeled by the following transfer function: GðsÞ ¼ K ð1þ tsÞ ; ð12Þ where t is the dominant time constant and K is the static gain. This first-order model is used to approximate the controlled system in the derivation of the PMAC control law. During this section, it is assumed, for convenience, that K ¼ 1: In Section 3.4, a method is described for estimating the actual gain from measurements of the system output. Application of a pulse train to a first-order system results in a (steady-state) response where the system output oscillates about a mean value, as shown in Fig. 3. If the duration of on and off states is small relative to the dominant time constant of the system, the variation in the system output about its mean value will also be small. Conversely, the variation about the mean will be large for long cycle periods. Hence, the cycle period directly affects any realizable setpoint tracking performance. In PWM control, the user selects a cycle period and the significance of the chosen value on control perfor- mance is not easy to establish. Although, it is intuitive that control performance decreases with an increased cycle period, the variation in control performance as a function of the control signal u is less apparent. Fig. 4 shows a conventional PWM strategy applied to a unity- gain first-order system with a time constant of 20min. The minimum on time is 3min, the minimum off time is 5min, and the cycle time is set to 16min; these values are typical for HVAC systems. The upper graph shows the linearly varying on time as a function of the control signal; the off time is also shown, which is equal to the cycle time minus the on time. The lower graph shows the amplitude of variation (which was denoted as ‘d’ the Fig. 3) in the output of the first-order system for the steady-state response to a pulse train as a function of the control signal. The amplitude of variation in the system T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–13701360 output can be seen to vary quite significantly (>60%) across the range of control signals thus implying that control performance would also vary across the operat- ing range for a PWM scheme of this sort. In PMAC, the user specifies a required variation in the system output, i.e., the d value. With a specified d value, the cycle period required to achieve this value as a function of the on time is calculated. In this way, d is fixed, but C varies as a function of the control signal instead of vice versa. Using the unity-gain first-order characterization, the following expression can be derived for the cycle time (see Appendix A): C ¼ �t ln d � 1þ e�Ton=t d þ 1� eTon=t � � ; ð13Þ where t is the time constant of the first-order system, d the user-specified output variation, Ton the on time, and C the cycle time. Eqs. (10) and (13), respectively, provide one function for calculating the on time and one function for calculating the cycle time. These functions cannot be solved independently since Ton is a function of C and C is a function of Ton: It would be possible to solve the equations iteratively, but it was found that a solution could be obtained more easily by combining the equations into a single expression and then applying standard root finding methods. Eqs. (10) and (13) can be combined as follows: d � de�C=t ¼ ð1� e�Ton=tÞð1� eTon�C=tÞ ¼ ð1� e�Ton=t � eTon�C=t þ e�C=tÞ: ð14Þ Hence d � de�C=t ¼ 1� e�CðurþkÞ=t � e�Cð1�ur�kÞ=t þ e�C=t: ð15Þ If e�C=t ¼ x; the notation can be simplified and f ðxÞ can be written as f ðxÞ ¼ ð1� dÞ þ ð1þ dÞx � xurþk � xð1�ur�kÞ: ð16Þ The cycle time C is thus found by solving for f ðxÞ ¼ 0; and calculating C from C ¼ �t lnðxÞ: ð17Þ Once a value for C has been calculated, the value can be substituted in Eq. (10) to calculate the pulse duration. Eq. (16) can be solved more robustly by defining a range on x that contains the root. Firstly, an upper limit on x is found from the minimum cycle period. It can be confirmed that Eq. (16) yields a minimum value for the cycle period when the on time and off times are equal and at this point Eq. (16) can be solved analytically (Appendix B): Cmin ¼ �2t ln 1� d 1þ d � � : ð18Þ The maximum cycle period Cmax is defined by the user and, as mentioned before, is selected to be a large number. Hence, with knowledge of Cmin and Cmax an interval can be defined on x that contains the root: ½xl ; xu� ¼ ½e�Cmax=t; e�Cmin=t�: ð19Þ Various root-finding algorithms were tested for speed of convergence and robustness and the false position (secant) method (e.g., Nash, 1979) was found to be well suited to the problem. Simulation tests with typical values showed that the method could locate the root within an average of ten iterations to machine precision when starting x on its lower limit. During operation, it was found that the number of iterations could be reduced further by starting x at the previously estimated value. Due to the small number of iterations required to locate a solution, the method is computationally undemanding and thus suitable for implementation in a low-cost micro controller of the type found in HVAC control systems. Look-up tables could be employed to Fig. 3. System response to pulse train input. Fig. 4. Variation in system output for a conventional PWM scheme. T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–1370 1361 avoid having to solve Eq. (16) on-line in the controller, but this would be more costly in terms of data storage. 3.3. Constraints As explained previously, the controllable range r is kept constant by fixing the cycle period at the control signal extremities (i.e., at uðtÞ ¼ 0 and at 1). The maximum cycle period is thus defined as Cmax and the cycle period C is made not to exceed this value for any value of uðtÞ: This limit on C is enforced by saturating the calculated value on Cmax: The d value relates to the required amplitude of variation in the system output, which is used to calculate pulse durations. A maximum limit on d is defined so that the smallest C value, which occurs at the point where on and off times are equal, cannot be greater than Cmax: dmax ¼ 1� e�Cmax=2t 1þ e�Cmax=2t � � ; ð20Þ where Eq. (20) is a re-arrangement of Eq. (18). A minimum limit on d is defined so that the calculated cycle time cannot be less than Cmax at either of the control range extremity points, i.e., when uðtÞ ¼ 0 or uðtÞ ¼ 1: This limit ensures that the controllable range (r) is always constant. dmin ¼ 1� e�f =t 1� e�Cmax=t � � ð1� ef�Cmax=tÞ; ð21Þ where f ¼ maxðTmin;on; Tmin;off Þ: For the considered first-order system, constraining selectable d values within the range dmin2dmax causes the selected d value to be equal to or less than the value selected. The realizable d value will be lower than the selected value whenever the cycle period C is made to saturate on its maximum value. By setting d ¼ dmin; the selected value will be obtained across widest range of u values. If d ¼ dmax; the selected value will only be obtained at the point where the on and off times are equal; at all other points, the actual d value will be less than the selected value. A set of plots showing the achievable d value for three different selected d values is shown in Fig. 5 (d ¼ dmin), Fig. 6 (d ¼ dmin þ ðdmax2dminÞ=2), and Fig. 7 (d ¼ dmax). In the figures, the upper graph shows the on and off times and the cycle time; the lower graph shows the resulting d value across the control signal range. In all graphs, the minimum on time is 3min, the minimum off time 5min, and the time constant 20min; Cmax was in this case set to 368min. In contrast to the PWM performance that was illustrated in Fig. 4, Figs. 8–10 show that the cycle time now varies in order to maintain the d value at or below its selected value. Note that by putting a cap on the cycle period, the controllable range (r) remains the same for all values of d in the range dmin to dmax: 3.4. Estimation of static gain In this section a method is presented for estimating the system gain in order to allow specification of the desired amplitude of variation for the actual variable under control, rather than for a unity gain abstraction. Recall that Dr is related to the unity-gain d value as follows: Dr ¼ Kd; ð22Þ Fig. 5. On and off times and cycle times at d ¼ dmin—lower graph shows actual d value. Fig. 6. On and off times and cycle times at d ¼ ðdmax2dminÞ=2þ dmin: T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–13701362 where K is the static gain. Thus, if the gain is known, (Dr=K) can be substituted for d to calculate the pulse duration. However, since knowledge of the gain is not always available and since the gain may change at different operating points, it is desirable to implement an automated procedure for estimating the gain. One way to do this is to ascertain the gain by observing the actual variation in the controlled variable for a particular instigated value of d; e.g., for dminpd0pdmax: The gain can then be calculated from the following: uK ¼ ðDyÞ0 d0 ; ð23Þ where ðDyÞ0 is the actual variation in the system output when using the value of d0 in PMAC. A method for estimating Dy is described in Section 3.5. As explained previously, the achievable d value may be different to the desired value in certain parts of the control signal range due to saturation of the cycle period on its upper limit. The saturation may result in the amplitude of variation of the system output being smaller than desired, as was illustrated in Fig. 6 (bottom graph). To account for this, the acheivable d value (denoted by da) is calculated from the following equation (see Appendix A for derivation): da ¼ 1� e�ðTonÞ=t 1� e�C=t � � ð1� eðTonÞ�C=tÞ: ð24Þ The above equation uses the applied cycle period (after any saturation) and on time to calculate the achievable d value. Since the pulse duration can change during one cycle period due to changes in the control signal, an average is calculated in order to get a representative value over each cycle period: %da;j ¼ 1 N XN k¼1 da;k ! j ; ð25Þ where N is the number of samples during a cycle period. Symbol k represents a sample number, and j represents a cycle number. Eqs. (22) and (23) can now be combined and a set of recursive equations formulated for estimating the gain and for calculating the d parameter from the specified Dr value: dj ¼ Dr uKj ; uKjþ1 ¼ ðDyÞj %da; j : ð26Þ Note that d is always constrained such that dminpdjpdmax: The procedure described above will estimate the correct gain and appropriate d value providing the system is of first-order and has a time constant equal to the value used in PMAC. Use of the recursive equations above creates an adaptive loop in the PMAC control law. If the actual variation in the controlled variable exceeds the expected variation, the gain estimate is increased and the d value reduced causing faster cycling and less variation in the controlled variable. Conversely, if the actual variation is smaller than expected, d is increased thus inducing slower cycling. The adaptive loop will compensate for inaccuracies in the first-order characterization used in the PMAC derivation by either over- or underestimating d in order to move the actual controlled variable variation toward the desired value. The procedure also enables PMAC to adapt to variations, over time, in the controlled system, such as changes in system gain or time constants. The method will converge on a suitable d value even if the estimate of the system time constant is not accurate or if the system is of higher-order than the assumed first- order form. Analysis has shown that convergence Fig. 7. On and off times and cycle times at d ¼ dmax: Fig. 8. System response to pulse train. T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–1370 1363 depends on ensuring the time constant estimate used in PMAC is always greater than the largest system time constant. This implies that it is better to overestimate the time constant value in PMAC to ensure conver- gence, i.e., testimateXtactual : Experience using the PMAC control law has shown that convergence could be also improved by incorporating ‘‘jacketing’’ so that the size of changes in the internal d value are restricted to within certain bounds. For example, imagine that d is initialized at its minimum value and PMAC is applied to a system with time delay. In this situation, an initial pulse may yield no response from the system causing the d-update procedure to increase the d value by an inappropriately large amount. Since a large d value corresponds to a long cycle period, there might be a significant delay before d is re-adjusted to a more appropriate level. 3.5. Estimation of actual amplitude of variation In order to implement Eq. (26), a procedure is needed for estimating the actual variation in the system output (y) over one cycle. This change can be evaluated by monitoring the maximum and minimum values of y over one cycle epoch: ðDyÞj ¼ ðymax � yminÞj ; ð27Þ where the subscript j denotes a cycle epoch. It should be verified that the system is operating within its con- trollable range by ensuring the control signal is not saturated at either end of its range before evaluating the change. To properly establish the gain, the system should be in a steady-state pulsing condition. However, if this requirement is ignored the gain will be overestimated and the d value underestimated (since dp1=K) during transient periods. Fig. 8 illustrates how this could happen for a unity gain first-order system under PWM control where the control signal is stepped from 0.2 to 0.8. The upper graph shows the system output (y) as a solid line with the underlying response shown as a dash- dot line. The underlying response represents how the system would respond if it had a continuous input domain. The middle graph shows the pulse signal (p), which is either 1 (on) or 0 (off). The cycle period is fixed in the example and the pulse duration varies as a Fig. 9. Simulated test system. Fig. 10. Simulation test result for Dr¼ 11C: T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–13701364 function of the control signal according to conventional PWM control law. Fig. 8 shows that the gain would be overestimated in the transitional period between the steady-state condi- tions at u ¼ 0:2 and 0:8; which would subsequently lead to an underestimate of d: This would cause the system to be cycled faster than desired, improving control performance, and allowing the system to get closer to the new load point faster. Once at the new load point, the system output would then oscillate at a smaller than desired amplitude causing PMAC to decrease the gain estimate to a more appropriate level. The amplitude of variation in the output (Dy) would thus approach the desired value (Dr) as a steady-state pulsing condition evolved. 4. Summary of the PMAC control law The PMAC control law is summarized below and broken down into an initialization phase and a run-time phase. 4.1. Initialization PMAC is initialized through calculation of the following parameters: dmin ¼ 1� e�f =t 1� e�Cmax=t � � ð1� ef�Cmax=tÞ; dmax ¼ 1� e�Cmax=2t 1þ e�Cmax=2t � � ; d0 ¼ dmin; #K0 ¼ Dr d0 ; where f ¼ maxðTmin;on; Tmin;off Þ: Dr is the user-definable control performance parameter; Tmin;on and Tmin;off are the minimum on and off times that would be obtained from manufacturers’ recommendations for the consid- ered system; and Cmax is the maximum cycle period, which could be set to some arbitrary high value for all systems. The parameter t is the system time constant estimate and as explained previously, the adaptive d- update procedure (Eq. (26)) will compensate for in- accuracies in this parameter. Experience using PMAC has shown that good results can be obtained even when the time constant is overestimated by a factor of three. In practice, estimation of the time constant can be simplified by using pre-set values depending on the class of application. PMAC can be applied to fast- or slow- reacting systems providing a time constant estimate is provided that is somewhat representative of the system under control. 4.2. Run-time The main run-time calculations are summarized below where j is used to denote a cycle period number and k a sample number. 1. Calculate minimum cycle period for current d value: Cmin ¼ �2t ln 1� dj 1þ dj � � : 2. Define interval containing root: ½xl ; xu� ¼ ½e�Cmax=t; e�Cmin=t�: 3. Solve f ðxÞ ¼ 0 using a standard root-finding method: f ðxÞ ¼ ð1� djÞ þ ð1þ djÞx � xurþk þ xð1�ur�kÞ: 4. Calculate cycle period from x: C ¼ �t lnðxÞ: 5. Calculate pulse duration: Ton ¼ Cðukr þ kÞ: 6. Calculate achievable d value: da;k ¼ 1� e�ðTonÞ=t 1� e�C=t � � ð1� eðTonÞ�C=tÞ: 7. If a complete cycle has been completed, perform the following calculations: 7.1. Calculate average achievable d value over last cycle: %da;j ¼ 1 N XN k¼1 da;k ! j : 7.2. Estimate the actual amplitude of variation in the system variable: ðDyÞj ¼ ðymax � yminÞj : 7.3. Update the d value: dj ¼ Dr uKj ; where dminpdpdmax: 7.4. Update the gain estimate: uKjþ1 ¼ ðDyÞj %da;j : 8. Return to step 1. T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–1370 1365 where k ¼ Tmin;on=Cmax and r ¼ 1� ðTmin;on þ Tmin;off Þ=Cmax: Simple logic is easily derived to generate the pulse signal (0/1) from the calculated pulse duration based on the use of timers. 5. Test results This section presents results from using PMAC to control both simulated and real HVAC systems. PMAC was tested in closed loop by combining it with a PI controller as part of a control scheme equivalent to that depicted in Fig. 1. In both the simulated and real system tests, an adaptive PI controller (Seem, 1998) was used to adjust for changes in the characteristics of the controlled system and maintain consistent feedback control per- formance. 5.1. Simulated system tests Fig. 9 illustrates the simulated test system, which consists of an air-handling unit with a direct-expansion (DX) cooling coil sited in a supply air duct. Air is blown through the cooling coil by a supply fan, which maintains a constant airflow. Outside air is mixed with return air from the building by a set of mixing dampers that precede the supply fan. Control of the mixing dampers is sequenced with the control of the DX coil. Air is diffused into the controlled space and extracted through grilles by an extract fan. The DX coil is served by a single compressor, which is only able to be either on or off. The simulated system was developed using the Matlab and Simulink programming tools. Detailed models of the cooling coil and zone were created based on previously validated models described by Clark (1985). Real weather data for a typical summer’s day between 6 am and 6 pm in Miami, Florida was used to provide boundary conditions for the simulation. Minimum on and off times for the compressor were both set to 30 s. An open loop test was performed to characterize the response to a step change in the manipulated variable (i.e., compressor control signal). The step test yielded a time constant of 20min and this was the value used in PMAC. Initial values for the adaptive PI controller were obtained from the open loop step test results using Ziegler–Nichols tuning rules ( (Astr .om & H.agglund, 1995). During the tests, the setpoint was fixed at a constant value of 22.21C (721F). Figs. 10–13 show the results from tests on the simulated system under closed loop control. Each figure shows results from one test covering a period of 72 h (3 full days) with a fixed value for the amplitude of variation (Dr) in each test. The top graph in the figures shows the system output. The Dr value in each test is shown as a band surrounding the setpoint. The second graph in each figure shows the internal d value in PMAC. The lower graphs show the control signal as a thick solid line and the pulse signal generated by PMAC as a finer solid line. The results in Fig. 10–13 show that PMAC was able to maintain the system output within the selected amplitudes of variation while the PI controller was able to reject the disturbances acting on the system and maintain the (average) output at, or near, the setpoint. The d value was initialized at its minimum value in each test causing rapid cycling at the beginning of each test. The d-update procedure made adjustments to the d value over subsequent cycles to produce the desired amplitude of variation. The procedure is faster to converge in the tests that have smaller desired ampli- tudes of variation since the actual variations in the Fig. 11. Simulation test result for Dr¼ 21C: Fig. 12. Simulation test result for Dr¼ 41C: T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–13701366 system output can be assessed more quickly due to the faster cycling. In all tests, the d value quite rapidly stabilizes and then stays within a narrow range. It can be observed that in the tests with the higher Dr values, the actual amplitude of variation is lower than the desired value during parts of the tests. As was demonstrated in Fig. 7, PMAC will be unable to achieve the desired variation in parts of the range near control range extremities when d approaches its maximum value due to minimum on and off time constraints. Control performance is nevertheless assured by maintaining actual variations that are equal to or less than the desired amplitude during the tests. 5.2. Real system tests PMAC was used to control a DX cooling unit schematically similar to the simulated test system that was depicted in Fig. 9. However, instead of just one compressor, the real test unit had two compressors, each of which could be in either an on or off state. A split range control strategy was used to handle sequencing between the two stages, whereby the control signal from the PI controller was split into two parts so that 0–50% controlled the first stage and 50–100% controlled the second stage. A wall-mounted sensor measured the temperature in the room, and this was designated as the controlled variable. The time constant estimate in PMAC was set to half an hour, which has been found representative of typical room temperature control loops. The minimum on and off times for the compressors were both set to 3min, which was the manufacturers recommended value. Four tests were carried out with a different Dr value used in each test. Each test lasted 8 h. In order to exercise both of the compressors, the setpoint was changed in the middle of each test so that control would switch between stages. The setpoint during the first part of each test was 22.21C (721F) and was stepped down to 201C (681F) during the latter part of the tests. As in the simulation tests, an adaptive PI controller was used. The controller was initialized with default parameters. Figs. 14–17 show the results from the closed loop tests on the real system. The top graph in each figure shows the controlled variable, setpoint, and desired amplitude of variation (which was also the deadband used in the PI controller). The second graph shows the main control signal issued by the PI controller and its split range derivative. The third and fourth graphs show the binary signals generated by PMAC, which were used to control the two compressors. It is evident from the figures that the control scheme was unable to maintain the controlled variable to Fig. 13. Simulation test result for Dr¼ 61C: Fig. 14. PMAC control of two-stage air-conditioner with Dr¼ 0:8331C: Fig. 15. PMAC control of two-stage roof-top unit with Dr¼ 1:1111C: T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–1370 1367 setpoint as well as in the simulated system tests. This is due to the slower dynamics of the test system and the fact that the room experienced some load changes during the day, e.g., at approximately 6 h in Fig. 15. In addition, the real system exhibited more severe non- linear behavior as conditions changed than was encoun- tered in the simulated system. The gain and the time constants in the real systems changed with operating point and these changes in behavior caused the amplitude of variation to differ from the desired value until the adaptive loop in PMAC adjusted the internal d-value. In all tests, the initial d-value was set to dmin and cycling thus began at a more rapid rate than necessary before settling to a more appropriate value for the selected Dr value. Figs. 14 and 15 show that the amplitude of variation in the system output was maintained close to the desired value and that the PI controller provided reasonable setpoint tracking. In Fig. 16, PMAC took longer during the first part of the test to reach a pulsing condition that yielded the desired amplitude of variation than was evident in the other tests with smaller Dr values. The actual variation reached the desired value after about 3 h into the test. The step change in setpoint pushed the system to a new operating point and differences in the system characteristic at this new operating point caused the amplitude of variation to be too small initially. PMAC began to lengthen the cycle period, but the desired level of variation was not reached before the test was completed. In Fig. 17, the Dr value was so large that the controlled variable could be maintained most of the time within the deadband surrounding setpoint with the compressors either fully on or fully off. There were insufficient pulses issued during the considered 8-h test period for the adaptive loop in PMAC to properly adjust the d-value to an appropriate value. Since the adaptive loop depends on establishing actual variation in the system output over whole cycle periods, it is clear that wider Dr values will slow the rate at which the adaptive loop is able to adjust for changes in the system since instigated cycling will be slower. However, since specification of a wider Dr value implies less stringent control requirements, this is not likely to be problematic in practice. 6. Conclusions The paper has presented a new adaptive pulse modulation controller for discrete systems and demon- strated its performance on a simulated and real system. The theory was developed for calculating pulse duration to achieve a specified variation in the controlled variable of a first-order unity-gain system, when under steady state pulsing. An approach for determining static gain was developed and it was shown how the approach could compensate for inaccuracies in the first-order characterization by either under- or overestimating the true value. The gain estimation procedure represents an adaptive loop within PMAC that allows it to adapt to changes in the dynamic and static characteristic of the controlled system and compensate for initial dynamic misrepresentation. By developing the theory around the concept of controlling the amplitude of system output variations, a deadband could be used in a feedback control loop. The deadband prevented pulse-induced variations passing through the feedback controller when the controlled variable was near setpoint. PMAC was tested on a simulated and a real HVAC system and it was capable of maintaining the variations in the controlled system Fig. 16. PMAC control of two-stage roof-top unit with Dr¼ 1:3891C: Fig. 17. PMAC control of two-stage roof-top unit with Dr¼ 1:6671C: T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–13701368 variable to within different selected levels. The results also demonstrated how the physically meaningful Dr parameter could provide an easy way to trade control performance against equipment wear. Another advantage of being able to control the variation in the controlled variable to a desired level is that adaptive methods can be more easily utilized in the feedback controller to maintain controller parameters at suitable values. Other authors have used adaptive controllers in conjunction with PWM schemes e.g. (Guo et al., 1996), but have not faced the situation where the amplitude of oscillation in the controlled system variable is significant as it is in the case of the HVAC applications considered in this paper. It was found that having significant pulse-induced oscillations could hamper the performance of certain adaptive controllers, especially those designed for particular disturbance classes. However, in PMAC, the amplitude of the pulse-induced variations in the controlled variable is known enabling the adaptive control methods to be de-activated when signal variations are within this band. It was found that this approach allowed application of an adaptive PI controller directly with little deteriora- tion in its performance. Acknowledgements The author would like to thank the following staff at Johnson Controls in Milwaukee for their assistance with this work: Andrew Boettcher, Phil Bushong, Bin Chen, Gaylon Decious, Kirk Drees, and John Seem. Appendix A Assume a first-order transfer function: GðsÞ ¼ 1 1þ ts : ðA:1Þ Solve analytically for a step input function for an initial output value of yði � 1Þ: yðiÞ ¼ e�Dt=tyði � 1Þ þ ½1� e�Dt=t� pðiÞ; ðA:2Þ where y is the output, p is the pulse signal, t is the time constant and i is the sample number. Assuming p switches between one and zero at a rate determined by applied on and off times, the peak values for y occur when i is an odd integer. The above expression can be generalized to yield an expression for peak values of y when i is odd (and iX5): ypðiÞ ¼ ½1� e�Ton=t þ e�Ton=te�Toff =t � e�2Ton=te�Toff =t þyeði�1=2Þ�Ton=teði�1=2Þ�Toff =t � eðiþ1=2Þ�Ton=teði�1=2Þ�Toff =t�; ðA:3Þ where the p subscript denotes a peak value of y: In order to calculate d; where d ¼ yp2yt; the peak and trough values are determined for y when t-N (i.e., steady- state pulsing mode). This is achieved by taking i to infinity. Grouping together the positive and negative terms the following summation is obtained: ypðNÞ ¼ XN i¼0 e�iTon=t e�iToff =t � XN i¼0 e�ðiþ1ÞTon=t e�iToff =t ¼ XN i¼0 eið�Ton�Toff Þ=t � XN i¼0 eið�Ton�Toff Þ=t e�Ton=t: ðA:4Þ By letting x ¼ e�Ton�Toff =t; the above can be re-written as ypðNÞ ¼ XN i¼0 xi � e�Ton=t XN i¼0 xi ¼ XN i¼0 xið1� e�Ton=tÞ: ðA:5Þ The above result can be further simplified by making use of the fact that PN i¼0 x ið1=1� xÞ: yp ¼ 1� e�Ton=t 1� x ¼ 1� e�Ton=t 1� e�Ton�Toff =t : ðA:6Þ The corresponding trough value, yt; is given by yt ¼ e�Toff =typ: ðA:7Þ Hence, the change between the peak and troughs of the output in response to the pulse train is ðyp � ytÞ ¼ 1� e�Ton=t 1� e�Ton�Toff =t � � ð1� e�Toff =tÞ: ðA:8Þ Since d ¼ yp � yt and C ¼ Ton þ Toff ; Toff ¼ C � Ton and d ¼ 1� e�Ton=t 1� e�C=t � � ð1� eTon�C=tÞ: ðA:9Þ Rearranging for C: C ¼ �t ln d � 1þ e�Ton=t d þ 1� eTon=t � � : ðA:10Þ Appendix B When the on time is equal to the off time Toff ¼ Ton; C � Ton ¼ Ton; Ton ¼ C 2 : ðB:1Þ T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–1370 1369 In this special case, C=2 can be substituted into Eq. (A.10) to yield e�C=t ¼ d � 1þ e�C=2t d þ 1� eC=2t ; e�C=tð1þ dÞ � 2e�C=2t þ ð1� dÞ ¼ 0; a2e �C=t � 2e�C=2t þ a3 ¼ 0: ðB:2Þ By setting z ¼ e�C=2t; a quadratic expression f ðzÞ can be produced: f ðzÞ ¼ a2z2 � 2z þ a3 ðB:3Þ f ðzÞ ¼ 0 is solved as follows: z ¼ 27ð4� 4a2a3Þ 1=2 2a2 ¼ 17ð1� ð1� dÞð1þ dÞÞ1=2 1þ d ¼ 17ð½d�2Þ1=2 1þ d ¼ 17d 1þ d : ðB:4Þ The cycle times at the root values are thus C ¼ 0;�2t ln 1� d 1þ d � �� � : ðB:5Þ Re-arranging for d at the second root gives d ¼ 1� e�C=2t 1þ e�C=2t � � : ðB:6Þ References (Astr .om, K., & H.agglund, T. (1995). PID controllers: Theory, design, and tuning. Research Triangle Park, North Carolina, Instrument Society of America. Bernelli-Zazzera, F., & Mantegazza, P. (1995). Linearization techni- ques for pulse width control of linear systems. Control and Dynamic Systems: Advances in Theory and Applications, 70, 67. Clark, R. C. (1985). HVACSIM+building systems and equipment simulation program reference manual. Gaithersburg, MD: US Department of Commerce, National Bureau of Standards, National Engineering Laboratory, Center for Building Technol- ogy, Building Equipment Division. Energy Information Administration (EIA), 1998. Commercial building energy consumption and expenditures 1995. DOE/EIA-0625(95), Washington, DC. Guo, B., Lin, D. C., Feng, Y. L., Laknath, K. G. D., Syedulaq, M., & Nakaoka, M. (1996). New conceptual electromagnetic induction fluid heating system using resonant PWM inverter with auto-tuning PID controller. Proceedings of the IEEE International Conference on Industrial Technology, Shanghai, China, p. 390. Itkis, U. (1976). Control systems of variable structure. New York: Wiley. Mallinson, N. (1998). Plug & play single chip controllers for variable speed induction motor drives in white goods and HVAC systems. Proceedings of the 13th Annual Applied Power Electronics Conference, Anaheim, California, p. 756. Nagai, S., Nagura, H., Nakoaka, M. (1993). High frequency inverter with phase-shifted PWM and load adaptive PFM control strategy for industrial induction-heating. Proceedings of IEEE Industry Applications Conference, Canada, p. 2165. Nash, J. C., 1979. Compact numerical methods for computers: Linear algebra and function minimization. Bristol: Adam Hilger, Ltd. Seem, J. E. (1998). A new pattern recognition adaptive controller with application to HVAC systems. Automatica, 34(8), 969. Skoog, R. A., & Blankenship, G. L. (1976). Generalized pulse- modulated feedback systems: Norms, gains, Lipschitz constants, and stability. IEEE Transactions on Automatic Control, AC-21(5), 739. Sira-Ramirez, H. (1989). Sliding regimes in pulse-width-modulation systems design. Proceedings of the 28th IEEE Conference on Decision and Control, Tampa, Florida, pp. 2199–2204. Van Varseveld, R., & Bone, G. (1997). Accurate position control of a pneumatic actuator using on/off solenoid valves. IEEE/ASME Transactions on Mechatronics, 2, 195. Zaheer-Uddin, M., & Zheng, G. R. (1994). A VAV system model for simulation of energy management control functions: Off normal operation and duty cycling. International Journal of Energy Conversion and Management, 917. T.I. Salsbury / Control Engineering Practice 10 (2002) 1357–13701370 A new pulse modulation adaptive controller (PMAC) applied to HVAC systems Introduction Incorporation of PMAC in a feedback control loop Deadband for feedback controller Description of the PMAC control law Calculation of pulse on time-Ton Calculation of cycle time-C Constraints Estimation of static gain Estimation of actual amplitude of variation Summary of the PMAC control law Initialization Run-time Test results Simulated system tests Real system tests Conclusions Acknowledgements References