5
Embedded PI-Bang-Bang Curing Oven Controller R.M. Schoeman Department of Electronic Engineering Vaal University of Technology (VUT) Vanderbijlpark, South-Africa [email protected] Abstract—Embedded control can prove to be difficult if approached incorrectly. In this paper, the Ziegler-Nichols control parameter determination is applied to a PIC18F4520 microcontroller in order to control a thermal oven used for curing of materials. Classical bang-bang, PI and PID control each have disadvantages, but adding simple fuzzy reasoning to the control eliminates some of these, thereby producing an improved controlled system. Simulated and practical results confirm this approach delivers better performance. Keywords; PI control, bang-bang control, fuzzy control, embedded control, Ziegler-Nichols, curing oven, thermal control, PIC18F4520. I. INTRODUCTION Temperature control techniques have been well-studied and documented. Standard control methods such as proportional and integral (PI) -, proportional, integral and derivative (PID) -, proportional (P) - and bang-bang (BB) control techniques have been discussed by many papers [1] and range from simple to very complex approaches. Previously published research in thermal oven control relies on frequency domain analysis and other techniques to determine control parameters [2]. Other techniques, such as the Ziegler-Nichols (ZN) time domain step response analysis, are used to determine the control parameters of a process [3]. In ZN, a unit step is applied to a system and from this response graphical estimation techniques for unknown control parameters are obtained [4]. The graphical estimation and frequency domain analysis techniques may prove to be difficult to interpret and apply in an embedded system. Fourier analysis would need to be done on the input signal, which will have to pass through an analogue to digital (A/D) converter, and interpreted to be successful in the frequency domain analysis, which can be cumbersome in the embedded environment. This paper will demonstrates that simple, accurate time domain control can however be achieved by using a simple systematic approach with logical approximations to implement such control in an embedded environment. II. CONTROL SYSTEM A. Classical Control Background Control parameters could be determined from the characteristics of the overshoot of the variable to be controlled. Fig. 1 illustrates a system response to a predefined set of Figure 1. System feedback response. control parameters. From this, the values for overshoots α and γ can be determined, including the period of oscillation (P), system’s time to reach its first setpoint value (t r ), time period to reach its first maximum (t c1 ) value and the system’s settling time (t s ). The maximum decay ratio γ/α, optimized values for K c , I and D could be calculated using ZN. Table I shows the classic calculations for these parameters [5]. TABLE I. ZN STABILTY ANALYSIS CONTROL PARAMETER FORMULA Controller Kc I D P 0.5*Kcu - - PI 0.45*Kcu Pu/1.2 - PID 0.6*Kcu Pu/2 Pu/8 Kcu = Ultimate gain Pu = Ultimate period of oscillation Moreover, the process could also be started without any control parameters preloaded. Once the process has reached its stable area of operation, calculations could be done in order to obtain the control parameters as shown in Table II. Fig. 2 shows such a response graph of a system [6]. P tr tc1 tc3 ts Time Kp β γ IEEE Africon 2011 - The Falls Resort and Conference Centre, Livingstone, Zambia, 13 - 15 September 2011 978-1-61284-993-5/11/$26.00 ©2011 IEEE

[IEEE AFRICON 2011 - Victoria Falls, Livingstone, Zambia (2011.09.13-2011.09.15)] IEEE Africon '11 - Embedded PI-bang-bang curing oven controller

  • Upload
    rm

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Page 1: [IEEE AFRICON 2011 - Victoria Falls, Livingstone, Zambia (2011.09.13-2011.09.15)] IEEE Africon '11 - Embedded PI-bang-bang curing oven controller

Embedded PI-Bang-Bang Curing Oven Controller

R.M. Schoeman

Department of Electronic Engineering

Vaal University of Technology (VUT)

Vanderbijlpark, South-Africa

[email protected]

Abstract—Embedded control can prove to be difficult if

approached incorrectly. In this paper, the Ziegler-Nichols

control parameter determination is applied to a PIC18F4520

microcontroller in order to control a thermal oven used for

curing of materials. Classical bang-bang, PI and PID control

each have disadvantages, but adding simple fuzzy reasoning to

the control eliminates some of these, thereby producing an

improved controlled system. Simulated and practical results

confirm this approach delivers better performance.

Keywords; PI control, bang-bang control, fuzzy control,

embedded control, Ziegler-Nichols, curing oven, thermal control,

PIC18F4520.

I. INTRODUCTION

Temperature control techniques have been well-studied

and documented. Standard control methods such as

proportional and integral (PI) -, proportional, integral and

derivative (PID) -, proportional (P) - and bang-bang (BB)

control techniques have been discussed by many papers [1]

and range from simple to very complex approaches.

Previously published research in thermal oven control

relies on frequency domain analysis and other techniques to

determine control parameters [2]. Other techniques, such as

