Design of a new PID controller based on Arduino Uno R 3 with application to household refrigerator

A refrigeration system to maintain a desired compartment temperature usually uses a thermostat as an on-off controller. In fact, the thermostat has some disadvantages. The main problem of system which is related to the thermostat is the biggest energy consumption in household appliances. In this paper, to solve the problem was designed a new PID controller based on an Arduino Uno R3 with application to a household refrigerator. In this case, the Arduino Uno was uploaded with PID controller algorithm. Then, in implementation to determine controller parameter values was defined new criteria. After that, to obtain the best refrigeration system performance was also proposed new performance criteria based on experimental data. The experimental results showed that the proposed control system was able to maintain the desired temperature with steady-state error of about 0.044°C. In addition, in steady state the control system for the refrigerator was able to the energy saving of about 30% and it almost did not depend on cooling load quantity.


Inroduction
A household refrigerator can maintain a desired compartment temperature since it employs a thermostat which serves as an on-off controller.In fact, the thermostat has some disadvantages.First, the present of control differential, difference between cut-in or cut-out temperature and setpoint temperature, causes response error that is set consciously according to the working principle of the on-off controller.Thus, the error is embedded in the thermostat.Second, if the differensial is set at a too small value, then the refrigerator will often turn on and off.Consequently, this action can breakdown the compressor [7,17].Besides that, the action also requires high starting current equals to 4 to 10 times bigger than running current [21].Third , the energy consumption of refrigeration system is the biggest in household appliances [11,13,15].
To respond these disadvantages, the researchers developed a new on-off controller.However, this way could not reduce significantly both response error [20] and the energy consumption [12].Then, PID (Proportional Integral Derivative) controller concept was used to improve the on-off controller [1,2,16,22].Then, it was followed adaptive control concept [8,9,23].However, in implementation they had constraints, both of them were determination of control parameters, and control components that were needed to support a control system [5].For example, to modify from the on-off control system to the PID one it needs to consider adding of safety components to avoid an overheat compressor.Since, the PID one is always working without ever turning off as in the on-off one.
To reduce the problem and also to give a better optional controller, then in this paper was designed a new PID control system based on Arduino Uno R3 with application to the refrigerator.In this case, Arduino Uno R3 was uploded with a new PID controller algorithm.Control parameters are proportional gain Kp, integral gain Ki, and derivative gain Kd that were determined using a method of trial and error so that the control system response satisfies the proposed criteria.Moreover, it was investigated effect of various cooling loads to the refrigeration system performance.In this case, it was found settling time (ts), steady-state error (Ess), and also consumption of electrical power and energy.Then, the data was displayed on a LCD 20x4 and also on a Laptop in which was installed both softwares of Excel dan PLX-DAQ.

Design of control system
The design of control system consists of two parts, namely design of hardware and program.The design of hardware includes determination of controller, sensor, and actuator which will be selected.A controller is a device to maintain a quantity be the same as setpoint.It was a mechanicalelectrical device or a electronic circuit, for instance a thermostat.However, currently the present of computer have supported control development.Thus, the working principle of old controller can be adopted into a computer program form so that the computer can be used as a MATEC Web of Conferences 154, 01044 (2018) https://doi.org/10.1051/matecconf/201815401044ICET4SD 2017 controller.This is known as control system based on computer.In this case, the design of program is of computer program for PID controller.To do this, it is initialized by designing a flow chart of the controller.
After all design stages were accomplished, then was continued determination of PID control parameters, namely Kp, Ki, and Kd.To determine the control parameters was used a method of trial and error .The proposed criteria are to find Kp, Ki, and Kd value by substituting various sets of values of the control parameters into the algorithm of PID controller so that was obtained a set of value of Kp, Ki, and Kd that results in Ess be within the limited range from 0 to 0.5.The method is the simplest, so it can be performed easily and quickly.However, the result is really effective and accurate.

Design of hardware
In this paper, the explaination focuses on designing of main components that is related to control system.Whereas, the other components are shown directly their connection paths to the Arduino which can be traced through a wiring diagram of the entire hardware design.

Selection of microcontroller.
To design a PID controller was selected a microcontroller which is called the Arduino shown in Fig. 1.To this purpose, an algorithm of PID controller was uploaded into the Arduino.

Selection of actuator
As an actuator was selected Variable Speed Drive (VSD) Telemechanique Altivar 11 or also called Inverter that has capacity of 1 HP (1 to 3 Phase) 220V shown in Fig. 2. It can vary both its voltage output and frequency which will be sent to a compressor motor.It means that the compressor is operated at any certain frequency so that motor rotation per minute is also at any certain value.Thus, the compressor can respond the changes of frequency that are equivalent with the changes of cooling load value in the refrigerator compartment.If cooling load value is smaller, then the energy consumption is also smaller, and verse.

Connnection of temperature (sensor)
To measure compartment temperature was selected a sensor DS18B20.Connection of sensor DS18B20 with Arduino UNO R3 is shown in Fig. 3.

Display
Monitoring of data that includes temperature, Kp, Ki, Kd, electrical voltage and current was conducted through two displays, namely LCD and monitor of laptop.The usage of LCD display (20x4) with I2C is to minimalize pin usage of the Arduino.And the connection of LCD display 20x4 with I2C to the Arduino UNO R3 is shown in Fig. 4. Whereas, a data display that uses a Laptop in which was installed a PLX-DAQ Software and Ms. Excel can be seen in Fig. 5. form.In the diagram all components are displayed and shown their connections except Laptop which its connection has been provided a particular slot and a USB cable.The Arduino Uno as controller is connected directly to a temperature sensor DS18B20, Variable Speed Drive (Inverter) and LCD.However, to drive a compressor of the refrigerator, it does not have a connection directly and must be through an Inverter .

