Full text
sensors Article Intelligent Controller Design by the Artificial Intelligence Methods Jana Nowaková 1,* and Miroslav Pokorný 2 1Department of Computer Science, Faculty of Electrical Engineering and Computer Science, VSB-Technical University of Ostrava, 17. listopadu 2172/15, 708 33 Ostrava – Poruba, Czech Republic 2Department of Cybernetics and Biomedical Engineering, Faculty of Electrical Engineering and Computer Science, VSB-Technical University of Ostrava, 17. listopadu 2172/15, 708 33 Ostrava – Poruba, Czech Republic; miroslav[email protected] *Correspondence: [email protected]; Tel.: +420-597-325-908 Received: 31 May 2020; Accepted: 8 August 2020; Published: 10 August 2020 Abstract: With the rapid growth of sensor networks and the enormous, fast-growing volumes of data collected from these sensors, there is a question relating to the way it will be used, and not only collected and analyzed. The data from these sensors are traditionally used for controlling and influencing the states and processes. Standard controllers are available and successfully implemented. However, with the data-driven era we are facing nowadays, there is an opportunity to use controllers, which can include much information, elusive for common controllers. Our goal is to propose a design of an intelligent controller–a conventional controller, but with a non-conventional method of designing its parameters using approaches of artificial intelligence combining fuzzy and genetics methods. Intelligent adaptation of parameters of the control system is performed using data from the sensors measured in the controlled process. All parts designed are based on non-conventional methods and are verified by simulations. The identification of the system’s parameters is based on parameter optimization by means of its difference equation using genetic algorithms. The continuous monitoring of the quality control process and the design of the controller parameters are conducted using a fuzzy expert system of the Mamdani type, or the Takagi–Sugeno type. The concept of the intelligent control system is open and easily expandable. Keywords: intelligent controller; PID controller; artificial intelligence; expert systems; fuzzy methods; genetic algorithms; optimization; softcomputing 1. Introduction Sensor-based measuring systems are used not only in the information systems but also in the control ones. Quality control of real complex processes requires continuous monitoring of the changing internal and external conditions, followed by continuous adaptation of the controller parameters. Nowadays, sensor networks are widely used and easily available. We are facing a situation that the sensors provide us with even more information that we are able to use. We can work with a really massive amount of data–big data is trying to find hidden context in data, and the next step is to use the information contained in the data. The world of processes controlling should also change. It must reflect the situation of the enormous amount of data obtained from the processes as well as being able to work with it. The main idea of the work is to present a non-conventional method of solving classic control problems–how to set the controller parameters and when and how to reset them. The controlling system design for continuous adaptation under time changing conditions is often discussed in many application issues. Sensors 2020,20, 4454; doi:10.3390/s20164454 www.mdpi.com/journal/sensors
Sensors 2020,20, 4454 2 of 27 Up to the present time, many methods and controlling schemes have been developed. There is a large group of classic design methods [ 1 ], techniques based on artificial intelligence [ 2 ], or ideas built on a combination of traditional and non-conventional methods. The combination of the methods exploits the best both of these methods provide. The fact that the use of non-conventional methods offers the possibility to add inputs and rules, which are elusive for the standard methods, is one of the biggest advantages. The proposed solution of the controlling system combines continuous adaptation of the PID controller, monitoring of control process quality according to the predetermined requirements in real conditions of dynamically changing attributes of a controlled system, and ongoing identification of the controlled system from the sensor data. The sensitive and accurate sensors and memory for the data measured form the necessary parts of the system. 1.1. Related Work Process controlling is a broad scientific field involving various areas. The essential areas of interest comprise intelligent controlling including its parts–control quality monitoring, system identification, and controller parameter adjustment, which are designed using artificial intelligence techniques. The perspective may be formulated as the use of expert systems in controlling and the use of non-conventional optimization methods in controlling. These two groups were developed simultaneously, and several mixed (hybrid) algorithms are also proposed. As stated in [ 2 ], there are two approaches in controlling using an expert system (ES). The first one is the fuzzy rule-based method for controlling processes for which suitable models do not exist or are inadequate. The rules substitute for conventional control algorithms. The second method, originally suggested in [3,4], involves the use of an ES to extend the amounts of classic control algorithms. It was 1984 when Moore et al. [ 5 ] introduced the use of an ES in industrial applications. The system was designed to monitor a process loop of a conventional control system with an intelligent alarm system. In 1986 Äström, Anton and, at the time Äström’s Ph.D. student, Ärzén [ 4 ], presented an idea to replace heuristic logic with an expert system in the feedback loop in a classic controlling issue. This has led to a simplification of heuristic logic and has brought new functionalities usable in control systems. A classic PID is considered as the controller. They propose some ideas on how to design a monitoring block and PID controller parameters. This proposed approach can be regarded as the first mention and a basis for expert control, where all the parts are knowledge-based. Shirley [ 6 ] describes the experience with the use of the ES in controlling, namely in controlling an adipic acid reactor and a heat exchanger. The limits of the ES, which should not be considered, according to the author, as a panacea, have been mentioned. From the author’s point of view, expert systems are not experts; it means that the ES does not have all the data that an expert could have. Currently, great attention is paid to the ES. The ES should be chosen according to the specific application. The costs of the ES are declining and acquiring knowledge from experts should be conducted with care, with the consciousness that computer power and memory are finite. General rules could be more powerful than more specific rules, and there is a necessity of “good” data. The essence of the article is that Shirley was sceptical about using the ES. Nowadays, 30 years later, the situation has changed. Based on our work, it can be asserted that the issue of intelligent controllers has been experiencing a renaissance in the last three or four years. One group of PID controller parameters optimization and setting approach uses ant colonies, genetic algorithms, and artificial neural networks [ 7 ]. The procedure, which the authors also call intelligent controlling, involves using a single adaptive neuron–direct neural control [ 8 ] with a hybrid learning based on the conjunction of an on-line rule based on the gradient descent method and an off-line rule based on the Big Bang-Big Crunch algorithm. A two-layer feed-forward neural network with as few neurons as possible with two inputs, e and ∆e , is also proposed. The output is in the form of a change in the duty cycle for the motor control [9].
Sensors 2020,20, 4454 3 of 27 Non-conventional approaches have become established in industrial applications in the last few years. Controlling of a hydraulically driven robot based on the implementation of two schemes is presented in [ 10 ]. The first scheme is created using a fuzzy-PID self-tuning controller composed of the conventional PID control and including fuzzy logic. The second one consists of the adaptive neuro-fuzzy inference system-PID (ANFIS-PID), self-tuning of the gains of the PID controller. However, the fuzzy logic controller [ 11 ] or the smart method of controlling [ 12 ] (and many others) are very often confused for the intelligent controller. Conventional PID controller parameters can also be set [ 13 ] by the ES of the Mamdani type with two inputs– e and ∆e and three outputs– ∆kp , ∆ki and ∆kd . The knowledge base consists of 49 easy rules for each output. An almost identical approach was selected for the PID controller in the photovoltaic system [ 14 ]. The other one, the Sugeno type system, extends it, and it is used for optimization and shape definition of input variables membership function. Next, another Sugeno type of the ES for PID controller parameters determination is also proposed. An effortless and user-friendly method of using decision-based controlling for Smart Home is proposed in [ 15 ]. A combination of an artificial neural network and the fuzzy logic controlling system can be devised for a switched reluctance generator, but the controlling systems work independently, without any connection [16]. An exciting implementation of Brain Emotional Learning Based Intelligent Controller is described in [ 17 ]. It is proposed for the coordination of multi-agent systems and based on emotional learning in the mammalian limbic system. Bigdeli and Ziazi [ 18 ] designed a robust fractional-order adaptive intelligent controller devised for the stabilization of uncertain fractional-order chaotic systems. The authors prepare the intelligent neuro-fuzzy network for unknown dynamics estimation of the system, while the neuro-fuzzy network parameters, upper bounds of the model uncertainties, disturbances, and approximation errors are adaptively estimated via separate adaptive rules. The authors of [ 19 ] set the goal to improve the control performance for the uncertain nonlinear systems. The idea of the study is to use a self-organizing, fuzzy neural network to imitate the control law directly and, then, to appeal to obtain a compact structure of the controller to further reduce the computational burden and to enhance the control performance. Controlling system tuning by an online fuzzy-based approach was proposed to intelligently optimize the gain values in the load frequency control structure in [ 20 ]. Then the intelligent fuzzy based inference system for autonomous mobile robot navigation is presented by [ 21 ], for a rigid robotic manipulator system, it is presented by [22] or, for bicycle robot balancing, it is presented by [23]. System identification is also a necessary task for the design of the appropriate controlling system. This is an estimation of the system parameters from the data observed. There are a lot of classic system parameters identification methods, such as nonparametric timeand frequency-domain or estimation methods [ 24 , 25 ]. In the identification area, some problems can be formulated as optimization tasks. They can be solved by various high-level optimization strategies employed to minimize (or maximize) an objective function representing the problem. Optimization algorithms can be, in general, divided into two main groups. The first group contains deterministic algorithms, while the second one comprises stochastic (randomized) methods. In our case, the stochastic method–genetic algorithms [ 26 ]–is used. Unfortunately, no mention in connection with the use of genetic algorithms in process identification can be found. On the contrary, references to the use of fuzzy clustering [ 27 ] or neural networks [28,29] can be found. 1.2. The Features of the Proposed Solution The proposed solution is based on soft-computing techniques, is open, flexible, and provides the possibility of expert knowledge embedding. The final intelligent controller is modular. It comprises a module of ongoing process quality monitoring, a module for processing transfer function identification and a module for setting the PID controller parameters. All the modules could be used separately as
Sensors 2020,20, 4454 4 of 27 well as in other concepts for process control. The modules are designed generally for controlling a system of a higher order. The algorithms of the artificial intelligence procedure are formally as simple as possible, understandable for the user and usable in the area of education of new engineers for their clarity. This type of solution minimizes the requirements for computing performance and is suitable for the use in embedded systems. The simulation experiments are selected to prove the efficiency of the non-conventional methods in comparison with the conventional ones. The main idea is to effectively combine the non-conventional methods with the classic ones and to present the possible use. Such a solution allows the use of a combination of exact measurements and vague expert knowledge to improve monitoring and control procedures. It has been decided to combine two approaches to the artificial intelligence area. The first one is the use of the fuzzy-logic rule-based models (expert systems) for the quality improvement of continuous monitoring of the controlling process from the sensor data. This fuzzy system is of the Mamdani type with rule-based operating under two inputs, but it can be very easily extended [ 30 ]. The output of the system is the decision if the actual quality of the controlled process is appropriate, or there is necessity to re-adapt the controlling system. The second fuzzy expert system of the Takagi–Sugeno type is proposed for the controlling system parameters design according to the decision of the controlling process quality [ 31 ]. This tool is also open as for all its aspects, and its knowledge base is built on traditional time-tested PID controller design methods. For the identification of the controlled system parameters, the genetics algorithms optimization methods are proposed. Genetics algorithms are used for finding the parameters of the difference equation of the controlled system. When setting the solution to the state of the art of the intelligent controlling area, the proposed design is sophisticated. All the modules are designed on the basis of unconventional methods. The family of the controlling process is more extensive; it is not designed for one particular controlled system. The paper has not presented a solution for one controlling issue. Yet, it is more general, but it includes the possibility to adapt the modules to a specific issue in a simple manner. The remaining part of this paper is organized as follows. Section 1summarizes the work relating to intelligent controlling systems. Section 2outlines the proposed design and details the principles of all parts of the systems presented. Section 3provides the numerical verification and the verification by simulation to illustrate the ability of the proposed solution to find an accurate response to the changing conditions of the controlled system. First of all, the modules are presented and simulated separately to show the efficiency of every module in various cases. Then, the entire intelligent controller is simulated with the description of the re-adaptation strategy. Section 4provides a short discussion on the related topics. 2. Materials and Methods It has been mentioned in the beginning that the idea is to design an intelligent controlling system, where all the essential parts are built on the use of non-conventional methods. A combination of two approaches from the field of artificial intelligence–fuzzy-logic expert systems for the decision of the appropriate or non-appropriate controlling quality and for controller parameters setting–was proposed. Then, a non-conventional identification of the controlled system parameters by genetic algorithms was designed. All the parts can be used separately or together. The intention was to design systems based on fuzzy-logic principles [ 32 ] and soft-computing methods [ 33 , 34 ], as well as novel systems based on standard methods [ 35 ]. A simplified system block schema (Figure 1) used three modular blocks–ES1, IS, and ES2. The schema was built on the primary negative feedback loop controlling with two sensors placed for measuring the input u(t) and output y(t) of the controlled system. All the parts are going to be described in detail. The design is proposed more generally, but provides a particular example.
Sensors 2020,20, 4454 5 of 27 Figure 1. The schema of the proposed intelligent controlling system. 2.1. Quality Monitoring–ES1 This section focuses on the adjustment of the quality monitoring system (ES1) [ 30 ] for deciding when to re-adapt the classic PID controller. In the schema of the intelligent controller, it was connected to a block for controlling the system design. The monitoring system presented has some common elements with [ 36 ]. A fuzzy expert system [ 37 ] of the Mamdani type [ 32 , 38 ] was created. This system contains two inputs (relative overshoot and settling time), but the settling time is not defined as a classic time quantity, but as the part or multiple of the previously measured settling time (relative settling time), and one output (score). The score determines if it is necessary to re-adapt the controller. To better understand the article and the issue itself, a block containing monitoring procedure on the schema of the intelligent controller is outlined in Figure 2. Figure 2. The schema of the concept of intelligent controlling system with outlined block of monitoring procedure. 2.1.1. Quality Monitoring Inputs The fuzzy expert system ES1 [ 30 ] is a decision support system [ 39 ] with two inputs, which are easily obtained from timing a controlled process–relative overshoot and relative settling time. The meaning of these variables is depicted in (Figure 3). As the relative overshoot, the first peak overshoot rated to the steady-state value of the step response was chosen. The settling time was the time from which the timing stays in the range of ±p % of the steady-state value of the system step response [1].
Sensors 2020,20, 4454 6 of 27 Figure 3. The depiction of the overshoot and the settling time in general timing. ES1 was the fuzzy expert system, so the inputs were the linguistic variables with the following meaning. The first input was called Relative Settling Time (RST), it was the linguistic variable with settable linguistic values. The Relative Settling Time (Equation (1)) was computed as the ratio of the actual settling time (STk) and the settling time of previous steady state (STk−1): RSTk=STk STk−1. (1) It is necessary to save the settling time of the previous steady-state in the memory. The settling time is often set as a 2% standard deviation from the steady-state value [ 1 ], but the user can choose its value in our opinion, it is an optional value. It is proposed to set the linguistic values of the RST as follows (Figure 4): •Faster–the settling time, in comparison with the previous settling time, is shorter •Optimal–the settling time and the previous settling time are almost the same •Slower–the settling time, in comparison with the previous settling time, is longer The numerical description of the broken-line shape of the linguistic values membership functions could be provided as follows: • Faster– [F1F2F3] , where e.g., F1= 0, F2= 0 and F3= 1, it means Faster— [001] , the right border F3= 1 is equal to the idea that, in this point, the RST of previous and actual time course are the same and do not belong to this linguistic Faster value. • Optimal– [O1O2O3] , where e.g., O1= 0, O2= 1 and O3= 2, it means Optimal— [012] . The Optimal value means that the actual settling time is around the value of the previous settling time and is not greater than two times. The right border O3= 2 could be set as another value, in this case the monitoring system is not going to be so “strict”. • Slower– [S1S2S3S4] , where e.g., S1= 1, S2= 2, S3= 100 and S4= 100, it means Slower– [1 2 100 100] . The value of S2 can also be set to the other value according to the value of O3 ; the bigger S2 and O3 (proposing S2 = O3 ) are the less strict the monitoring system is. The values exceeding the limit of S4 are considered as equal to S4 , as the limit of the linguistic Slower value.
Sensors 2020,20, 4454 7 of 27 Figure 4. The shape of the membership functions of the linguistic values for the input linguistic variable Relative Settling Time (RST) [30]. The linguistic input called Relative Overshoot (RO) was selected as the second input of the fuzzy expert system for the quality of the time response. The value of the overshoot can be seen in the time response of the controlled system, and it is detected after any change in the closed controlling loop. The relative overshoot is represented as the difference between the maximal overshoot (MO) of the controlled variable (y(t)) and the change of the setpoint–the required value (w(t)) (see Figure 1) is rated relative to the required value (Equation (2)): RO =|MO −w(t)| |w(t)|. (2) The relative overshoot is expressed in percentage. The value of the Relative Overshoot should be stored in the memory along with the value of the Relative Settling Time. This linguistic input was settable, and the use of three linguistic values was proposed (Figure 5): •Low–the relative overshoot is small, and, from the controlling point of view, it is a good state. • Appropriate–the value of the relative overshoot is small enough, the border for the acceptable overshoot is often set as 20%. • High–the relative overshoot is high, which is not good for many controlled systems and especially for the sensors (which are used for the measurement of the required value). The influence of a high overshoot on the sensors could be fatal. The sensors can be destroyed by a high overshoot, which is a better option. Or, the high overshoot can damage the sensor, but the sensor will function, although inaccurately. The poor functionality of the sensor will not be clear at first sight, and the entire system will work unpredictably. The shape of the membership functions of the linguistic values expressed by the fuzzy sets can be written using the numerical entry: • Low– [L1L2L3L4] , where e.g., L1= 0, L2= 0, L3= 0.1 and L4= 0.15, it means Low– [0 0 0.1 0.15] . • Appropriate– [A1A2A3] , where e.g., A1= 0.1, A2= 0.15 and A3= 0.2, it means Appropriate–[0.1 0.15 0.2]. • High– [H1H2H3H4] , where e.g., H1= 0.15, H2= 0.2, H3= 10 and H4= 10, it means High–[0.15 0.2 10 10].
Sensors 2020,20, 4454 8 of 27 Figure 5. The shape of the membership functions of the linguistic values for the input linguistic variable Relative Overshoot (RO)–design no. 1 [30]. The other possible setting could be defined as follows (Figure 6): •Low–[L1L2L3], where e.g., L1=0, L2=0 and L3=0.15, it means Low–[0 0 0.15]. • Appropriate– [A1A2A3] , where e.g., A1= 0, A2= 0.15 and A3= 0.2, it means Appropriate–[0 0.15 0.2]. • High– [H1H2H3H4] , where e.g., H1= 0.15, H2= 0.2, H3= 10 and H4= 10, it means High–[0.15 0.2 10 10]. Figure 6. The shape of the membership functions of the linguistic values for the input linguistic variable Relative Overshoot (RO)–design no. 2. The second design proposal is not so “strict”. The design depends on the expert’s experience, the nature of the controlled system, and the method of the controlling strategy. 2.1.2. Quality Monitoring Output Expert system ES1 represents a system with two linguistic inputs and one linguistic output–Score. The Score linguistic variable must be defuzzified using the Center of Area method (COA) [ 33 ]. The higher the value of the Score is the more the controlling process is considered as good enough and the selected controller as appropriate. It was set that score value of less than “two” is regarded as unsatisfactory, and the controller has to be re-adapted [ 36 ]. Everything equalling or exceeding “two” is regarded as good enough.
Sensors 2020,20, 4454 9 of 27 The Score linguistic variable is also a linguistic variable with linguistic values expressed as fuzzy sets (Figure 7). In this case, four linguistic values were used, and their triangular-shape membership functions could be described as follows: •Approximately zero—[001], •Small—[012], •Medium—[123], •Large—[233]. The linguistic values of the Score can be adjusted for a particular case if necessary. Figure 7. The shape of the membership functions of linguistic values for the output linguistic variable Score [30]. 2.1.3. Quality Monitoring System Knowledge Base The knowledge base was formed by nine linguistic IF-THEN rules of the Mamdani type [33]: 1. If (RO is Low)and (RST is Slower)then (Score is Medium) 2. If (RO is Low)and (RST is Optimal)then (Score is Large) 3. If (RO is Low)and (RST is Faster)then (Score is Large) 4. If (RO is Appropriate)and (RST is Slower)then (Score is Small) 5. If (RO is Appropriate)and (RST is Optimal)then (Score is Medium) 6. If (RO is Appropriate)and (RST is Faster)then (Score is Large) 7. If (RO is High)and (RST is Slower)then (Score is Approx.zero) 8. If (RO is High)and (RST is Optimal)then (Score is Small) 9. If (RO is High)and (RST is Faster)then (Score is Medium) The shape of the membership function of the output variable was inferred using the Mamdani method [ 33 ]. As the inference method, the Fuzzy Modus Ponens derivation rule was implemented [ 40 ]. The linkage between the rules in the knowledge base is disjunctive. Fuzzy conjunction and fuzzy implication were interpreted as basic logic functions—fuzzy disjunction, fuzzy conjunction and fuzzy implication were interpreted as maximum, minimum and minimum resp. According to this fact, the algorithm of the derivative methods was straightforward. The crisp value of the Score output was performed using the Center of Area defuzzification method. 2.2. Identification System–IS Controlled system parameters identification is a known and necessary task in controlling the design and its following adaptation [ 41 ]. System identification is used to assess the nature of the systems. The use of genetic algorithms, as the optimization procedure for finding the parameters of the system transfer function, is proposed. The system representation in the form of the transfer
Sensors 2020,20, 4454 16 of 27 0 5 10 15 20 25 30 0 0.5 1 1.5 Step Response Time (seconds) Amplitude 0 5 10 15 20 25 30 0 0.5 1 Step Response Time (seconds) Amplitude Figure 12. Step response of initial ( upper ) system and changed ( lower ) controlled system according to the simulation of monitoring system [49]. The quality monitoring system was robust enough; the usability was tested for the controlled systems up to the third-order, but there was no reason why it could not work for controlled systems of a higher order. Yet, however, it should be mentioned that stable, controlled systems were taken into consideration here. The next idea stems from the definition of another/other input(s), for which the system was prepared. 3.2. Identification of Transfer Function Parameters–IS The next part deals with the simulation of the identification module (IS), which is going to be demonstrated for the system of the third-order with the following transfer function [49]: GIS (s)=s+1 s3+3s2+3s+4. (19) Z -transform was used where the sampling period was defined as T= 0.25 s; the difference equation of the system was then as follows: yoriginal (k)=−(−2.31816)y(k−1)−1.83381y(k−2)−(−0.472367)y(k−3) +0.0264792u(k−1)+0.00182614u(k−2)−0.0174828u(k−3). (20) After using the identification procedure, the resulting difference equation was determined as: yidenti f ied (k)=−(−2.31758)y(k−1)−1.83278y(k−2)−(−0.471842)y(k−3) +0.0264684u(k−1)+0.00184947u(k−2)−0.0174791u(k−3), (21) which was practically the same as (20) with the following best value of the fitness function: J=1.07770 ×10−12. (22) After applying the inverse Z -transform with the same T= 0.25 s, the continuous transfer function after identification equalled: Gidenti f ied (s)=−0.0000539209s2+1.00011s+1.00199 s3+3.00444s2+3.00171s+4.00825 . (23)
Sensors 2020,20, 4454 17 of 27 The approximated system transfer function corresponding to the shape of (20) was determined as: Gapproximated (s)=1.00011s+1.00199 s3+3.00444s2+3.00171s+4.00825. (24) To assess the difference in the step response of the original (19), identified (23) and approximated (24) system, see Figure 13. The error calculated as a definite integral of the absolute value of the difference between the original and identified step responses was 0.2946, or 0.03137 between the original and approximated ones. The graphical representation of the step responses of the original, identified and approximated systems was practically the same as the difference was minimal and the curves merged. The computing time for the experiment presented was 6.386 sec based on the data from 97 samples of the input-output values (the simulation time was chosen as 25 s, using sampling period T= 0.25 s; three samples were not used as they were incomplete for the system of the third-order because it was necessary to know the data three steps back). The method repeatability was proved by repeating the experiment hundredfold (Table 1). 0 5 10 15 20 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 Step Response Time (seconds) Amplitude original identified approximated Figure 13. The step response of original, identified and approximated system [49]. Table 1. Exploratory statistics corresponding to hundredfold repeating of simulation [49]. Y1Y2Y3 original −2.31816 1.83381 −0.472367 identified mean −2.31318 1.82481 −0.467787 median −2.31390 1.82610 −0.468444 std 0.00341 0.00618 0.003142 min −2.31769 1.79844 −0.471932 max −2.29859 1.83297 −0.454380 U1U2U3Fitness Function Value original 0.0264792 0.00182614 −0.0174828 identified mean 0.0262743 0.00210919 −0.0174222 1.20482 ×10−10 median 0.0263552 0.00203472 −0.0174471 6.02287 ×10−11 std 0.0002218 0.00023706 0.0001634 1.80597 ×10−10 min 0.0252438 0.00182211 −0.0180518 1.07770 ×10−12 max 0.0266417 0.00311891 −0.0168724 1.24241 ×10−09 The proposed method was robust enough and repeatable, as it was proved. The next idea was to shorten the computing time using only the fragments of the signal, which is also especially useful,
Sensors 2020,20, 4454 18 of 27 or to parallelize the identification procedure. Based on our findings, the identification from only the sample of the time response also worked properly, and it was faster [43]. Genetic Algorithms Parameters The use of the genetic algorithms depended on the GA parameters used and the computing power of the equipment employed. All the experiments were performed with the same computing equipment and the same GA setting. The GA parameters used were set as follows •Crossover probability—0.9, •Mutation probability—0.2, •Population size—31, •Offspring size—30, •Selection—rank weighting, •Crossover—interpolation between two individuals [50], •Mutation—movement on each dimension by ±0.1×random number. A combination of the resulting value of fitness function 1 × 10 −12 and 100,000 generations was chosen as the stop criteria for the demonstration of the proposed identification method accuracy. The stop criteria were used independently; if one of them set in, the identification process was stopped. These stop criteria were set to achieve remarkably high accuracy, which could be considered as unnecessary. If it was necessary, according to the accuracy required, the stop criterion could be set in another manner, and the computational time was going to be significantly shorter. For the second-order system, the real computation times were approximately around 1 s for 60,000,000 iterations of the GA conducted on a regular computer with a 2 GHz processor. The convergence speed is shown in Figure 14. Figure 14. The convergence speed—the accuracy in the point of view of necessary iterations [42]. The only criterion for the use of a system of a high order was the computing time, which could be improved using more powerful hardware. The future work in this area is going to focus on the parallelization of the problem. The next question is whether genetic algorithms could be replaced by another method from the artificial intelligence area, such as a bee colony, ant colony algorithms, or particle swarm optimization. All these propositions were viable. It was decided to use genetic algorithms because they were assessed as the best known in the classic industrial area, where doubts about artificial intelligence approaches persisted. 3.3. Controlling System Design–ES2 The last separate module to be simulated was the module for the PID controller parameters design. The simulation of ES2 was performed using a system with the transfer function:
Sensors 2020,20, 4454 19 of 27 GES2(s) = 1 3s2+12s+15. (25) According to the design of ES2 presented in the paper (see Section 2.3.1), it can be stated that parameter a2 was neither XS nor Small, a1 was more Small than Medium and a0 was Medium rather than Large. ES2 was designed in three versions compared with the traditional PID controller’s corresponding conventional design method (Figure 15)—the Ziegler–Nichols step response method (Figure 15–upper), a combination of Ziegler–Nichols methods (Figure 15–middle) and the Chien, Hrones, and Reswick setpoint response design method with a 0% overshoot in a variant with a 0% overshoot (Figure 15–lower). Comparison of the time response for the unit step of all versions was conducted. The difference in the overshoot of the time response of a closed feedback control loop for the unit step (Figure 15) was assessed as 24.09%, or 24.375 p.p. and 11.378 p.p. when comparing classic and expert design methods (Table 2) of conventional PID controllers on behalf of expert methods. The difference observed in settling times is shown in Table 2. The settling times in the first two versions were noticeably shorter. In the last option (CHR design method), the settling time was longer, but, with the benefit of the time response, almost without an overshoot. Figure 15. Time responses comparison of the closed feedback loop with a PID controller with parameters determined using the created ES2 and classic appropriate methods for a unit step for a2= 3, a1= 12 and a0= 15 [49].
Sensors 2020,20, 4454 20 of 27 Table 2. Overshoot and settling time in percent of step response of controlled system with parameters a2= 3, a1= 12 and a0= 15 [49]. Design Method Overshoot (%) Settling Time (2% Standard) (s) ZN step response method classic 58.69 2.5934 expert 34.60 1.6355 Combination of ZN methods classic 25.72 5.4623 expert 1.345 2.4214 CHR method classic 15.86 1.6975 expert 4.482 2.1660 3.4. Intelligent Controller A general design of the intelligent controller with the artificial intelligence approach is proposed. The intelligent controller concept contained three main parts: quality monitoring, an identification system, and a PID controller design system. The work aimed to show the use and efficiency of artificial intelligence methods in controlling the issue. After verification of the independent modules, all parts (ES1, IS and ES2) were connected, creating an intelligent controlling system according to the schema in Figure 1. The verification focused on demonstrating the efficiency of the proposed intelligent controller. The re-adaptation strategy using ES1 was briefly described above. For the sake of clarity, the re-adaptation process is shown in Figure 16. The identification procedure (using IS) was continuous (the data were obtained from the sensors continuously, in predefined time samples), so it meant that, in every moment, it should be able to determine the parameters of the controlled system without a significant delay. The ongoing checking of the difference of the required and controlled value (the relative overshoot) of the timing was performed and stored in the memory. In addition, the settling time was measured and stored in the memory after every quick change in the required (step change) or controlled value. After obtaining both values (inputs of ES1), the score was assessed. According to the value of the score, Score (≥2 do not re-adapt <2 re-adapt ), (26) re-adaptation of the PID controller was conducted due to the parameters identified by the IS system. ES2 acted based on the decision made by ES1 on whether the re-adaptation was needed and worked with the knowledge obtained from the identification system about the parameters of the controlled system. The simulation was performed using timing (Figure 17), where all critical moments and information were written. ES2 was used in one of its three versions—the version with the Ziegler–Nichols step response method. The simulations began with the controlled system (S1) with transfer function GS1(s) = 1 0.5s2+17s+22, (27) and its step response in time tA . The parameters of the corresponding controller with transfer function GR1(s) = 149 1+1 0.37s+0.09s, (28) were designed using ES2. In the timing, the overshoot of 14.7% was observed and settling time tst1 of 1.4 sec was obtained from measurement. The corresponding score was evaluated using ES1 as score1=2.01 >2. (29)
Sensors 2020,20, 4454 21 of 27 Figure 16. Flowchart of the re-adaptation process in two variants ( a ) with the identification procedure of the parameters of the controlled system after the score evaluation, ( b ) with the continuous system identification. The value of score1 was bigger than 2, so it means that the timing was assessed as good enough. Then, at time tC, the change of the controlled system was performed to GS2(s) = 1 s2+2s+4.5, (30) in the timing, the overshoot equalled 434.6%, which can be seen in settling time tst2= 1.2 sec. The quality of process controlling was evaluated as inappropriate using score: score2=1.11 <2, (31) as inappropriate. The controlled system was identified using IS with the transfer function: GS2ident(s) = 1 s2+2.00122s+4.50034, (32) in 1.232 s (using sampling period T= 0.1) with fitness function JS2= 6.13771 × 10 −10 . The identification had been stopped before the step change in the required value was performed, but if the identification had not been stopped earlier than the step change was made, the identification would have been stopped by this change in the required value. The re-adaptation of the parameters of the controller was planned in the next change in the required value, which was introduced in tF= 6 s. The re-adapted controller had the transfer function in the following form: GR2(s) = 6.1 1+1 0.58s+0.14s, (33)
Sensors 2020,20, 4454 22 of 27 where the parameters were again designed using ES2 in the version with the Ziegler–Nichols method. The control process was performed with an overshoot equalling 13.7% and settling time tst3= 1.2 s. The appropriate score calculated by ES1 was: score3=2.04 >2, (34) which corresponded to the satisfactory control timing. Afterwards, at tG= 10 sec, the sudden change in controlled system GS2 caused a return to the system which had the same transfer function as GS1: GS3(s) = 1 0.5s2+17s+22, (35) which was accompanied by the 3.4%-overshoot and settling time tst4=2.8 s and score4=2.00, (36) which, according to the proposed procedure (see Figure 16), was assessed as appropriate. At time tI , the step change in the required value was made again; the score using ES1 was inferred as: score5=2.55 >2, (37) with the inputs of ES1 settling time tst5= 3 s and the overshoot = 4.1%. Since score5 was bigger than 2, re-adaptation of the PID controller was not necessary, it was adequately compensated by the original controller GR2(s). The entire system incorporating all the parts presented worked properly. In the paper, the design is introduced in a general manner so that it can be modified to another family of a controlled system according to the expert’s knowledge.
Sensors 2020,20, 4454 23 of 27 Figure 17. Time course of the simulation of the intelligent controller [49].
Sensors 2020,20, 4454 24 of 27 4. Discussion The paper focuses on the application of a modern soft-computing technology. Conventional mathematical methods and unconventional methods of artificial intelligence are integrated into the design of an intelligent controller system. The solution uses information from sensors performing continuous measurements of indicators of the control process. When dealing with the design of the intelligent controller, several goals were pursued, listed in the introduction of the paper. Its modularity secures versatility and flexibility of the solution. The sub-subsystem for continuous monitoring of the quality of the control process, the subsystem for ongoing identification of the transient function of the controlled system and the subsystem for continuous adaptation of the PID controller are also usable in other applications. The process monitoring subsystem module and the controller parameter adaptation subsystem module are fuzzy-logic expert systems; their language models are open for extension by other expert rules. Language models are easily understandable to the users. Language oriented expert modules use Mamdani and Takagi–Sugeno inference mechanisms. Their algorithms are relatively simple. Similar programs are not computationally intensive and contribute to minimizing the required computing power. For this reason, a simple optimization genetic algorithm is also used in the module of continuous identification of the controlled system. Computing modules, as well as an intelligent global controller, can thus be part of embedded control systems. The simplicity of the solution also supports its use in the school teaching process. The original solution of Mamdani and Takagi–Sugeno fuzzy modules is the choice of structures of their language models, determination of structures and parameters of fuzzy values of their language variables and expert formulation of language rules by their knowledge base. The use of genetic optimization algorithms in the module of continuous system identification is also original. When designing the system, the control of higher-order systems was considered. The procedures of individual modules and their integration in the intelligent controller system were programmatically implemented in the Matlab and Simulink system. The correctness of the proposed solutions was simulated by testing both modules and their integration in the intelligent controller system. The effectiveness of artificial intelligence tools was demonstrated by comparing the results of re-adaptation of PID controller parameters. Three conventional adaptation methods were tested, namely the simple Ziegler–Nichols method, the combined Ziegler–Nichols method and the Chien–Hrones–Reswick method. Their mathematical and fuzzy-language models programmatically implemented all three methods. In all three cases, the application of language models was more successful. In the further development of the presented intelligent controller system, attention will be paid to its implementation in a microprocessor embedded systems. Author Contributions: Conceptualization, J.N. and M.P.; methodology, J.N. and M.P.; software, J.N.; validation, J.N.; formal analysis, M.P.; investigation, J.N.; resources, J.N.; data curation, J.N.; writing—original draft preparation, J.N. and M.P.; writing—review and editing, M.P.; visualization, J.N.; supervision, M.P. All authors have read and agreed to the published version of the manuscript. Funding: This work was supported by the Technology Agency of the Czech Republic under the grant no. TN01000024, by the European Regional Development Fund in the Research Centre of Advanced Mechatronic Systems project CZ.02.1.01/0.0/0.0/16_019/0000867 within the Operational Programme Research, Development and Education and by the project SP2020/108 of the Student Grant System, VŠB-Technical University of Ostrava. Conflicts of Interest: The authors declare no conflict of interest. Abbreviations The following abbreviations are used in this manuscript:
Sensors 2020,20, 4454 25 of 27 A Identificator for value Appropriate CHR Chein, Hrones and Reswick COA Center of Area e(t) Control error ES Expert System ES1 Monitoring Expert System ES2 Controlling System Design F Identificator for value Faster G Transfer Function GA Genetic Algorithms H Identificator for value High IS Identification System J Fitness Function K Gain of Proporcional Component L Identificator for value Low and Large M Identificator for value Medium MO Maximal Overshoot O Identificator for value Optimal PID Proportional–Integral–Derivative RO Relative Overshoot RST Relative Settling Time s Laplace Operator S Identificator for value Slower and Small sec Time unit second—for clear usage it is not used s, which is used for Laplace Operator ST Settling Time T Sampling Period TdTime Constant of Derivator TDKNOW Time Constant of Derivator obtained by Expert System TiTime Constant of Integrator TIKNOW Time Constant of Integrator obtained by Expert System u(t) Control variable U Laplace Image of Control Variable (System Input) w(t) Setpoint—required variable XL Identificator for value XLarge XS Identificator for value XSmall y(t) Controlled variable Y Laplace Image of Process Variable (System Output) ZN Ziegler–Nichols References 1. Äström Karl, J.; Hägglund, T. PID Controllers: Theory, Design and Tuning, 2nd ed.; Instrument Society of America: Research Triangle, NC, USA, 1995. 2. Ärzén, K.E. An Architecture for Expert System Based Feedback Control. Automatica 1989 ,25, 813–827. [CrossRef] 3. Äström Karl, J.; Anton, J.J. Expert Control. IFAC Proc. Vol. 1984,17, 2579–2584. [CrossRef] 4. Äström Karl, J.; Anton, J.J.; Ärzén, K.E. Expert Control. Automatica 1986,22, 277–286. [CrossRef] 5. Moore, R.L.; Hawkinson, L.B.; Knickerbocker, C.G.; Churchman, L.M. Expert systems applications in industry. In Proceedings of the ISA International Conference, Houston, TX, USA, 22 October 1984; pp. 22–25. 6. Shirley, R.S. Some lessons learned using expert systems for process control. IEEE Control Syst. Mag. 1987 ,7, 11–15. [CrossRef] 7. Ünal, M.; Ak, A.; Topuz, V.; Erdal, H. Optimization of PID Controllers Using ant Colony and Genetic Algorithms, 1st ed.; Springer: Berlin/Heidelberg, Germany, 2012. 8. Kofinas, P.; Dounis, A.I.; Papadakis, G.; Assimakopoulos, M. An Intelligent MPPT controller based on direct neural control for partially shaded PV system. Energy Build. 2015,90, 51–64. [CrossRef]