the Ziegler-Nichols (ZN) time domain step response analysis,

are used to determine the control parameters of a process [3].

In ZN, a unit step is applied to a system and from this

response graphical estimation techniques for unknown control

parameters are obtained [4]. The graphical estimation and

frequency domain analysis techniques may prove to be

difficult to interpret and apply in an embedded system.

Fourier analysis would need to be done on the input

signal, which will have to pass through an analogue to digital

(A/D) converter, and interpreted to be successful in the

frequency domain analysis, which can be cumbersome in the

embedded environment. This paper will demonstrates that

simple, accurate time domain control can however be achieved

by using a simple systematic approach with logical

approximations to implement such control in an embedded

environment.

II. CONTROL SYSTEM

A. Classical Control Background

Control parameters could be determined from the characteristics of the overshoot of the variable to be controlled. Fig. 1 illustrates a system response to a predefined set of

Figure 1. System feedback response.

control parameters. From this, the values for overshoots α and γ can be determined, including the period of oscillation (P), system’s time to reach its first setpoint value (tr), time period to reach its first maximum (tc1) value and the system’s settling time (ts).

The maximum decay ratio γ/α, optimized values for Kc, I

and D could be calculated using ZN. Table I shows the classic calculations for these parameters [5].

TABLE I. ZN STABILTY ANALYSIS CONTROL PARAMETER FORMULA

Controller Kc I D

P 0.5*Kcu - -

PI 0.45*Kcu Pu/1.2 -

PID 0.6*Kcu Pu/2 Pu/8

Kcu = Ultimate gain Pu = Ultimate period of oscillation

Moreover, the process could also be started without any control parameters preloaded. Once the process has reached its stable area of operation, calculations could be done in order to obtain the control parameters as shown in Table II. Fig. 2 shows such a response graph of a system [6].

P

tr

tc1

tc3

ts

Time

Kp

β

γ

IEEE Africon 2011 - The Falls Resort and Conference Centre, Livingstone, Zambia, 13 - 15 September 2011

978-1-61284-993-5/11/$26.00 ©2011 IEEE

Page 2: [IEEE AFRICON 2011 - Victoria Falls, Livingstone, Zambia (2011.09.13-2011.09.15)] IEEE Africon '11 - Embedded PI-bang-bang curing oven controller

Figure 2. Response graph of a system.

In Fig. 2 the dead time (L), linear time to reach maximum (T) and the difference in the element measured between start and maximum (K) are indicated. This is done by adding a tangent line at the inflection point of the response graph. From the equation of a straight line [7] the intersecting point values at maximum and zero are determined (i.e. (T) and (L)). Subtracting the initial value from the maximum stable value of the response graph gives K.

TABLE II. ZN OPEN LOOP CONTROL PARAMETER FORMULA

Controller KP KI KD

P T/L 0 0

PI 0.9*(T/L) 0.27*(T/L2) 0

PID 1.2*(T/L) 0.6*(T/L2) 0.6*T

Using the approach in Fig. 1 simply means that the controller adapts during the controlling process with respect to errors that occur as the process continues adjusting the control parameters accordingly. The approach in Fig. 2 requires a pilot run in order to obtain control parameters before the actual process is started.

Once the characteristic control parameters are obtained they remain fixed and are not adapted during the process. If perturbations (oven door opened) were to occur, the process would need to be restarted as this will alter the properties of the materials being cured.

When applied to the curing of materials in a conventional thermal oven, the second approach is more appealing than the first, which could alter the curing properties, as the controller deliberately forces the process to cause overshoots in temperature which will cause the materials to cure differently to that required.

B. Software Validation

Simulation of the model was done using MATLAB 2009 as well as Proteus 7.6. Proteus 7.6 allows for the simulation of a thermal oven as well as that of software required within the microcontroller that forms the heart of the controller. Fig. 3 shows the simulation model used in Proteus 7.6.

Figure 3. Proteus 7.6 Simulation model.

The model uses a PIC18F4520 microcontroller for executing the desired control. After the initial run has been completed (the system has obtained a stable consistent temperature) the intersecting points and control parameters are obtained. Fig. 4 shows the flow diagram of the software developed in a C program language for PIC microcontrollers called CCS.

Figure 4. CCS C Program’s logical flowdiagram.

LCD

Start

Initial Run Element on

Measure

Temp

Store

Delta

Temp

Calculate Delta

Temp

Evaluate Delta

Temp

First sampleStore

TempInternal

Ram

Internal

Ram

Store

TempInternal

Ram

Stable Temp ?

Apply tangent

line

Y =m.x + c

Calculate

K,L,T

Calculate ZN

Ki,Kp,Kd

Store

Ki, Kp,

KdInternal

Ram

Evaluate for

values of Ki,

Kp, Kd

Measure

