Implementation of Fuzzy Logic Control for The Automation of Diesel Engine Cooling Systems

Conventional cooling systems on four-wheeled vehicles generally use a cooling fan driven by the crankshaft through pulleys and a belt (V-belt), causing the wastage of fuel in the vehicle. This study aims to design and implement fuzzy logic control on a prototype of an automatic cooling system for a diesel engine. The tool's design uses the experimental method, uses Arduino as a microcontroller that functions as a data processing center, with inputs of two temperature sensors and a Direct Current (DC) motor as output to rotate the fan, and fuzzy logic control methods as an automatic control system. The research results show that this tool can operate automatically according to the engine temperature, so it is expected to produce greater effectiveness and efficiency. Measurements on each component have been carried out and show satisfactory results, testing on the temperature sensor shows a small error. Comprehensive testing of the tool shows good performance, including the Pulse Width Modulation (PWM) output to adjust the rotational speed of the fan motor so that the system can be used properly. This research will help create a prototype of an automatic cooling system for a diesel engine cooling system so that it can be developed to reveal better fuel efficiency in the future.


Introduction
The use of DC motors as drives for various industrial equipment has been widely adopted.This is because DC motors have many methods, and it is easy to control their speed [1]- [2].The most common DC motor speed control is carried out using an analog PID (Proportional Integral Derivative) [3,4,5].In addition to the PID method, the neural network method [6], the fault-tolerant H-bridge [7], and the sliding mode control [8] are also often used to control the speed of a DC motor.
As with the use of PID for DC motor speed control, fuzzy logic has also been widely used in automatic control and modern industry, including temperature control in the industry [9], lighting in smart buildings [10], nuclear power plants [11], mobile robot control [12], energy management in electric vehicles [13], and others.Fuzzy logic is often used in control systems because it is easy and flexible to set up and doesn't require a complicated mathematical model of the plan to be controlled [14].
The cooling fan is the most important component of the vehicle's cooling system.A cooling system is needed because the vehicle's airflow, when running, has yet to provide sufficient cooling.As the fan turns, it will create cool air and blow it over the radiator to cool the fluid moving through the fins.Heat moves from the radiator fins to the fluid in the radiator, lowering the fluid's temperature [15].
Conventional radiator cooling fans are generally still driven by the crankshaft through pulleys and belts (a v-belt).This type of cooling fan will move continuously when the engine is turned on, so the rotational speed of this type of cooling fan depends on the engine rotation speed.If the engine speed is high, the cooling fan rotation will also be high, and vice versa.If the engine speed is low, the cooling fan rotation will be low.When the crankshaft turns, it moves the cooling fan, which adds to the load on the engine.If you put more weight on the engine, it will use more gas, which makes the vehicle wasteful.
Modern cooling fan drives use an AC motor as the driving force.This AC motor can rotate if an electric current flows into the DC motor.The DC motor in this type of cooling fan, driven by a DC motor using a water temperature sensor (WTS), will operate if the engine cooling water temperature reaches the specified limit.This will help this type of cooling fan in many ways.For example, the engine's working temperature can be reached quickly, and the power needed to turn on the cooling fan doesn't have to come from the engine.This makes the engine run more efficiently and saves fuel.
Previous research has controlled DC motors using fuzzy logic, but it is still limited to computer simulations using various programs, such as the research conducted by [16]- [20].This research will directly apply fuzzy logic control to a DC motor that will drive a fan to support the cooling system on a diesel engine with two sensors as system inputs, which is different from previous research.The goal of this research is to determine how effective the system can be when using fuzzy logic control.This study looks at the speed of rotation of a DC motor used to turn the cooling fan on a cooling system.A fuzzy logic control system controls the motor, and temperature sensors 1 and 2 are inputs.To cool the engine better, fuzzy logic control is used in the engine cooling system.

Research Methods
This study's method is an experimental study, as it should be [21]- [22].This research includes system design, experimentation, analysis, testing, and implementation.

Design of Electrical System
The development of the electrical system design is shown in Fig. 1.Each component has its function and is used for one purpose so the system can run properly.This tool is controlled by an Arduino Uno (1), which is frequently used as a microcontroller in various systems and devices, as shown in [21]- [26].The voltage source is obtained from the battery (2), which is reduced to an Arduino operating voltage between 6V and 12V using a step-down converter (9).Two sensor inputs (3 and 4) get power from the Arduino via the 5V pin.When the sensor detects the temperature, it will be displayed on the LCD (5).Then the motor driver in (7) functions to control the speed and direction of rotation of the 12V DC motor based on the output that has been fuzzy on the Arduino.

