Application of an Automated System for Converting Waste Cooking Oil into Aromatherapy Candles

: This research focuses on the development of an automated system for the production of aromatherapy candles using waste cooking oil. The study addresses the challenges faced in small-scale production, including limited capacity, manual processes, and inconsistent product quality. To overcome these challenges, an automated machine is proposed to improve efficiency and productivity. The homogenization process and heating time were identified as critical areas for improvement. A sequential control system was successfully implemented, enabling the conversion of waste cooking oil into aromatherapy candles with a production capacity of 10.5 liters per unit run. The motor control system utilized On-Off control with modified power input to minimize vibration issues, operating the motor at 50-60 RPM. The temperature heater control sys-tem employed a PID control method, specifically the Ziegler-Nichols type 2 method, with Kp and Ki values of 247.5 and 1.104, respectively. The chosen PID parameters demonstrated satisfactory perfor-mance, including a rise time of 22.95 minutes, maximum overshoot of 2.85%, and a dead time of 510 seconds. The implemented system was controlled using an Arduino controller, ensuring a fast response and stable operation.


Introduction
In general, the Indonesian population has a preference for fried foods. This has led to an increasing consumption of palm oil for cooking purposes each year, parallel to the population growth. Based on data from the Indonesian Central Bureau of Statistics (BPS) in 2019, the per capita consumption of palm oil for cooking purposes reached 10.79 liters per year in 2018. It is predicted that the consumption of palm oil for cooking purposes in 2019 and 2020 will increase to approximately 11.09 and 11.38 liters per capita per year, respectively [1].
The household economy exhibits significant diversity, resulting in varying practices regarding the usage of cooking oil. While some households dispose of cooking oil after a single use, others employ it for multiple frying sessions. Typically, cooking oil can be safely used for up to 3 or 4 frying sessions. However, when cooking oil is repeatedly reused, its fatty acid content becomes more saturated, causing a color change known as "used cooking oil" or "minyak jelantah." This used cooking oil is highly unsuitable for consumption or further reuse in frying food. The continuous ingestion of used cooking oil and its subsequent accumulation in the human body can lead to long-term health issues. Negative consequences of consuming used cooking oil include abnormal fat deposits, an increased risk of cancer, and the loss of neural control functions [1,2].
Used cooking oil waste is a prevalent problem in the culinary sector, from large restaurants to street vendors and households. Cooking food typically involves frying, leading to the production of used cooking oil waste in every household [1].
Used cooking oil is a waste product generated from the consumption of cooking oil, both in household settings, restaurants, street vendors, and other needs. In the Badak LNG environment, there is used cooking oil waste generated by Badak LNG's partner, such as catering services. The amount of waste generated by the catering services of PT Badak NGL's partners is quite significant, ranging from twenty-five to fifty liters per week. This is consistent with the high demand for food orders almost every day. If not properly managed, the generated used cooking oil waste can pollute the environment when disposed of in sewers, ditches, soil, and other areas. It is essential to implement effective waste management to ensure environmental sustainability. There are various options for treating used cooking oil waste to avoid wasteful disposal, As previously conducted by researchers, there have been various approaches to address the issue like Processing of used cooking oil (jelantah) as a substitute for kerosene fuel (biofuel) [3], Conversion of used cooking oil waste into dishwashing soap for pollution mitigation and community empowerment [4], Utilization of leftover cooking oil waste and coffee grounds to produce scented soap for household use and as an alternative for small-scale household industries [5,6].
The partner of PT Badak LNG, through Salin Swara (Sampah Keliling Swadaya Masyarakat), has conducted experiments on small-scale production of aromatherapy candles utilizing used cooking oil waste. However, several challenges were encountered during the experiment, including limited production capacity, manual heating and stirring processes, and inconsistent product quality. To address these challenges, a dedicated unit is required to process the used cooking oil waste into aromatherapy candles, enabling Salin Swara to produce them more easily and effectively. Through this research, an automated machine is proposed to expedite the process by transforming manual tasks into automated ones, aiming to enhance efficiency and productivity. In the small-scale production conducted at the laboratory level, several challenges were encountered during the process of making aromatherapy candles. One of the challenges was the inadequate quality of the resulting aromatherapy candles due to an ineffective homogenization process. Additionally, the heating process for the mixture took a long time. Furthermore, the process of converting used cooking oil waste into aromatherapy candles was lengthy, highlighting the need for an automated system to facilitate the production process.
Therefore, this research focuses on addressing these challenges by designing an automated system for the processing unit of used cooking oil waste into aromatherapy candles. The aim is to enable the production of aromatherapy candles to be conducted more easily and effectively. The automation system is designed to allow users to perform the production process of aromatherapy candles with ease, safety, and efficiency. The automation system includes motor control for stirring, heating elements, valves, pumps, and their sequential operations. The expected outcome of this research is to efficiently and effectively process used cooking oil waste into high-quality aromatherapy candles.