Design of program
In this case, the program design does not only design a program of PID controller [3], but also it includes a data monitoring program.The controller design was conducted based on the flow chart shown in Fig. 7.This figure shows generally an algorithm of PID controller including input setpoint temperature (Ts) and read sensor output Tc.Then, calculate error, if error < 20 is true, this is caused maximum error be 20 which is Tset= 8 0 C subtract maximum compartent temperature Tc = 28 0 C , then calculate output of controller.If output > 255 is true, then output = 255 and If output < 0 is true, then output = 0, this is to limit a VSD (Inverter) maximum input of 10 and 0, respectively.So that cooling process can keep a setpoint value.Note that the designed algorithm is different from the existing algorithms including the algorithm in reference 2. Since, the method which is used is different from the existing ones, for example to calculate the output of controller or control signal was developed a new formulae in order to obtain more accurate results.Whereas, the reference 2 only provided results of simulation, not implementation or expremental and to do these was used the existing program, namely Mathlab and simulink

Results and discussion
The test of performance was conducted by using three types of cooling loads.In this case, it only includes determination of settling time, steady-state error ( Ess) and energy consumption.The proposed performance criteria are a maximum steady-state error of 0.5ºC and a maximum settling time value of 2 hours.Besides, it was also investigated effect of cooling loads on the electrical power and energy consumption.To this test was selected a setpoint temperature of 8 o C so that the response reach chilling time quickly and does not take too long time.

Determination of Kp, Ki, and Kd
Before system performance could be determinated , first it was need to find appropriate parameters of Kp, Ki, and Kd of PID controller.For this purpose was used a method of trial and error.Kp, Ki, and Kd were selected by trial so that be obtained the best time response and it satisfies a particular criteria.The proposed criteria of parameter determination are the smallest steady-state error and the maximum error of 0.5ºC as well as the smallest settling time (ts) value that can be obtained by a response curve.Fig. 8 shows temperature curves versus time for five parameter sets of Kp, Ki, and Kd of PID controller.By comparing these curves was obtained the curve which satisfies the criteria, namely for Kp= 200, Ki = 20, and Kd = 0.01.It can be seen that its settling time (ts) value was the smallest,while its Ess was almost the same as others.

Fig. 8.
Step response curves for some Kp, Ki, and Kd values

Analysis of performance
It was investigated the effect of three types of cooling loads to system performance.The cooling loads were formed from each a liter of water whose different temperature of 24°C, 50°C, and 75°C, respectively.In this case, the test of performance includes determination of settling time(ts), steady-state error (Ess), and energy consumption.
Settling time value was determinated from exprimental data displayed in Fig. 9 For this purpose , first, it was need to find error 5% from setpoint 8°C, namely (5/100)x8 = 0.4°C, then compartement temperature = 8.4°C or to find error 2% from the setpoint, namely (2/100)x8 = 0.16°C, then the temperature=8.16°C.Then, settling time for each cooling load could be determinated when the temperature of 8.4°C ( criteria 5%) and then by using curves of cooling loads in Fig. 9 ts could be found, as an example for cooling load 1 was obtained ts = 29°C and similarly ts could be determined when the temperature of 8.16 °C ( criteria 2%).To make easier analysis the important data of Fig. 9. and Fig. 10 is summarized in Table 1.Then, the rest of settling time values for the three different cooling loads can be seen in Table 1.In this case, if cooling load quantity increases then ts value also increases.This makes sense.
Determination of Ess value was performed when refrigerator had worked for three hours assumed had reached steady state.Table 1 shows range of Ess from 0°C to 0.044°C.Thus, it satisfies criteria that Ess has to be smaller than 0.5° C. If it is compared with a thermostat error from 1.5°C to 1.95°C [7,17] Besides, it was also observed whether the consumption of electrical power and energy to be saving or not. Figure 10 shows the decreasing tendency of electrical power consumption for the three cooling loads from about 130 Watt at the part of beginning of curve became lower in range from 80 to 110 Watt.Moreover, from table 1 can be seen in steady state the power consumption for the three cooling loads turned to about 80 Watt.It meant that the consumption decrease of approximately 50 Watt or 30%.
Thus. in steady state the designed control system for household refrigerator could reduce the power consumption of about 30% and it almost did not depend on cooling load quantity.In the other words, the system performs energy saving of approximately 30%, since, the energy consumption is proportional to power one, then the energy saving of system is also proportional to the the power one.As extra information, Table 1 also shows the consumption of electrical energy in steady state for the three cooling loads was almost the same about 0.30 KWH.

Conclusion
The current research investigates the effect of cooling load on the designed control system response, the electrical power and the energy consumption for a refrigeration system, especially a household refrigerator.It can be considered as a promissing enough solution for the sustainable energy issues.The results showed that for three types of cooling loads were obtained range of steady-state error from 0°C to 0.044 °C.Thus, the control system has response more accurate than a conventional system with error from 1.5°C to 1.95°C.Moreover, in steady state the control system could reduce the power consumption of about 30% and it almost did not depend 0.00

Fig. 6 .
Fig. 6.Wiring diagram of the entire hardware design

Fig. 10 .
Fig. 10.Electrical power curves versus time for various cooling loads

Table 1 .
, then, a new PID controller is more accurate.Experimental data for the three different cooling loads with Tset= 8 0 C