2.2
Design of Mechanical System Fig. 2 shows the mechanical system design.Sensor 1 is a device that will detect the coolant temperature before it passes through the thermostat, while Sensor 2 is placed on the oil pan to detect an increase in oil temperature.Both of these sensors will detect the temperature in the cooling system and the temperature in the lubrication system.The results of the sensor readings will then be fuzzy due to the fuzzy logic control that has been embedded in the Arduino.The resulting output is fan rotation, which is divided into three parts, namely low, medium, and high, according to the state of the cooling system and lubricant system.The cooling fan will cool the coolant in the radiator, which will cause the temperature of the engine to drop [27].

2.3
Principle of System Operation Fig. 3 shows a flow chart of how this system works.When the engine is started, there will be combustion in the combustion chamber.When this combustion takes place, there will be heat transfer to the cylinder wall.The heat will continue to increase during combustion in the combustion chamber, so a cooling system is needed to cool the cylinder walls to prevent overheating.The cooling system will regulate the temperature of the engine's working temperature and prevent overhead.One important component in the cooling system is the fan motor.The fan motor functions to cool the coolant circulating in the cooling system.To increase the effectiveness of the cooling engine system, a fuzzy logic system is added.
This fuzzy logic is used to adjust the fan motor speed in the cooling system based on the sensor readings installed on the engine system.There are two temperature sensors used in this system, namely sensor 1, which is on the thermostat and is used to detect the temperature in the cooling system.Temperature sensor 2 is in the lubricating system, which functions to detect the engine oil temperature.When the engine is running, the fuzzy system will start working, and that's when the temperature value is taken in the cooling system and lubricating system, which will then be processed in a fuzzy manner by the microcontroller.Then adjust the rotational speed of the fan cooling system motor.

2.4
Membership Function Fuzzy rules built from an expert's experience or a database can be used by controllers to turn linguistic control strategies into real control strategies [18].Mamdani fuzzy logic is used in this research because it has various advantages.The membership function in fuzzy logic control-based control has 2 inputs and 1 output.Input 1 is the engine temperature, with the number of membership variables being three, namely low, medium, and high.while input 2 also has three membership variables, namely low, medium, and high.Meanwhile, the DC motor fan speed membership function is divided into three, namely, slow, medium, and fast, as shown in Fig. 4. A rule base designed based on input and the specified output can be seen in Table 1.The Fuzzy Logic Toolbox in MATLAB is used to derive the rule base function, as shown in Fig. 4.  Based on the constituent components, the system has its characteristics.So, testing is needed to ensure that each part works well and that all tools can work and be used in a way that meets the design goals [21].Some of the tests are on the sensors, LCD screen, DC motor fan speed, and the system as a whole.

3.1
Result of fuzzy logic in the system The fuzzy controller derives its decisions from the rules included in the database.These options are saved as predefined rules.Rules are direct and easy-to-understand if-then statements based on linguistic statements.The duration of the fan motor speed is determined by nine rules, as shown in Fig. 5. Rules that have been added to the rule editor can be seen in the rule option viewer.This device's input and output membership functions correspond to the defuzzification method.After that, the rule base can be entered via the rules editor menu.The outcomes of the rule viewer can be viewed using the View Rules menu (Fig. 6) and three-dimensional surface viewer (Fig. 7), the surface viewer generates a graph of the defuzzification-released data.The rule viewer is used to set the PWM output to slow, medium, and fast depending on the set temperature input, and this trend can be set.

