**Matlab**

matlab

(Parte **3** de 9)

(1)

MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

Where:

Kp : proportional gain; KI : integral gain; KD : derivative gain; TI : integral time constant and TD : derivative time constant.

In MATLAB, the script code of parallel form may be represented by:

s = tf('s'); % PID Parallel form Kp=10; Td=0.1; Ti=0.1; G=Kp*(1+(1/(Ti*s))+Td*s);

The control parameters are:

- The proportional term: providing an overall control action proportional to the error signal through the constant gain factor.

- The integral term: the action is to reduce steady-state errors through low-frequency compensation by an integrator.

- The derivative term: improves transient response through high-frequency compensation by a differentiator.

The very same system may be designed at SIMULINK Toolbox, represented in figure 1.

Figure 1. Simulink PID Control To minimize the gain at high frequencies, the derivative term is usually modified to:

PID Control Design

T s Gs K

Where α is a positive parameter adjusted between 0.01 and 1. This formulation is also used to obtain a causal relationship between the input and the output of the controller. Another usual structure employed at the PID controller is presented in figure 2.

Figure 2. PID Controller with derivative term at the feedback branch.

According to this configuration, the derivative term is inserted out of the direct branch. The structure is carried to minimize the effect of set-point changes at the output of the control algorithm. By using this configuration only variations at the output signal of the plant will be added with the integral and proportional actions.

2.1. Tuning methods

Several tuning methods are described in (Ǻström & Hägglund, 1995) and in (Ang, 2007). The tuning methods are employed to obtain the stability of the closed-loop system and to meet given objectives associated with the following characteristics:

stability robustness; set-point following and tracking performance at transient response, including rise-time, overshoot, and settling time; regulation performance at steady-state, including load disturbance rejection;

robustness against plant modelling uncertainty;

noise attenuation and robustness against environmental uncertainty.

In (Ang, 2007), the PID controllers tuning methods are classified and grouped according to their nature and usage. The groups that describe each tuning method are:

Analytical methods—at these methods the PID parameters are calculated through the use of analytical or algebraic relations based in a plant model representation and in some design specification.

MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

Heuristic methods—These methods are evolved from practical experience in manual tuning and are coded trough the use of artificial intelligence techniques, like expert systems, fuzzy logic and neural networks.

Frequency response methods—the frequency response characteristics of the controlled process is used to tune the PID controller. Frequently these are offline and academic methods, where the main concern of design is stability robustness since plant transfer function have unstructured uncertainty.

Optimization methods—these methods utilize an offline numerical optimization method for a single composite objective or use computerised heuristics or, yet, an evolutionary algorithm for multiple design objectives. According to the characteristics of the problem, an exhaustive search for the best solution may be applied. Some kind of enhanced searching method may be used also. These are often time-domain methods and mostly applied offline. This is the tuning method used at the development of this work.

Adaptive tuning methods—these methods are based in automated online tuning, where the parameters are adjusted in real-time through one or a combination of the previous methods. System identification may be used to obtain the process dynamics over the use of the input-output data analysis and real time modelling.

2.2. Measures of controlled system performance

A set of performance indicators may be used as a design tool aimed to evaluate tuning methods results. These performance indicators are listed from (3) to (6) equations.

Integral Squared Error (ISE)

()T ISEJetdt (3)

Integral Absolute Error (IAE)

()T IAEJetdt (4)

Integral Time-weighted Absolute Error (ITAE)

()T ITAEJtetdt (5)

Integral Time-weighted Squared Error (ITSE)

()T ITSEJtetdt (6)

PID Control Design

These indicators can help the design engineer to decide about the best adjustment for the PID control parameters. In (Cao, 2008) it is presented some MATLAB codes to obtain these indicators.

3. Distillation column dynamics

In Brazil approximately 50% of vehicle fleet is composed of flex vehicles, resulting in 30 million of vehicles. This kind of vehicle uses fossil fuel and/or ethanol. The ignition system is adjusted automatically depending of the proportion of each fuel kind. To attend the national ethanol demand there are several ethanol distillation facilities across the country. In each of these facilities the fermented sugarcane is distilled, obtaining two products: the anhydrous ethanol and the hydrated ethanol.

The hydrated ethanol is obtained from link between the second and the third column. The anhydrous ethanol is obtained at the base of the third column, see Figure 3. The production process is composed of a series of columns where two variables are controlled to generate the hydrated ethanol and the anhydrous ethanol at the standardized specification: the pressure at the column A and the temperature at the distillation tray A20 (Santos et al., 2010). The hydrated ethanol has to have a concentration of 92,6 oINPM (oINPM is a measurement of the weight of pure ethanol fuel in 100g of ethanol fuel – water mixture). So as near the concentration is about this value, the best will be the quality of the hydrated ethanol and the anhydrous ethanol.

Figure 3. Distillation process to produce anhydrous ethanol and the hydrated ethanol.

MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

These variables depend respectively on the steam flow at the basis of the column A and on the flow of fermented mash applied at the column A. The minimization of the variability of the alcoholic content according the brazilian standard NBR 5992-80 is the main design objective of the control system.

The distillation process is characterized by a high coupling through the system variables and by a non-linear relationship between them. According (Santos, 2010) the models that represent the relationship between the main process variables is FOTD (First Order with Time Delay).

In this work the modeling procedure was developed and the following equation was obtained from the relationship of the pressure variation at the A column and the steam flow valve actuation:

K bar opennig t t s

(Parte **3** de 9)