## 3 Case Study  
### Modeling of Main Diesel Engine Rotational Speed Control by Fuzzy Logic Control Theory  
Fuzzy controller includes functional blocks (fuzzification, rule base, inference engine, and defuzzification), and it has been described in Figure 1. In this research, the objective of controlling process is a diesel engine speed. In fact, marine diesel engine operates in hard condition under impacting on navigation environment, like as wind, wave, tidal current, etc. All of the external factors will be made the instability of engine when it works. Diesel engine speed is an important factor that it will decide the engine working condition when external load is variable. Furthermore, fuel consumption of engine always associates with engine speed. In a result, diesel engine speed controller is very necessary to help engine works effectively. In Figure 5, the modelling of diesel engine speed automatic control has been presented. Speed error and variable speed error \(\frac{d(speed)}{dt}\) are the input signals of fuzzy controller. Speed error will be compared between reference speed and speed feedback signal that took from output source of diesel engine (revolution on engine speed). Figure 5: Modelling of diesel engine speed control by fuzzy logic controller. In order to conduct the fuzzy control process, the definition of speed error (e) and variable speed error (de) as the input signals of the fuzzy controller. Besides that, the output signals of fuzzy controller must also be determined as engine speed. The linguistic set of e, de, and the engine speed is NB, NM, NS, ZO, PS, PM, and PB. In where: NB = Negative Big, NM = Negative Medium, NS = Negative Small, ZO = Zero, PS = Positive Small, PM = Positive Medium, and PB = Positive Big. The discourse universe of input signals and output signal is a range of [0, 1]. In addition, triangular membership function has been adopted as the membership functions of input signals and output signal of fuzzy controller, respectively. Since each input signal of linguistic set has seven members including NB, NM, NS, ZO, PS, PM, and PB, then the control rule construction of fuzzy controller will include 49 rules, and they have been described in Table 1.  
On the other hand, the fuzzy controller has two input signals then the antecedent of each control rule will have two parts. Equation \"And\" will be used to combine the two parts of the antecedent to gain a signal number that represents the result of the antecedent for that rule. So, the result will be applied in the implication process to achieve the fuzzy set of the output. The implication method has been used as \"And\". It means that the minimum value will be compared with aims in obtaining the desired output value in fuzzy control process. So, the implication process will be implemented for each rule in fuzzy control rules. The simulation process of fuzzy logic controller for diesel engine speed has been identified in Figures 6-8 below. 1. If Speed error (e) is NB and Speed error variable (de) is NB then Engine speed (n) is PB. 2. If Speed error (e) is NB and Speed error variable (de) is NM then Engine speed (n) is PB. 3. If Speed error (e) is NB and Speed error variable (de) is NS then Engine speed (n) is PB. 4. If Speed error (e) is NB and Speed error variable (de) is ZO then Engine speed (n) is PB. 5. If Speed error (e) is NB and Speed error variable (de) is PS then Engine speed (n) is PM. The application of Particle Swarm Optimization (PSO) algorithms for fuzzy logic controller has been described in Figure 9. The initial populations are the first step of Particle Swarm Optimization (PSO) algorithms. Especially, the population is composed of the chromosomes that are real codes. Hence, the \"fitness function\" is generated by the corresponding judgment of a population. Moreover, the \"fitness function\" is the performance index of a population. In particular, the value of \"fitness function\" is bigger and then the performance is better. Equation (4) is represented for \"fitness function\".