Materials and Experiment Methods
The process flow of converting used cooking oil waste into aromatherapy candles like Figure 1 is as follows: a) The used cooking oil waste enters an adsorption and filtration column for the process of filtering and absorbing impurities present in the waste. This absorption process involves the use of specially treated bananas. b) The used cooking oil waste is pumped into a feed storage before being used as a raw material for the production of aromatherapy candles. c) A manual valve at the bottom of the feed storage is used for sampling and draining the used cooking oil waste. d) If the used cooking oil waste that has passed through the adsorption and filtration column does not meet the required quality standards, it undergoes another round of adsorption and filtration process until the desired results are achieved. e) The compliant feed oil is pumped into a mixer column. f) Stearic acid, in powder form, is introduced into the mixer column using a modified valve with the assistance of a servo. g) Liquid dye is introduced into the mixer column through gravity flow, with the solenoid valve opening and closing based on a predetermined time delay. h) Fragrance is introduced into the mixer column through gravity flow by opening the solenoid valve located below. The solenoid valve opens based on a predetermined time delay. i) The mixer and heater are activated according to the established operational specifications. j) The resulting aromatherapy candle product is collected in prepared containers. The control system of the aromatherapy candle production unit utilizes sequential control, which is regulated by an Arduino Mega. The steps of the control system align with the explanations provided in the Process and Flow Diagram (PFD). The Arduino Uno is specifically used for controlling the motor and heater. The Arduino Mega acts as the main controller, overseeing the sequential control of the entire process. It receives input signals from various sensors and switches, enabling it to monitor the status of the process and trigger the necessary actions. The Arduino Uno is dedicated to controlling the motor and heater. It receives commands from the Arduino Mega and executes the corresponding actions can see at Figure 2 and Figure 3 for protection line for machine. For example, it controls the motor's speed and direction for the mixer column, as well as the heater's temperature for the heating process. By integrating these Arduino boards into the control system, precise and automated control of the production process of aromatherapy candles can be achieved, ensuring consistent quality and efficient operation. The pump in the aromatherapy candle production unit is powered by a 12V motor voltage. The pump's primary function is to circulate the liquid fluid, which is the feed used cooking oil. Additionally, the pump is responsible for transferring the treated used cooking oil to the feed storage column.
The pump that transfers the used cooking oil to the feed storage column is controlled using a simple on-off mechanism, without the use of a relay. On the other hand, the pump that transfers the used cooking oil into the mixer column utilizes a relay, which remains active for a predetermined time delay.
The servo functions as a valve for the stearic acid. It operates as a driving mechanism to open and close the pipe for a specific period based on the obtained time delay. The servo changes its position from 0 degrees to 180 degrees when it is open. Once the time delay is reached, the servo returns to its previous position.
The Solenoid Valve operates in an on-off mode based on the predetermined sequential or alternate process flow. It is controlled using a relay for its operation.
The Heater functions as the heating element for the entire material. It is controlled using a PID (Proportional-Integral-Derivative) controller with the assistance of a Zero Cross AC Light Dimmer. A K-type thermocouple sensor [7] is employed to provide real-time temperature readings at intervals of 500 ms.
The Motor's output voltage is regulated using a Zero Cross AC Light Dimmer [8,9]. The voltage is adjusted to maintain a constant RPM (Revolutions Per Minute) as per the predetermined parameters. Tuning is the term used to describe the methods used to select the optimal control settings to achieve a specific performance outcome. In this research, two tuning methods are used for PID tuning, namely the Ziegler-Nichols type 2 method and the Cohen-Coon method. The Ziegler-Nichols type 2 method is a widely used tuning method that involves identifying the critical gain and critical period of the system. Based on these values, the proportional, integral, and derivative gains of the PID controller are calculated. The Cohen-Coon method is another tuning method that focuses on determining the ultimate gain and ultimate period of the system. These values are then used to calculate the PID gains. Both methods aim to find the optimal PID controller parameters that provide stable and satisfactory performance for the heating process in the research. The choice of which method to use depends on factors such as the system dynamics and the desired performance criteria [10]. The Ziegler-Nichols type 2 method disregards the integral and derivative actions of the PID controller and focuses only on the proportional gain, Kp. The value of Kp is gradually increased from a low value until the system exhibits sustained oscillations without any clear increase or decrease. The value of Kp that produces this response is then recorded as Kcr (critical gain). Once Kcr is determined, the Ziegler-Nichols type 2 method provides formulas to calculate the optimal PID values based on Kcr. These formulas involve adjusting the proportional, integral, and derivative terms using predetermined factors. The Ziegler-Nichols type 2 method is a commonly used technique for tuning PID controllers to find optimal control parameters.
Although this method is relatively simple, it can provide satisfactory results for stable systems with clear oscillations.  In Table 1, Kp, Ti, and Td represent the proportional gain, integral time, and derivative time values, respectively. The P mode uses only proportional control, the PI mode uses proportional and integral control, and the PID mode uses proportional, integral, and derivative control. By using Table 1, you can adjust the PID values according to the desired response of your system. Please note that the Ziegler-Nichols method is a general tuning method and may need further adjustments depending on the characteristics of your specific system.
The Cohen-Coon method is typically used for open-loop systems. The Cohen-Coon tuning rules are suitable for self-regulating processes when the control objective requires a fast response. It is recommended to divide the calculated controller gain by two. The Cohen-Coon method is particularly suitable for systems with a significant dead time. In the Cohen-Coon method, the process is conducted by applying a step input to the open-loop system until the response reaches a steady state. Once the response reaches a steady state, another step input is applied. The resulting signal of the change is used to design the PID values. By analyzing the response to the second step input, specific parameters can be determined to calculate the PID values. These parameters include the ultimate gain (Ku), ultimate period (Pu), and ultimate time (Tu). The ultimate gain is the maximum change in output divided by the change in input during the second step response.

