Application of Genetic Algorithms in identification and ... - IEEE Xplore

2 downloads 0 Views 366KB Size Report
Abstract— In this work we have developed a new humidifier system based on ultrasonic nebulizer, that's used to control the relative humidity inside the incubator ...
Application of Genetic Algorithms in identification and control of a new system humidification inside a newborn incubator Mohamed Aymen ZERMANI Physics Department Faculty of Science Tunis, Tunisia [email protected] .

Elyes FEKI

Abstract— In this work we have developed a new humidifier system based on ultrasonic nebulizer, that's used to control the relative humidity inside the incubator. Real time humidity data was collected using high sensitive sensor SY-230. The humidity dynamic properties of neonatal incubator were evaluated. System identification result is based on genetic algorithm and least squares algorithm (RLS) to find the NARMA input-output mathematical model. For this object, we have achieved and implemented an acquisition chain based on a PIC microcontroller. At the command, a comparative study was made between Proportional Integral Derivative (PID) controller and Model Based Predictive Control (MPC) witch parameters of PID and the cost function of (MPC) were optimized using Genetic Algorithm (GA). The environment for the development of different algorithms is the MATLAB 7.X software. Keywords- identification; humidity control; incubator; Genetic Algorithm

I.

Abdelkader MAMI

Department of Electrical Engineering Higher Institute of Medicals Technologies Tunis, Tunisia [email protected]

INTRODUCTION (HEADING 1)

Preterm birth is a major problem all over the world. In Maternal and Neonatal Unit of Rabta-Tunisia more than 1400 babies were born in the year 2008 which 20% of babies are born prematurely. The mortality rate of premature children increases in the first weeks of their life. So incubators are used to produce a heated micro-environment in order to reduce new born heat loss. Prelstein and all (1971) reported a reduction of 22% in the mortality rate when neonates were nursed in incubators whose microclimate was carefully controlled by air temperature. To decrease the risk of body hypo or hyper thermic of neonate [1], only temperature control is not sufficient. Also, the evaporative losses are inversely proportional to the level of humidity [2]. Many author [3] observed a 40% reduction in evaporative losses when the relative humidity increases 20% to 60%. Since the observation of Blackfan and Yaglou on newborns of low weight, it is recommended to maintain humidity levels inside the incubator at 65% - 70%. Indeed there are two main methods to humidify the air, which are known as the passive and active humidifying method [4]. Most of the incubators commercialized use a passive humidification system, which humidity produced evaporation of water by heating it in the water container [11].

Physics Department Faculty of Science Tunis, Tunisia mami.abdelkader@plane

But this method cannot provide a high humidity level at low temperature such as in the range of 23-38 degree. As a result, the passive method is not suitable to humidify the limited volume of an environment such as an incubator [4]. In this work, we recovered an incubator from Maternal and Neonatal Unit of Rabta-Tunisia. After that, we replaced the passive humidifier by an external block based on a ultrasonic nebulizer which is an instrument for converting a liquid into a fine spray. This system is able to increase the humidity to 80%. The goal of this work is to predict the system behavior and to obtain a model for the control algorithm synthesis. In the next section, the description of the new system is presented. In section 3, we use the genetic algorithm with binary representation to determine the structure of the NARMA model. In section 4, an intelligent PID controller based on Genetic Algorithms (GAs) is proposed. In section 5, we propose a Genetic Based MPC Algorithm. Finally, a comparative study was made between GA-PID and GA-MPC control in order to show the performance of each strategy. II.

MATERIALS AND METHODS

The active humidity system which designed from a close incubator mainly consists of five units: the incubator chamber, the acquisition board, the controller board, the computer and the active humidification system.

Figure 1. Humidity control mechanism developed for newborn incubator.

The experiment device consists of putting the incubator in closed loop to have a constant temperature inside the incubator. The air is warmed in contact with a heating resistance, the fan is turned on and allows air circulation inside the incubator. The internal temperature measurement is based on type LM35. The humidification system and circuit detail of the ultrasonic nebulizer are shown in Fig. 1. The system mainly consists of three unit: the humidification chamber with 20 cm of height and 50 cm of length, a fan turned to eject air humidifier inside the incubator through air guide and the vapor generator. The mainly component which produce a vapor is the ultrasonic nebulizer. The humidity is produced from high frequency vibration of piezoelectric ceramic. Water particles are created overs the sterile water surface and moved between the fan and the heating resistor of the incubator [5]. The humidity Sensor (SY-230) measures the RH of the incubator environment. The sensor has a linear voltage output in the range [0.7 ; 3.3 V], that 0.7 V represents 10% and 3.3 V represents 95% of relative humidity RH. Supply Voltage (Vin) is 5 VDC, the current consumption is 3 mA max, the operating temperature range is between 0 and 60 degree and for Humidity range is 95% or less.

