Advanced Control Introduction to Fuzzy Logic Æ Performance Monitoring and optimization Dra. Doris Sáez Æ Unit and plant-level applications - offer high value to customer operations . Teacher: Doris Sáez H., Ph.D 1 Slide 2 Advanced Control . Teacher: Doris Sáez H., Ph.D Æ The Control Foundation in DeltaV - Traditional tools e.g. override, cascade, ratio - Improvements provided by advanced control Æ DeltaV Inspect - Detection of abnormal conditions - Variability index, utilization Æ DeltaV Tune - Tuning response, robustness - Expert options e.g. Lambda, IMC Æ DeltaV Fuzzy - Principals of fuzzy logic control - FLC function block, tuning Æ DeltaV Neural - Creation of virtual sensor - Data screening, training Æ DeltaV Predict - MPC for multi-variable control - Model identification, data screening - Simulation of response, tuning Æ DeltaV Simulate - Operator training and engineering - Using High fidelity process simulation Slide 3 DeltaV Redefines Advanced Control High Classic Advanced Control Lower Cost Low Greater Benefits DeltaV Advanced Control Product Price Cost of Services ROI Ease of Use Stability Over Time Ongoing Problem Solving . Teacher: Doris Sáez H., Ph.D Slide 4 DeltaV Fuzzy Æ Improved response to process disturbances and setpoint changes, especially for loops with long time constants Æ May replace PID for most applications Æ Configuration is Easy - exactly like PID Æ Quick tuning with DeltaV Autotuner . Fuzzy Logic Fundamentals Æ The fuzzy logic associates uncertainty to the data set structure (Zadeh, 1965). Æ The elements of a fuzzy set are order pair data which gives the element value and membership grade . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 5 Slide 6 1 Fuzzy Logic Fundamentals – Fuzzy Logic Fundamentals Example Low: “a velocity around 40 km/h” Medium : “a velocity around 55 km/h” High: “a velocity over 70 km/h aprox.” µ Low High Medium 1 Æ For a fuzzy set, an element x belong to a set A with a membership grade µA (x), which is between 0 and 1 Æ A variable could be characterized with different linguistic values, each one represents a fuzzy set 0.66 0.33 0 – 40 45 70 55 Velocity Thus, if the velocity is 45 km/h, the membership grades are 0, 0.33 and 0.66 belong to the fuzzy sets Low, Medium, High, respectively . . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 7 Slide 8 DeltaV Fuzzy Basic Operations of Fuzzy Logic Æ . Given two fuzzy sets A and B in the same universe X, with membership functions uA and uB respectively, the following basic operations are defined . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 9 Slide 10 Basic Operations of Fuzzy Logic µ(x) 1 z Union Basic Operations of Fuzzy Logic u A ∪ B = max{(u A (x), u B (x))} z B A Complement u A (x) = 1 − u A (x) µ(x) 1 0 x A µ(x) 1 z 0 Intersection u A ∩ B = min{(u A (x), u B (x))} x B A 0 x . . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 11 Slide 12 2 Basic Operations of Fuzzy Logic Æ Fuzzy Models Given the fuzzy sets A1, ..., An with universes X1, ..., Xn respectively, the product Cartesian is defined as a fuzzy set in X1...Xn with the following membership function: Æ Linguistic fuzzy models Æ Takagi & Sugeno fuzzy models u A1x..xAn (x1 ,..., x n ) = min{u A1 (x1 ),..., u An (x n )} Mamdani (1974) u A1x..xAn (x1 ,..., x n ) = u A1 (x1 ) ⋅ u A2 (x 2 ) ⋅ ⋅ ⋅ u An (x n ) Larsen (1980) . . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 13 Slide 14 Linguistic Fuzzy models Æ Æ Linguistic Fuzzy models The linguistic fuzzy models are based on heuristic rule sets where the input and output linguistic variables are represented by fuzzy sets Knowledge Base Example “If temperature is High then fun velocity is Slow” µ(x) U Fuzzification Defuzzification Inteface Interface Y Fun velocity 1 Inference Slow Medium Motor Fast 0 x . . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 15 Slide 16 Fuzzyfication Interface Æ This element transform the input variables to fuzzy variables Example: 70 º → “Low with membership grade 0.7” µ(x) 1 Æ It contains the linguistic rules and the membership function information of the fuzzy sets Æ Calculates the output variable fuzzy sets from the input variables by using the rules and the fuzzy inference Example: x1 (temperature) = 10 and 0.7 x2 (pressure) = 26 Low 0 70º Temperature . Knowledge base → y (speed)? R1: If x1 is A1 and x2 is B2 then y is C2 R2: If x1 is A1 and x2 is B1 then y is C1 . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 17 Slide 18 3 Knowledge base A 0 10 1 A Defuzzification Interface B 2 100 Temperature -50 1 B C 2 26 50 y Pressure 0 1 C 100 z Speed C 1 0 Æ 2 C From output variable fuzzy sets, obtained by fuzzy inference, provides the non fuzzy output 2 100 z C’. 0 40 10 z C . . Teacher: Doris Sáez H., Ph.D 0 40 100 z Slide 19 Slide 20 Takagi & Sugeno Fuzzy Models Æ . Teacher: Doris Sáez H., Ph.D These models are characterized by fuzzy rules, where each premise represents a fuzzy subspace and the consequences are linear relation of inputoutput Takagi & Sugeno Fuzzy Models Æ Linear models for the consequences y Example If x is A1 Then y = Cx + D u . . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 21 Slide 22 Takagi & Sugeno Fuzzy Models Æ Example: Batch Fermentator In general, Ri : If X1 is Ali and K and Xk is Ak i Then Yi = p0i + p1i X 1 + K + pki Xk . . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 23 Slide 24 4 Example: Batch Fermentator Æ Membership functions . Control Strategies Based on Fuzzy Models Æ Fuzzy expert control Æ PID fuzzy control . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 25 Slide 26 Fuzzy Expert Control Æ These controllers are based on heuristic rules where the input and output linguistic variables are represented by fuzzy sets Æ Example: Fuzzy Expert Control Knowlogment base y Fuzzification Interface Controlled variable Teacher: Doris Sáez H., Ph.D Slide 27 Slide 28 Æ Example: Washing machine – The dirtiness is determined by the transparency of the water. – Type of dirt is given from the saturation time. Saturation is the point at which the change in water transparency is close to zero Process Manipulated variable . Teacher: Doris Sáez H., Ph.D Fuzzy Expert Control u Inference Motor – If temperature is high then fun velocity is fast . Defuzzification Interface Fuzzy Expert Control Æ Example: Washing machine Rules if dirtness_of_clothes is Large and type_of_dirt is Greasy then wash_time is VeryLong; if dirtness_of_clothes is Large and type_of_dirt is Medium then wash_time is Long; if dirtness_of_clothes is Medium and type_of_dirt is Medium then wash_time is Medium; if dirtness_of_clothes is Large and type_of_dirt is NotGreasy then wash_time is Medium; . . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 29 Slide 30 5 Fuzzy Expert Control Æ Fuzzy Expert Control Example: Washing machine Æ Input membership functions Example: Washing machine Output membership functions . . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 31 Slide 32 Fuzzy PID Control Fuzzy PID Control Æ Characteristics: – Two or seven fuzzy sets for the input variables e(k) GE ref GR de(k) – Two or seven fuzzy sets for the output variables Controller du(k) GU Process y(k) – Triangular membership functions – Fuzzyfication with continuous universes – Inference based on fuzzy implicance – Desfuzzyfication by the maximum mean method e(k) = r - y(k) de(k) = e(k) - e(k-1) . . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 33 Slide 34 Fuzzy PID Control Fuzzy PID Control y(k) a1 a2 a3 a4 ref e(k) >0 <0 <0 >0 de(k) <0 <0 >0 >0 a1 a2 a3 a4 e(k) + - - + de(k) - - + + . b1 b2 b3 b4 b5 b6 e(k) =0 =0 =0 =0 =0 =0 de(k) <<<0 <<0 <0 >0 >>0 >>>0 c1 c2 c3 c4 c5 c6 de(k) e(k) =0 <<<0 =0 <<0 =0 <0 =0 >0 =0 >>0 =0 >>>0 time . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 35 Slide 36 6 Fuzzy PID Control Fuzzy PID Control c3 y(k) ref b1 c2 c1 y(k) b2 b3 b4 b5 ref c4 c5 b6 c6 time time (a) NB NB a2 NM a2 NS a2 e(k) ZE b1 PS a1 PM a1 PB a1 NM a2 a2 a2 b2 a1 a1 a1 NS a2 a2 a2 b3 a1 a1 a1 de(k) ZE c1 c2 c3 ZE c4 c5 c6 PS a3 a3 a3 b4 a4 a4 a4 PM a3 a3 a3 b5 a4 a4 a4 PB a3 a3 a3 b6 a4 a4 a4 (b) . . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 37 Slide 38 Fuzzy PID Control Fuzzy Logic Control vs PID de(k) NB NM NS ZE NB NB NB NB NB NM NB NB NM NM NS NB NM NS NS e(k) ZE NM NM NS ZE PS NM NS ZE PS PM NS ZE PS PM PB ZE PS PM PB Setpoint Change PS NM NS ZE PS PS PM PB PM NS ZE PS PM PM PB PB PB ZE PS PM PM PB PB PB – “If the error is Negative Small and the incremental error is Positive Medium then the increment control variable is Positive Small” . Load Disturbance FLC FLC PID FLC PID FLC PID PID Notice at both SP change and at load disturbance the FLC output change is more dramatic than PID. Resulting in faster return to SP. Also notice as PV approaches SP, the FLC exhibits less overshoot. . Teacher: Doris Sáez H., Ph.D Teacher: Doris Sáez H., Ph.D Slide 39 Slide 40 DeltaV Tune - Fuzzy Logic Commissioning Transfer recommended constants to fuzzy control . Teacher: Doris Sáez H., Ph.D Slide 41 7