Results And Discussion
The Mixer Column at Figure 5 serves as the location for the homogenization (mixing) of all the ingredients used in aromatherapy candle production, including 3 L of used cooking oil, 7 kg of stearic acid, 400 mL of fragrance, and 100 mL of colorant. The homogenization process takes approximately 45 minutes to 1 hour at a setpoint temperature of around 70 degrees Celsius. The Heater is used to heat the Mixer Column and is controlled by a PID controller to maintain the desired temperature effectively.
The Motor is utilized to drive the agitator, which facilitates the mixing of the used cooking oil, stearic acid, fragrance, and colorant. Based on laboratory-scale experiments, it was found that the ingredients do not mix evenly without agitation. However, excessive agitation can lead to the formation of foam. Therefore, a gentle agitation technique is required to ensure thorough mixing of all the ingredients without excessive foaming. In this research, a 350 Watt heater at Figure 6 and a 200 Watt motor are utilized. The heater is controlled using a PID controller with the assistance of a Zero Cross AC Light Dimmer PWM. The PID control ensures effective temperature regulation at the setpoint. The 200 Watt motor, when used as the agitator at a temperature of 70 degrees Celsius, is found to be too powerful. Therefore, voltage control is implemented for the motor, specifically set at 40 V. Through testing, it has been determined that at this voltage, the motor can rotate at a speed ranging from 50 to 60 RPM. This voltage control approach allows achieving the desired mixing intensity without excessive agitation.

