Stirring System Design for Automatic Coffee Maker Using OMRON PLC and PID Control

Until now, the development of technology has played a very important role in various aspects of life [1][2]. The development of information technology can be a breakthrough in the field of artificial intelligence that is able to give birth to new information technology in production activities that are controlled automatically with computer technology [3][4]. Rapid technological developments have had a major influence on the way of thinking of industrial engineering science by viewing integrated systems more broadly as a global network between industries [5][6]. Advances in technology can provide great change effectiveness and can facilitate human work on a large and small scale [7]. Along with the many human needs, everything is demanded to be instant [8]. In everyday life, for example, in the manufacture of coffee drinks. Coffee is one of the drinks that are in great demand by almost all groups of people ARTICLE INFO ABSTRACT


Introduction
Until now, the development of technology has played a very important role in various aspects of life [1] [2]. The development of information technology can be a breakthrough in the field of artificial intelligence that is able to give birth to new information technology in production activities that are controlled automatically with computer technology [3] [4]. Rapid technological developments have had a major influence on the way of thinking of industrial engineering science by viewing integrated systems more broadly as a global network between industries [5] [6]. Advances in technology can provide great change effectiveness and can facilitate human work on a large and small scale [7]. Along with the many human needs, everything is demanded to be instant [8]. In everyday life, for example, in the manufacture of coffee drinks. Coffee is one of the drinks that are in great demand by almost all groups of people The implementation of the use of PLC in this study was designed for a small scale in the process of stirring coffee drinks at a speed of 600 RPM. To get a stable speed so that the water does not overflow, a control system is needed. To get optimal results, a system design that can control the stirring speed is arranged automatically using a Programmable Logic Controller (PLC). This system is designed using a rotary encoder sensor C38S6G5-600B-G24N as a speed reader obtained from the movement of the motor, DC Motor JGA25-370 12V as an actuator or stirrer. PLC OMRON CP1E-NA20DR-A is used as a motor speed control device using the Proportional Integral Derivative (PID) algorithm to control the system according to the setpoint entered. The motor speed control system with the PID algorithm shows a system response that works well according to the researchers' expectations. The response of the system obtained is fast enough to achieve a stable speed with a small overshoot value. Thus this system was successfully designed to control the stirring process of coffee drinks automatically and produce stable stirring by giving a set point of 600 RPM at the parameter constant Proportional band is 720%; Integral time is 1.6s, and Derivative time is 0.2s with a rise time value is 1.3s; settling time is 11s; overshoot is 1.1%, and steady-state error is 0.5%. [9], but currently, it is still mostly done manually. In addition, the serving manual requires estimating the amount of coffee and sugar that must be added to a cup of glass [10].
In serving coffee, there is a way to make it easier to make, namely by designing a control system. Moreover, it can be used automatically using a microcontroller [11]. The process of controlling the system with a microcontroller can control the on-off condition of a machine automatically so that it produces good quality [12]. Automatic control can be carried out using various types of controllers, one of which is using a Programmable Logic Controller (PLC) [13]. PLC-based systems in the industrial world that are able to operate quickly and accurately can improve quantity and quality in production [14]. PLC can be used to control various types of machines or processes through digital and analog input/output modules [15]. The implementation of using PLC in this study is designed for small scales such as daily life in making coffee drinks, especially in the stirring process. The rotation of the motor for automatic coffee mixing using PID will control the content of each composition in the container [16]. In addition, the stable rotation of the motor can keep the stirred ingredients from overflowing and stay in the container.
PLC has been used in many systems such as in battery management systems [17], Induction motor [18], Magnetic levitation systems [19], Biodiesel [20], Rubber Drying Machine [21], Smart Home systems [22], Liquid Level Control [23], Solar Power System [24]. PID has been used to control Magnetic levitation system [25], DC Motor [26] [27], Hydraulic Transplanting Robot [28], Biomass Microwave [29], wind turbine [30], Hydroxy Generator [31], Mobile Robots [32], robot manipulators [33], UAV [34]. Some of these explanations are used to underlie in designing a Stirring System for Automatic Coffee Makers Using OMRON PLC and PID Control using PIDAT(191) instructions to control motor speed. PID control system is a control system that is widely used in industry [35][36] [37] because of its reliability in controlling motor speed [38], especially in the mixing process. With the PIDAT(191) instruction, there is no need to make mathematical formulas in the PLC program because this instruction has complete features and automatically calculates the control signal output based on the parameters entered.
The related work to control the DC motor has been done before. Some of them is Linear Quadratic Regulator [39], Fractional Order PID [40], PID Control [41] [42], PID Control [43], Fuzzy Logic Controller [44], State Observer [45]. However, the research only uses simulation, not hardware implementation. This study contributes hardware designed a system to control the stirring process of coffee drinks automatically using rotary encoder sensor C38S6G5-600B-G24N is to measure motor speed. The DC Motor JGA25-370 12V is to drive the stirrer, and PLC OMRON CP1E-NA20DR-A is a system control device and produces stirring at a set point of 600 RPM. There is some section in the research. The first is an introduction, the second is method that consist of system design and algorithm. The third is result and discussion and the last is conclusion.

Methods
System Design Two parts of system design consist of hardware design and software design. The hardware design is made in the form of block diagrams and system wiring diagrams, while the software design is made in the form of flow diagrams.