Temp

Update Ki, Kp,

Kd

Calculate

Error wrt

Setpoint

Set Setpoint

Value

Wait according

to Control

Parameters

Element on

Element off

Yes

No

Yes

No

Inputs to calculation

Does Exist

Does

Not

Exist

Element off

Controller Pic 18f4520

Thermal Oven

Max 6675

Sensory Device

RS232

Output Display

Power Source

Switch

y

t

K

L T

IEEE Africon 2011 - The Falls Resort and Conference Centre, Livingstone, Zambia, 13 - 15 September 2011

978-1-61284-993-5/11/$26.00 ©2011 IEEE

Page 3: [IEEE AFRICON 2011 - Victoria Falls, Livingstone, Zambia (2011.09.13-2011.09.15)] IEEE Africon '11 - Embedded PI-bang-bang curing oven controller

As the run continues, the increment in temperature between samples are obtained, compared to previous readings and stored if larger. This is done to obtain the maximum rise in temperature between samples. From here the tangent line is applied in order to obtain the intersect points previously mentioned. The parameters for PI, PID, BB and a combination of PI & BB control were then determined and implemented respectively.

C. Simulation of Controller

The program and controller yielded the results shown in Fig 5. From Fig. 5 the advantages and disadvantages of the standard ZN control can be deduced and are discussed below.

Figure 5. Simulated results of the PI, PID, BB methods.

The PID control method has a reduced rise time up to the setpoint, but has some overshoot and undershoot before it settles. The PI control technique has a much slower rise time up to the setpoint, with very little overshoot before the system stabilises. The BB control method has the fastest rise time up to the setpoint, presents a small over- and under shoot, but never settles.

From Fig. 5 it can be seen that a combination of the PI and the BB control would result in a shorter rise time (using the BB control method) and faster settling time (using the PI control method).

III. PROPOSED SOLUTION

Combining the two control methods with switch over at a specific point based on calculated parameters determined with a Fuzzy (FZ) controller, may ensure a better performance of the controlled parameter.

The fuzzy logic controller (FLC) provides a means of converting a linguistic control strategy [8]. Fuzzy control can be interpreted as an approximation technique for a control function based on typical, imprecisely specified input-output tuples that are represented by fuzzy sets [9].

Zadeh proposed the mathematics of the fuzzy set theory in 1965 [4]. Dealing with fuzziness arises from types of phenomena such as subjectivity, thinking, reasoning, cognition and perception. This is exactly the case with PI and BB, since not one would be dominant all the time.

By applying both BB and PI, the program in CCS had to be adapted to incorporate a FZ decision. Activating the BB until 90 % of the setpoint value was measured, then switching over to PI control yielded a faster rise and settling time.

However, first attempts did not include updating the PI control parameters during the BB phase, which resulted in the controller exhibiting properties of BB below the setpoint before control stabilization occurred in classical PI fashion. Fig. 6 shows the modification to the control program flow diagram to incorporate the FZ mathematics and decision making process.

Figure 6. Flowdiagram illustartion of FZ decicion implementation to CCS C program.

Evaluate for

values of Ki,

Kp

Measure

Temp

Update Ki, Kp,

Kd

Calculate

Error wrt

Setpoint

Set Setpoint

Value

Wait according

to Control

Parameters

Heater on

Heater off

Does Exist

Evaluate if temp

is larger than 90%

of setpoint

Element on

Wait according

to Control

Parameters

BB

PI

IEEE Africon 2011 - The Falls Resort and Conference Centre, Livingstone, Zambia, 13 - 15 September 2011

978-1-61284-993-5/11/$26.00 ©2011 IEEE

Page 4: [IEEE AFRICON 2011 - Victoria Falls, Livingstone, Zambia (2011.09.13-2011.09.15)] IEEE Africon '11 - Embedded PI-bang-bang curing oven controller

Fig. 7 shows the simulated results of the FZ control with and without the updating of the PI control parameters during

Figure 7. Proteus simualted results of the FZ (PI-BB) combinations.

the BB phase. The FZ (PI-BB) updating method shows a faster settling time as well as less overshoot compared to the standard ZN control method results shown in Fig. 5. Table III is a summary of the factors mentioned above.

TABLE III. CONTROL METHOD SIMULATED RESULT COMPARISONS

BB PI PID FZ (PI-BB) Not

Updated

FZ (PI-BB)

Updated

Overshoot 11 % 10 % 19 % 11 % 13 %

Settling time Minutes

Infinite 100 + 100 + 94 56

IV. EXPERIMENTAL RESULTS

A. Experimental Setup

A small curing oven with a heating element is shown in

Fig. 8, and was used as part of the practical setup in these

experiments.

Figure 8. A small 3 KW curing oven.

The controller board with PIC18F4520, liquid crystal