Sequential Control System
Sequential Control System is a control system that performs a series of control operations in a predetermined sequence. Typically, sequential control executes commands that have two states sequentially, such as start/stop, up/down, close/open, on/off signals, and so on. The system follows a predefined order of operations to achieve the desired control objectives. Sequential control is commonly used in various applications where specific actions need to be carried out in a specific order or sequence.  Figure 7 describe the sequential control system used to regulate the sequence of the aromatherapy candle production process using waste cooking oil as the main ingredient in an automated system consists of several components.

The control system for the mixer motor
In the homogenization process of the ingredients for aromatherapy candle production in the mixer column, thorough mixing of the ingredients is necessary to ensure proper composition. The mixing is achieved using an agitator powered by an AC motor. The AC motor is controlled by an Arduino Uno R3 through a zero-cross AC dimmer. The motor is controlled using On-Off control with additional power manipulation modifications. Power manipulation is implemented to address the issue of vibration when the agitator receives full power from the AC motor. Therefore, tests were conducted to determine the appropriate power level for the AC motor like Figure 8 as the driver for the agitator. The AC electric motor at Figure 9 is an electromechanical device that converts electrical energy into mechanical energy. It consists of two main components: the stator (stationary part) and the rotor (rotating part). When electric current flows through the stator, magnetic field lines or flux lines are generated, resulting in the production of an electromagnetic force (EMF) that creates a rotating field, following Faraday's Law. The AC motor serves as the driving mechanism for the agitator in the mixer column, which has been designed by the mechanical team. However, the agitator has a limitation due to poor installation of the coupling/connection between the motor and the agitator. Visually, it can be observed that the alignment of the shaft connection is not optimal. As a result, when rotational power is applied from the selected AC motor, significant vibrations occur. These vibrations cause the upper support section to shake and result in the agitator colliding with the walls of the mixer column. To address this issue, power input control is implemented for the AC motor. After conducting tests, the agitator operates at an RPM of 50-60 to mitigate the vibrations and maintain stable operation. In the process of homogenizing the ingredients for making aromatherapy candles in the mixer column, a heating system is necessary to ensure proper mixing of all the materials. The stearic acid needs to be heated to melt and blend with the other ingredients. The heater is designed to operate above the melting point of stearic acid and below the boiling point of the used cooking oil. A set point temperature of 70 degrees Celsius has been determined for the heater control. The control system is designed to rapidly reach the target temperature of 70 degrees Celsius and maintain it effectively.
The temperature of the heater with Arduino uno and dimmer at Figure 10 is controlled using a PID (Proportional-Integral-Derivative) control scheme, specifically em-ploying the PI (Proportional-Integral) mode. This choice is made to ensure the system exhibits a fast response time to reach the set point temperature and minimizes steady-state error.

DC pump 12V
Testing of the DC 12 V pump component was conducted by supplying electrical current to the pump, allowing it to circulate used cooking oil. The circulated oil was collected in a designated container. The volume of the circulated used cooking oil was measured and compared with the pump's operating time can see at eq 1.

Thermocouple type K
Testing of the Type K thermocouple was conducted using a sampling method and comparing the measurement data with a reference thermometer. Data was collected within a temperature range of 30 to 100 degrees Celsius can see data at Table 2. Sampling was recorded for every 5-degree Celsius increment on the thermometer.