Hardware Design
The hardware design is made in the form of a block diagram-the three pieces of hardware consisting of a sensor unit, a control system, and an actuator. The hardware design block diagram is shown in Fig. 1. This design control system uses PLC OMRON-CP1E-NA20DR-A to control and process rotary encoder sensor reading data to measure motor speed. The actuator used is a DC motor to drive the stirrer. DC Motor Speed is regulated by the PWM (Pulse Width Modulation) method. PLC provides an analog voltage which is then converted by the Voltage to the PWM module into a % duty cycle to drive the motor. PC/Laptop is used to create ladder diagrams using CX-Programmer software and HMI on CX-Designer, which can be communicated with PLC using USB 2.0 and RS232 cables.
In order to produce optimal motor speed, a PID control system is made on the motor. The purpose of this control system design is to adjust the motor speed so that it can reach the set point according to the input given so that the motor can rotate at a stable speed. The block diagram of the motor control system is shown in Fig. 2. The results of the rotary encoder sensor readings are used as PV values which are then processed with PID control on the PLC to give control commands to the actuator according to the given set point.

Wiring Diagram
To make it easier to understand the system design, the wiring diagram is shown in Fig. 3. PLC gets 220V AC supply voltage. In addition, DC Power Supply is also used to supply other components such as rotary encoder sensors, Voltage to PWM modules, and DC motors. The rotary encoder sensor provides output in the form of pulses. Voltage to PWM module gets analog voltage input from PLC and converts to % duty cycle as output to drive DC Motor. The details of the system input and output units are shown in Table 1.

Algorithm
The software design consists of 2 stages, namely the design of the motor control program flow diagram and the design of the Human Machine Interface (HMI). The motor control program flow diagram is shown in Fig. 4. The workflow of the motor control program begins with the reading of the motor speed value by the rotary encoder sensor. Then the scaling is done so that it is displayed in the form of RPM on the HMI. The scaling result obtained is used as the PV (Present Value) value for further processing by the PIDAT(191) instruction. The mode used is selected between manual or autotuning. Manual mode is done by entering the SV (Set Value) value or often known as the setpoint, PID parameter, and sampling time. Autotuning mode is done by providing a setpoint value, sampling time, and arbitrary PID parameters to assist in the process of activating the autotuning bit. The values that have been entered will be processed by the PIDAT(191) instruction to generate the MV (Manipulated Variable) value as the system output command to drive the motor according to the given set point.

Human Machine Interface (HMI) Design
The HMI design was made using the CX-Designer software. The HMI display is in the form of a motor controller page containing PID parameters, % analog output, resolution values as well as a control graph shown in Fig. 5. This HMI is used to observe the measured speed value of the rotary encoder sensor, which is displayed with the RPM graph, enter the setpoint, sampling time, and PID parameters and activate the autotuning function. The system response can be observed through the resulting graph and log data which can be saved in the form of a .csv file.

Result and Discussion
The results and discussion of this research include the manufacture of hardware, testing of motor speed control consisting of a Proportional Integral (PI) controller and a Proportional Integral Derivative (PID) controller.

Hardware Manufacturing
Hardware manufacture in this study consists of several main components, namely rotary encoder sensors, DC motors, and Voltage to PWM modules, and motor drivers that are shown in Fig. 6. There is a module of analog voltage to PMW, the Mosfet IRF540 as Motor Driver and Rotary Encoder Sensor.

PI Control Testing
Testing of motor speed control using a Proportional Integral (PI) controller was carried out by trial and error method by entering various parameters for three trials. This test was carried out on a motor that drives a coffee drink stirrer containing 200 ml of water and a mixture of 50 g of sugar and coffee with a set point of 600 RPM and a sampling time of 40 ms. The test results are shown in Fig. 7.
The results of the system response from this test are stored in the form of a .csv file to observe the motor speed every second and analyzed using Matlab to get the response of the control system. The results of the analysis are shown in Table 2, and the comparison of the three graphs is shown in Fig. 8. From the results of the analysis using Matlab, motor speed control produces the most stable system response at parameters PB = 500%; Tik = 0.6s with rise time value = 1.1s; settling time = 8.4s; overshoot = 52.6%; and steady-state error = 0.8%.

PID Control Testing
Testing of motor speed control using a Proportional Integral Derivative (PID) controller was carried out by trial and error method for three trials. This test was carried out on a motor that drives a coffee drink stirrer containing 200 ml of water and a mixture of 50 g of sugar and coffee with a set point of 600 RPM and a sampling time of 30 ms. The test results are shown in Fig. 9. The blue line is the set point or reference value, and the red line is the angular speed system response.   The results of the system response from this test are stored in the form of a .csv file to observe the motor speed every second and analyzed using Matlab to get the response of the control system. The results of the analysis are shown in Table 3, and the comparison of the three graphs is shown in Fig. 10. From the results of the analysis using Matlab, motor speed control produces the most stable system response at parameters = 720%; = 1,6s; = 0.2s with rise time value = 1.3s; settling time = 11s; overshoot = 1.1%; and steady state error = 0.5%.

Conclusions
The system design in this study succeeded in applying the motor control method using PLC OMRON CP1E-NA20DR-A as a system controller device. The results of motor control using a PI controller show that the system response is the most stable at the value of = 500%; = 0.6s with rise time value = 1.1s; settling time = 8.4s; overshoot = 52.6%; and steady-state error = 0.8%. The results of motor control using a PID controller show that the system response is the most stable at the value of PB = 720%; = 1.6s; = 0.2s with rise time value = 1.3s; settling time = 11s; overshoot = 1.1%; and steady-state error = 0.5%. Based on the test results obtained, there are still shortcomings that can be improved. Suggestions given to further researchers are that they can improve the PID control system with PID tuning methods such as Ziegler-Nichols, Cohen-Coon, and so on so that PID parameters are obtained that can be used as reference values for the next tuning process.
Supplementary Material: The video abstract for the system can be seen in the URL https://youtu.be/r4CCmZnw90E Author Contribution: All authors contributed equally to the main contributor to this paper. All authors read and approved the final paper.
Funding: This research was funded by Universitas Ahmad Dahlan.