3.2
Sensor Testing with the DS18B20 Testing of sensors 1 and 2 is carried out to check that they can work properly.The type of sensor used is the DS18B20 temperature sensor, which can work with various types of fluids [28].According to the specifications of the sensor used, the DS18B20 sensor is capable of operating at temperatures of -55°C to +125°C (-67°F to +257°F) [29].This indicates that the sensor is very suitable for the application in the research being developed.The error formula follows the previous study [21].The test results for sensors 1 and 2 show that the average error obtained from these two sensors is 0.5%.This indicates that the accuracy of the sensor used is still within the DS18B20 sensor datasheet range of 0.5°C [29].This indicates the sensor is suitable for use.
The temperature sensor is being tested further by installing both sensors on the engine.Sensor 1 is mounted on the cooling system, located near the thermostat, while sensor 2 is mounted on the oil pan.This test is intended to determine the performance of the sensor against rapid changes in engine temperature.The graph shown in Fig. 8 shows the measurement of engine temperature using two types of temperature sensors, the DS18B20 [29].The graph shows an increase in temperature at the beginning of the engine starting and will continue to increase until about 270 seconds.This shows that the increase in engine temperature is quite fast, so a cooling system is needed on each engine to prevent overhead [15], [27].
Initial data shows that the coolant temperature on the cooling system side is around 29.87°C, while the engine lubricant temperature in the oil pan is around 30.31°C.This is influenced by the room temperature at the time of data collection.Furthermore, the temperature increased significantly in the 270 seconds since the engine was started.Measurements made by these two sensors show that they can work well at high temperatures.This proves that the sensor is able to take measurements well even though the temperature and time changes are quite fast, so it can be concluded that this sensor can be used.

3.4
Testing of PWM and Dc Motor Fan Speeds This test aims to determine changes in PWM and DC motor fan speed due to increased engine temperature as measured by sensors 1 and 2. A PWM indication can be seen on the serial monitor, and fan rpm is measured using a tachometer.Table 3 shows the fan rotation results based on each sensor's readings.Table 3 shows sensor readings 1 and 2, respectively, of 40°C and 50°C, with a PWM value of 45.7 and a DC motor fan speed value of 79.5 rpm.The reading of the temperature value continues to increase, which is also followed by an increase in the PWM value and motor speed.The highest is at 2203 rpm, with sensor readings 1 and 2 equaling 70°C.
Based on this test, the fuzzy logic control built into the microcontroller works well with the output of a DC motor's rotation speed to turn the fan.When the temperature on sensors 1 and 2 increases, this will also be followed by an increase in motor rotation.

3.5
Overall Testing After testing each electrical component, the entire system is tested by combining all components so that it becomes a device that can work automatically, which is regulated by fuzzy logic control.The test is done by putting temperature sensor one on the part of the cooling system shown in Fig. 11 and temperature sensor two on the part of the lubrication system shown in Fig. 12 that is in the oil pan.
The test is done by putting temperature sensor one on the part of the cooling system and temperature sensor two on the part of the lubrication system in the oil pan, which is then used as the voltage source.The Arduino becomes the data processing center with embedded fuzzy logic control.Then, the output is a DC motor (Fig. 14) whose end is connected to a fan that turns automatically based on the temperature measured by a sensor in the cooling and lubrication system.
The overall system is depicted in Fig. 14 in general, the tool works well and can be used in real-world applications, as in previous research [30]- [31], in contrast to previous studies, which were limited to computer simulations using a specific program [32]- [35].The sensor works according to its function, as does the microcontroller as the control center.The fan rotation output on the cooling system is able to work automatically to produce a fan rotation that has been previously set with a fuzzy system.This research created and used a fuzzy logic control implementation system to automate the diesel engine cooling system.This was done by taking measurements of the cooling system and engine lubricant with a waterproof DS18B20 sensor, which tells the exact temperature of the whole engine.The output device, in the form of a DC fan motor, can operate automatically according to engine temperature to intensify engine fuel and produce greater effectiveness and efficiency.Measurements have been taken on each part, and the results are good enough to show that the system as a whole can be used correctly.

Fig. 8 .
Fig. 8. Sensor testing on a diesel engine 3.3LCD Screen Testing LCD testing is done to find out if the LCD being used can function properly.The test is carried out by inputting the program on the microcontroller and connecting the sensor and LCD on the microcontroller to display text or characters on the LCD, then matching the sensor reading value with the character display on the LCD screen.Fig.10shows a program listing and display of sensor readings as characters on the LCD.The display on the LCD is in accordance with the actual sensor reading value, so it can be concluded that the LCD can work well.

Table 2
shows the test on the sensor used by comparing it with a calibrated digital thermometer probe.The results of the test shown in

Table 2 .
Disseminating Information on the Research of Mechanical Engineering -Jurnal Polimesin Volume 21, No. 2, April 2023

Table 2 .
Error value generated by the sensor on the calibrated measuring instrument

Table 3 .
Result of PWM and Dc motor fan speed Information on the Research of Mechanical Engineering -Jurnal Polimesin Volume 21, No. 2, April 2023