display (LCD) and power switch board is shown in Fig. 9.

The power switch uses a relay triac combination in order to

eliminate loss of power and EMI during switching [10].

Figure 9. Controller board including display and power switch.

B. Practical results

The practical results were obtained from the controller

board via an RS232 output. A personal computer with RS232

COM PORT LOGGER software was used to capture each

decision made for every five second sample. This data was

then stored in a comma separated value file (CSV) and

graphed using MATLAB 2009. Fig. 10 shows the results

obtained.

Figure 10. Practical results for 220 °C setpoint.

Controller Board with

PIC18F4520

Max6675

LCD Display

Power Switcher

Heating Element

Curing Oven

IEEE Africon 2011 - The Falls Resort and Conference Centre, Livingstone, Zambia, 13 - 15 September 2011

978-1-61284-993-5/11/$26.00 ©2011 IEEE

Page 5: [IEEE AFRICON 2011 - Victoria Falls, Livingstone, Zambia (2011.09.13-2011.09.15)] IEEE Africon '11 - Embedded PI-bang-bang curing oven controller

Fig 11 shows results obtained using the different control methods, but at a different setpoint to that used in Fig 10. This was done in order to evaluate if the control parameters obtained from the initial run was still valid.

Figure 11. Practical results for 400 °C setpoint.

A similar comparison as in Table III was drawn to show the differences and improvement in the FZ(PI-BB) control implementation (see Table IV ).

TABLE IV. CONTROL METHOD PRACTICAL RESULT COMPARISONS

BB PI PID FZ(PI-BB) Not

Updated

FZ(PI-BB) Updated

Overshoot

13 %

22 %

27 %

4 %

3 %

Settling time Minutes

Infinite

102

132

101

74

V. CONCLUSIONS

The implementation of PI-BB control with some FZ control rules in an embedded controller using a PIC18F4520 proved to be successful. Once the initial curve determination run was completed, both simulated and practical results show that the

FZ(PI-BB)-control improved the rise time towards the setpoint and reduced the overshoot more than 19% ( 22 % - 3 %) compared to that of the PI-control (see Table IV). An improvement larger than 20% in a faster settling time with respect to the setpoint can also be seen in the FZ(PI-BB)-control in comparison to the PI-control (see Table III and IV).

This will thus allow better performance when a curing profile needs to be followed during a curing process. Heat loss during the switching of the element was minimal, thus resulting in an effective transfer of current between the switching devices [10].

Variances between simulated and practical results point to differences in the Proteus model for a thermal oven and the oven used in the laboratory, which could form part of further research. Thus, in evaluating the results, it can be seen that the embedded environment applied to thermal control can be simplified if approached in a simplistic manner.

VI. REFERENCES

[1] K.J. Astrom , T. Hagglund., C.C. Hang., W.K. Ho, “Automatic tuning

and adaptation for PID controllers - a survey,” Control Engineering Practice Volume 1, Issue 4, (1993) p 699-714.

[2] J.G. Ziegler, N.B. Nichols, “Optimum settings for automatic controllers,” Trans. ASME 64 (1942), p759–768.

[3] K.J. Aström, T. Hägglund, “Revisiting the Ziegler–Nichols step response method for PID control,” Journal of Process Control 14 (2004), p1-2

[4] “Fuzzy control system.” (n.d.) McGraw-Hill Concise Encyclopedia of Engineering. (2002). Retrieved March 15 2011 from http://encyclopedia2.thefreedictionary.com/Fuzzy+control+system

[5] Advanced Process Control & Optimization Inc., “Closed tuning loops” Retrieved March 16 2011 from http://www.apco-inc.com/articles/pidtune2.pdf

[6] B.R Copeland, “The Design of PID Controllers using Ziegler Nichols Tuning,” Retrieved,March 2008, Retrived March 15 2011 from http://www.eng.uwi.tt/depts/elec/staff/copeland/ee27B/Ziegler_Nichols.pdf

[7] “Maths is good for you,” Retrieved March 15 2011 from http://www.mathsisgoodforyou.com/AS/explanations/coordinatexplain.htm.

[8] C.C. Lee, “Fuzzy logic in control systems: fuzzy controller,” IEEE Transactions Vloume 20 Issue 2 (2002), p 404-418.

[9] F. Klawonn, R. Kruse, “Constructing a fuzzy controller from data, Fuzzy Sets and Systems,” Volume 85, Issue 2, Methods for Data Analysis in Classification and Control, (1997), p 177-193

[10] R.M Schoeman, J.F.J van Rensburg, D.V. Nicolae, “Self-tuning Curing Oven Control,” IEEE explore (2010)

IEEE Africon 2011 - The Falls Resort and Conference Centre, Livingstone, Zambia, 13 - 15 September 2011

978-1-61284-993-5/11/$26.00 ©2011 IEEE