of the model. We consider the class of nonlinear SISO (single input single output) systems that can be modeled by the following equation:

H (k ) = g (V (k )) + e(k )

(1)

With: V (k ) = [ H (k − 1)," , H (k − n), U (k − n)," , U (k − n)] Where: g : is a nonlinear function assumed unknown, m : the order of the regression on the input U(k), n : the order of the regression output H(k), e(k) : is white noise. The output of the model given in (1), can be written as follows [12]: ^

^

H (k ) = θ t ϕ ( k ) ^



θ t = [h

φ1

ϕ (k ) = [1 t

φ2 "φz ] x1

( 2)

x2 " xz ]

^

Wher θ and ϕ represent respectively parameter vector and the observation vector that defined as follow: x1 = U (k − 1), " , xm = U (k − m) xm +1 = H (k − 1)," , xm + n = H k − n xm + n +1 = U 2 (k − 1), xm + n + 2 = U (k − 1)U (k − 2) "

(3)

x z = H p ( k − n) The parameter p represents the degree of nonlinearity of the model. The number of terms involved in the expression of NARMA model is given by the following relationship [12]. r=

Figure 2. The process of identification and control of heating in a premature

is:

(n + m + p)! −1 p !(n + m)!

Therefore, the obtained number of possible combinations S = 2 p −1

The system works as follows: the sensor resistance value is converted to a voltage signal and amplified to suit the acquisition board based on ADC 0809 circuit that communicate with the computer through parallel port DB25. The power of nebulizer needs to be controlled in order to command the humidity of the system. This is done with the phase angle control using a microcontroller PIC16F877. A RS232 link is used to communicate between the controller board and the computer [6]. III.

NARMA SYSTEM IDENTIFICATION

In this part we study the structural and parametric identification of a NARMA model. We use the genetic algorithm with binary representation to determine the structure

(4)

(5)

A. Genetic algorithm with binary representation structure identification In order to determine the structure of the NARM model of humidification system, the technique of Genetic Algorithms (GAs) is used [7]. This method is justified because it has no idea about the structure of the NARMA model of the humidification system and also the high number of combinations. GAs were first conceived in the early 1970 by Holland. This algorithm starts by creating the population initial and ends with the convergence towards the best individual in the population corresponding to the solution of optimization problem. The progression from one state to another is made by

operators such as stochastic selection, crossover and mutation. In our study, each individual (chromosome) of population defined the binary vector which is the image of the vector observation noted VBO given by: VBO = [1 0

ϕ (k ) = [1 t

1 " 0] x1

x2 " xz ]

(6)

Mutation: the mutation is a random process of altering the state of a bit of 0 to 1 or 1 to 0. We can find many methods of mutation in [8]. The mutation is usually chosen very low. Stop Process: we define an adequate termination condition when the maximum number of generations was reached or when changing from one generation to another does not improve a fitness. In our work we choose the first solution.

Analysis of the VBO allows to select the terms involved in the expression of the model output. Only the terms with a value of the corresponding bit is 1 are selected, others are not considered in the expression of the model output. Then, to estimate the parameters of the model considered, we apply the recursive least squares approach that can be described by the following equations. P(k ) =

1

λ1

[ P(k − 1) −

P(k − 1)ϕ (k )ϕ t (k ) P(k − 1) ] λ1 / λ2 + ϕ (k )ϕ t (k ) P (k − 1)

(7) K (k ) = P(k )ϕ (k ) ^

(8)

^

^

θ (k ) = θ (k − 1) + K (k )( H (k ) − ϕ (k )t θ (k − 1))

(9)

Then for each chromosome, we calculate the fitness function which used in the selection phase. The fitness depends on the resulting output error between the system output and the output of the model obtained. This function is defined as following: 1 1+ E N

(10) ^

E = ∑ ( H (k ) − H (k ))2

(11)

k =1

Stochastic operators adopted by the algorithm are: The initial population: the initial population is chosen randomly. Selection: the selection is to choose individuals which are characterized by the best fitness. Then, the best individuals are chosen to be parents. Crossing: the crossing is the objective of exchanging information between two parents to form two new individuals. This type of crossover is applied using the following mechanism:

parent1 = [1 0 1 1 1 0] parent 2 = [1 0 0 1 0 1] individu1 = [1 0 1 1 0 0] individu 2 = [1 1 0 1 0 1]

(12)

Identifying parameters of a NARMA model is generally produced as flows: this problem persists in the implementation of a protocol adapted to the experimental method to collect relevant data. In fact, the quality of the results of identification depends on the acquisition of data of the input input-output data sampled around a working point. PRBS (Pseudo Random Binary Sequence) is designed as input signal based on preliminary experiments. These high frequency signals, allow to excite all the vibration. All experimental data were recorded with sampling frequency of 0.1 Hz. The response from the incubator to the excitation is shown in Fig. 4. To determine the structure of the NARM model, we have chosen parameter (m = 3, n = 2 and p = 3). In this case we will have 55 terms. Fig. 5 shows the evolution of the fitness function of population during the optimization. Each chromosome in the population is passed into the objective function (11) to represent its fitness (10), the bigger its number the better its fitness. The genetic algorithm converged to its final values when arrived to the best population. 160 Humidity PRBS

140

(13)

This type of crossing allows to create a diversity in the population and away from risk of uniformity of chromosomes products.

Humidity%

fit =

Figure 3. Genetic Algorithm Process Flowchart.

120 100 80 60 40 0

100

200

300

400 Samples

500

600

700

Figure 4. Data for identification - system input and system output.

800

8

x 10

-3

150

Simulation Real output

Humidty%

Fitness

6

4

100

50

2

0 0

2

4

6

8

10 12 Generation

14

16

18

0 0

20

100

200

300

400 Samples

500

600

700

800

Figure 7. Fit of the NARMA model output and measured output. Figure 5. The evolution of the fitness

B. Validation of the method To judge the quality of identification, we present the evolution of the measured humidity and the estimated humidity at the interior of the incubator. After that both a linear ARX and a nonlinear NARMA model were identified for comparison. The parameters of ARX model were updated using RLS. In total, 800 data points were simulated. Fig. 6 and Fig. 7 show the updating of the independent parameters of the ARX and NARMA model. With the ARX model is as follows: H (k ) = 0.766 H (k − 1) + 0.2212 H (k − 2) + 0.02404U (k − 2) + 0.02612U (k − 3) − 0.01351U (k − 4) + ξ (k )

(14)

With U: input system, H: output system and ξ : white Noise. The NARMA model developed is written as follows: H (k ) = 0.135U (k − 1) + 0.5896U (k − 3) − 0.0084U (k − 3) 2 + 0.001U (k − 1) H (k − 2) − 0.0024U (k − 2) H ( K − 2) + 0.0105U (k − 3) H (k − 1) + 0.0085H (k − 2)2 + ξ (k ) (15) The performance functions of the tow models are shown in this table. TABLE I.

Performance

9.2132e+004

ARX

1.8069e+003

NARMA

IV.

GA-PID CONTROLLER

Proportional Integral Derivative PID controllers are widely used to control system [9]. The problem for PID controllers is the accurate and efficient tuning of parameters especially for nonlinear systems, which make controller parameter tuning more complex. The traditional PID parameter tuning methods are not suitable. As a result, intelligent PID controller based on Genetic Algorithm (GA) was proposed. The objective function is the main part of creating a genetic algorithm. In this work, the objective function is required to evaluate the best PID controller that gives the smallest overshoot, fastest rise time and quickest settling time. So to combine these objectives, we designed an objective function that will minimize the error of controlled system. A. PID controller law The discrete form of PID controller with input e and output U h is given by: k

U h (k ) = K p e(k ) + K i ∑ e(l ) + kd (e(k ) − e(k − 1))

(16)

l =0

Where: K p , K i and K d are tuning parameters. B. Fitness function Genetic Algorithms search for the optimal solution by maximizing a fitness function that provides a measure of the quality of the solution to the problem. In the control case, the objective is to minimize the cost function that defined as follow.

PERFORMANCE MODEL

Model

Clearly, the model fit error is greatly improved by NARMA model with genetic algorithm based structure estimator and RLS based parameter estimator.

if (osh(k ) < 0) ∞

F (k ) = η3Tr + ∑η1 | (e(k ) | +η 2U h (k ) 2 + η 4 osh(k )

real output Arx model output

140

k =1

else

Humidity%

120



F (k ) = η3Tr + ∑η1 | e(k ) | + η 2U h (k ) 2

100 80

k =1

60 40 0

(17)

100

200

300

400 Samples

500

600

700

800

Figure 6. Fit of the ARX model output and measured output.

Where e(k ) and U h (k ) are used to represent the system error and the control output, Tr is the rising time, and ηi are weight coefficients. The value of overshooting added to the cost function is: osh(k)=H(k)-H(k-1) and H(k)is the output of the

controlled object. The minimization objective function is transformed to be a fitness function: Fitness =

1 (1 + F (k ))

(18)

C. Selection Each chromosome can reproduce, but the strongest should have more luck. To do this, we calculate the fitness of each chromosome. After that, we classify the population in descending order according to their fitness and we take the half of the population.

control horizon, λ is the control weighting factor and ΔU (k + L − 1) is the future control increments sequence. Since the model NARMA is nonlinear, the criterion J is not convex. Therefore, using a conventional method of optimization such as gradient descent method, can lead to a local solution. This fact we proposed the genetic algorithm as optimization method. The structure of this controller is shown in Fig. 8.

D. Crossover This cross makes a simple linear combination between parents which selected randomly.

parent1 = [ K 1p

K i1

K d1 ]

parent 2 = [ K 1p

Ki1

K d1 ]

(19)

After generating a random numberν ∈ [0,1] new parents are:

individu1 = [ K 3p

Ki3

K d3 ]

individu 2 = [ K p4

K i4

K d4 ]

K 3p = (1 −ν ) K 1p + ν K p2

(20)

(21)

K p4 = (1 −ν ) K p2 + ν K 1p

E. Mutation The mutation is a random perturbation of one or more components of the genotype of an individual. We use two main operators of mutation: uniform mutation and non-uniform mutation (Michalewicz, 1992). In this section, we use the uniform mutation, which is a simple extension of the binary mutation, we replace the gene K p , K i and K d selected by a random value K 'p , Ki' and K d' drawn randomly. PROPOSED GA-BASED MPC A LGORITHM

V.

The development of model predictive controller MPC can be traced back to 1978 after the publication of the paper by Richalet and al. Then Cutler and Ramaker from shell oil in 1979, 1980 developed their own independent MPC technology Dynamic Matrix Control. For more details, interested readers are referred to [10]. In present work we proposed a GA Based MPC Algorithm; this controller uses the NARMA model to search of the best control moves. Determining the best control signal is associated with the minimization of quadratic criterion. This criteria is the difference between the predicted process output and the desired reference trajectory. Hp

^

Hc

J = ∑ [ H (k + L ) − Yc (k + L)]2 + λ ∑ [ΔU (k + L − 1)]2 (22) L =1

L =1

^

Where H is the predicted process output, Yc is the reference trajectory, H p is the prediction horizon, H c is the

Figure 8. Structure of GA-MPC.

The following steps describe the operation of the proposed GA-based MPC algorithm. •

Evaluate process outputs using the NARMA model.



Use GAs to find the optimal control.



Generate a set of random in the interval [0, 100].



Calculate the process output for all possible control.



Evaluate the fitness of each solution using (18)



Apply the genetic operators.



Apply the optimal control.



Repeat step 1 to 3 for next step. VI.

SIMULATION RESULTS

Most of the current research on this humidification system is based on conventional controls (ON-OFF or PID) [4] which represents the fluctuation around the set value. Furthermore, this type of controller does not always achieve the required performance on system whose dynamics vary during set point change. This section shows simulation results of PID and MPC with Genetic Algorithm for a new system of humidification of the incubator. The process model was obtained with NARMA model. The objective of this study is to find a more appropriate control law to obtain comfort environment in the incubator system. Responses of the humidity inside the incubator controlled by GA-PID and GA-Based MPC controller are given in Fig. 9 and Fig. 10. The humidification control system has been tested in simulation. The piloting interval is ranged between 30% and 80% of the relative humidity.

100 Setpoint Humidity

90 80

Humidity %

70 60 50 40 30 20 10 0 0

100

200

300

400

500

600

700

800

900

1000

1100

Samples

controller can be resolves the problem. In order to overcome this problem, we proposed GA Based MPC controller. The Fig. 10 shows that GA-Based MPC controller has better control quality: controlled variable is better maintained near set-point and compared to PID, the manipulated variable is not so aggressive. Also the GA-MPC control has a speed response to close to the different set points. The robustness of this strategy can be observed through overshoot and the fluctuation rejection, this is not the case of GA-PID.

Figure 9. Evolution of the set point, the output (GA-PID).

VII. CONCLUSION 80 70

Command

60 50 40 30 20 10 0 0

100

200

300

400

500

600

700

800

900

1000

1100

Samples

Figure 10. Evolution of the control (GA-PID). 100

Humidity %

60

[1]

40 20 100

200

300

400

500 600 Samples

700

800

900

1000

1100

Figure 11. Evolution of the set point, the output (GA-MPC). 60

Command

50 40 30 20 10 0 0

REFERENCES

Setpoint Humidity

80

0 0

In this paper we have designed an new active system which generates the control of the humidity. To determine the structure of NARMA model of the humidification system we used the genetic algorithm with binary representation. Both a linear ARX model and NARMA model were identified for comparison. At the command, a comparative study was made between GA-MPC and GA-PID. Simulation control results demonstrate that the GA-MPC is superior and more appropriate than the GA-PID controller. Future works we take into account couplings between temperature and humidity then we will be focused on the real-time control implementation.

100

200

300

400

500 600 Samples

700

800

900

1000

1100

Figure 12. Evolution of the set point, the output (GA-MPC).

Fig. 10 shows the unit step response curves of the NARMA plant using PID control witch its parameters are identified with the standard GA method. The PID has a speed response to close to the different set points. The step response of system looks instable when the humidity reached 80%. But we note that the time of establishment of steady state varies depending on the area of operation. We note also that the overshoot increases depending on the level of humidity chosen witch destabilize the system. The NARMA model has important non linearities that described in detail on section 3. In addition, it is a complex process which the optimization problem is so difficult to solve. So an analytical solution is impossible and not even a classical numerical solution as a simple PID

M.H. LeBlanc. The physics of thermal exchange between infants and their environment. Med. Instrum, 21:11-15, 1987. [2] F. Telliez, V. Bach, S. Delanaud, H.M’ Baye, A. Leke, A. Apdoh and M. Abidiche. Influence du niveau d’humidit de l’air sur le sommeil du nouveau-n´e en incubateur. RBM, 21:171-176, 1999. [3] K. Hammarlund, G.E. Nilsson, P.A. Oberg and G. Sedin. Transepidermal water loss in newborn infants. Acta Paediatr Scand, 69:385-392, 1980. [4] Gler and M. Burunkaya. Humidity control of an incubator using the microcontroller-based active humidifier system employing an ultrasonic nebulizer. Journal of Medical Engineering and Technology, 26:82-88, 2002. [5] Amorim and Farges. Active system for humidification of incubator. Rio de Janeiro, Brazil, 2002. [6] M.A. Zermani, E. Feki and A. Mami. Thermal identification of premature infant incubator using the microcontroller. STA, 26:10351050, 2009. [7] B. TLILI, F. Bouani and K. Mekki. Identification des systmes non linaires par des modles de type NARMA. Journal europen des systmes automatiss, 42:1279-1309, 2008. [8] J. Zhang, Henry, S.H. Chung and W.L. Lo. Clustering-based adaptive crossover and mutation probabilities for genetic algorithms. IEEE Transactions on Evolutionary Computation, 11:326-335, 2007. [9] Z. Jinhua, Z. Jian, D. Haifeng and W. Sunan. Self-organizing genetic algorithm based tuning of PID controllers. Information Sciences, 179: 1007-1018, 2009. [10] D.W. Clarke, C. Mohtadi and P.S. Tuffs. Generalized predective controlpart I. Automatica, 23:137-148, 1987. [11] J.L. Costa, C.S. Freire, B.A. Silva, M.P. Cursino, R. Oliveira, A.M. Pereira and F.L. Silva. Humidity control system in newborn incubator. Fundamental and Applied Metrology, 2009. [12] M. Kortmann and H. Unbehauen. Structure detection in the identification of non linear systems. APII, 22:5-25, 1988.