Agrigator motor and Zero Cross Detector
Testing of the motor and Zero Cross was conducted to understand the behavior of the motor and Zero Cross based on input from the Arduino. The Zero Cross controls the Z-C signal provided by the Arduino (0-1024) and represents it as a percentage from 0 to 100%. The table above represents direct measurements taken when the motor acted as the agitator drive and was supplied with different voltage variations. The motor started moving when a voltage of 33 V was applied can see data experimental at Table 3. At Figure 11 voltages above 95 V, the agitator motor will rotate at a speed of 180 RPM. At this RPM, the upper support of the mixer column will vibrate, and the motor becomes unstable, causing the agitator to collide with the walls of the mixer column. If the voltage supplied to the motor exceeds 95 V, it is certain that the agitator motor is outside the specifications of the mixer column. In this case, a voltage of approximately 40 V is chosen as the appropriate voltage that aligns with the mixer's specifications and the aromatherapy candle manufacturing process.

PID Tunning
Tuning refers to the methods used to select the optimal control settings to achieve a specific performance. There are two methods used in PID tuning in this paper, the Ziegler-Nichols type 2 method and the Cohen-Coon method.

Tunning Ziegler-Nichols type 2 method
In this case, the integral and derivative actions are disregarded. The system is only given the proportional gain (Kp) value. The Kp value is gradually increased from the lowest value until the system exhibits sustained oscillation without any noticeable increase or decrease. The Kp value that produces this response is then recorded and referred to as Kcr. The Pcr value is obtained from the time between two peaks in the system's response.
From Figure 12 , the value of Kcr is 550 and the value of Pcr is 269. Based on these values. In this paper, a PI controller was chosen because it requires a fast response and is able to maintain steady-state conditions. The system response tends to be smooth, and sustained oscillations were only observed at the Kcr value of 550. Therefore, the decision was made to only use the PI controller without incorporating the derivative control.
Determine Kp and Ki Value from equations 2 and 3. (2) 3.3.2 Ziegler-Nichols type 2 Response analsys Figure 13 represents the data obtained from the overall heating process of the materials used in aromatherapy candle production by the temperature heater control system. Based on the graph, the control system has a rise time of 1377.5 seconds or 22.95 minutes, a maximum overshoot at a temperature of 72 degrees Celsius or 2.85% of the set point, and a dead time of 510 seconds.

Tunning Cohen-Coon method
The Cohen-Coon method is typically used for open-loop systems. The Cohen-Coon tuning rules are suitable for self-regulating processes where the control objective requires a fast response, but it is recommended to divide the calculated controller gains by two. The Cohen-Coon method is suitable for systems with a significant dead time. This method is performed by applying a step input to the open-loop system until the response reaches a steady-state. After reaching the steady-state, another step input is applied to the system. The resulting signal of the change is then used to design the PID values.  Figure 14 represents the data obtained from the overall heating process of the materials used in aromatherapy candle production by the temperature heater control system with input step power 35%, Dead time (td) is 977 s.  Figure 16 represents the data obtained from the overall heating process of the ingredients in aromatherapy candle production by the temperature heater control system. Based on the graph, the control system has a rise time of 4835 seconds or 80.58 minutes, a maximum overshoot at a temperature of 70.5 degrees Celsius or 0.714% of the set point, and a dead time of 1746 seconds.

Conclusions
In conclusion, the application of an automatic system with sequential control was successfully implemented in the processing unit of converting waste cooking oil into aromatherapy candles with a production capacity of 10.5 liters per unit run. The motor control system for the agitator was implemented using an On-Off control with power input modification to mitigate vibration issues. The motor was controlled to operate at a speed of 50-60 RPM. The temperature heater control system was implemented using a PID control method.
For the PID tuning, the Ziegler-Nichols type 2 method was chosen, resulting in a Kp value of 247.5 and Ki value of 1.104. This tuning configuration provided satisfactory performance with a rise time of 22.95 minutes, maximum overshoot of 2.85%, and a dead time of 510 seconds. The chosen PID parameters ensured a fast response and maintained stable conditions.
Overall, the implemented automatic system with sequential control, motor control, and temperature heater control proved to be effective in the production process of aromatherapy candles from waste cooking oil. The selected PID tuning parameters based on the Ziegler-Nichols method demonstrated good performance characteristics, contributing to efficient and reliable operation.