Adaptive charging control using ANN-PID controllers on multiple DC loads with varying battery voltages

Received Jul 28, 2021 Revised Jan 24, 2022 Accepted Jan 31, 2022 Various rechargeable electronic devices currently have batteries with different capacities and voltages, while the available chargers are generally fixed for one device. This is considered less effective because different types of electronic devices will require different battery chargers. Therefore, the adaptive power charge is needed to recharge batteries with different voltages and capacities through a single port by adjusting the type of load connected. This system uses buck converter with duty cycle settings through microcontrollers to lower the input voltage to variable output voltage. When the load is connected, the limit switch will be depressed and the system will start the duty cycle tracking process. The voltage will be increased gradually until the current is read at a certain value to identify the load. After the current reads the duty cycle stops tracking, then the current and voltage characteristics are used as input variables for the artificial neural network (ANN) algorithm to determine the target setpoint voltage to be executed by the proportional, integral and derivative (PID) controller. The designed adaptive power charge can identify the connected load accurately. The average ANN output error is 1.46e-4% and the average PID controller error is 6.4e-2%. The system can reach a steady state at 0.01 s.


INTRODUCTION
In this modern era, the development of portable rechargeable electronic devices is increasingly diverse. Rechargeable electronic devices use batteries as a crucial part to store electrical energy in the form of chemical energy [1]. The battery has a storage capacity limit so it must be recharged immediately when the stored electrical energy runs out, so that electronic devices can continue to operate.
Recharging the battery is important to maintain the availability of electrical energy in electronic equipment so that it can still be used [2]. In general, one equipment has a special charger that has been adjusted to the charging voltage of the equipment. However, the problem that arises now is the increasing variety types of electronic equipment circulating so that the chargers needed are also increasingly diverse. Conventional chargers that exist today have been adjusted to the voltage and capacity for a particular battery so that it cannot be used for charging other types of batteries [3].
From these problems, an adaptive charging system is needed. A system that allows recharging various types of electronic devices with varying battery capacities and voltages. In general, conventional charging is used specifically for one type of load [2]. With conventional systems the load cannot be detected. For make an adaptive charging device that can be applied to varying loads, a special control is needed. When different loads are connected to the one port terminals there must be a special method. Therefore, this system uses the artificial neural network (ANN)-proportional, integral and derivative (PID) combination control method.
To design this system, there are several things that must be fulfilled, including: load detection, load identification, setpoint determination, and control stability of output voltage. Load detection is used to determine the presence or absence of a load connected to the system. Load identification is used to determine the type of load that is connected based on certain characteristics. The setpoint determination is used to determine the setpoint charging voltage according to the type of load connected. The output voltage stability control is used to to keep the converter output voltage constant at the setpoint value. This paper will describe an adaptive charging system with a buck converter. Buck converter output voltage is regulated via duty cycle setting through a microcontroller to reduce the input voltage to an output voltage that varies based on the type of load connected [4]. When the load is connected and the limit switch is pressed, the system will start the tracking duty cycle process till a current is read at a certain value. ANN has a computational model that can imitate the human brain and has information processing capabilities [5], [6]. For this reason, the voltage and current characteristics that have been read will be used as input parameters for the ANN algorithm to determine the setpoint voltage for charging process. After getting the setpoint value from the ANN, the output voltage of the buck converter will be kept constant by the PID controller [7]- [9]. In this research, the PID tuning method uses analytical calculations. This method can be optimized again using other methods, such as particle swarm optimization (PSO) [10], and metamodel [11], to get better results. The next plan will also be developed implementing hysteresis for this system, as has been implemented in several previous research for different plans [12], [13].
The multifunctional and efficient charging process is an advantage of this system compared to conventional systems. One device can be used for charging multiple DC loads through a single output port. In this research, DC load testing includes rechargeable devices that have different voltages and capacities, such as handphone, laptop, camera battery, DC drill battery, and RC car battery.

METHOD
The system consists of a converter with a special control that can charge various types of DC loads through a single output port. There are 5 types of DC loads that will be used where each load has a battery with a different voltage and capacity. The block diagram of the system is shown in Figure 1. The adaptive power charge system provides charging voltage levels according to load requirements. These types of loads are rechargeable such as handphone, laptop, camera battery, DC drill battery, and RC car battery. Where each of these loads has a different charging voltage and generally has a special charger.  Figure 1, it can be seen that the supply used comes from a 24-volt DC bus, which can be taken from renewable energy such as PV. The 24 volt DC voltage will pass through the buck converter with a duty cycle set by a microcontroller to adjust the charging voltage of the connected load. The charging voltage will automatically adjust the load requirements using a combination of ANN-PID control. ANN gets input from current sensor and voltage sensor to determine the setpoint voltage which is then executed by the PID control. Figure 2 shows the adaptive power charge flowchart system. The adaptive charging system concept designed has four stages, including load detection, tracking duty, load identification, and charging process. − Load detection The system will detect the presence or absence of a connected load. Load detection is based on an indication of a depressed limit switch. In the initial condition, when the load is not connected, the converter output voltage Vo = 0 V. If the limit switch is depressed, the system will start the tracking duty program to gradually increase the voltage. − Tracking duty The thing that must be underlined is that when the converter output voltage is below the load charging voltage range, the current will not flow Io = 0 A. Tracking duty is used to increase the voltage gradually from 0 volts until it reads an indication of current ≥ 0.2A. If the current is read ≥ 0.2A then the duty stops tracking. The current flowing indicates that the converter output voltage is in the load charging voltage range. Furthermore, the voltage and current that have been read will be used for load identification. −

Load identification
The load identification is based on the current and voltage characteristics read by the sensor. These two parameters will be used by ANN to determine the setpoint voltage. This setpoint value will then be executed by the PID control at the charging process stage. − Charging process. The charging process here uses a constant voltage method. After getting the setpoint voltage value from ANN, then the output voltage of converter will be kept constant at setpoint value by PID controller [14]− [16].

Buck converter modeling
Buck converter is one type of power converter that functions to convert the input DC voltage into a smaller DC output voltage [4]. In this system, buck converter is used to convert voltage from 24-volt DC bus to a lower voltage for charging DC loads. Switching control is the working concept of this circuit. The main components of the buck topology are switches, freewheel diodes, inductors, and capacitors. Buck converter topology is shown in Figure 3.
Metal-oxide semiconductor field effect transistor (MOSFET), transistor, or insulated-gate bipolar transistor (IGBT) is a type of switch that can be used in the circuit. The PWM signal determines the conditions for the switch to be closed and open. When the switch is connected, the inductor, capacitor, and load will be connected to a voltage source. This is called the ON state condition. In ON condition, the diode will be reverse biased. Meanwhile, when the switch is open, all components will be isolated from the voltage source. This is . Buck converter is also called a down converter by reason of the output voltage is always less than the input voltage. Figure. 3. Buck converter circuit The (1)-(3) is used to calculate the parameters of the buck converter. The buck converter designed refers to the load with the largest charging power, which is a laptop with a power of 65 watts. Buck converter functions to change the input voltage from the DC bus to a smaller output voltage to adjust the charging voltage on the load. Table 1 shows the design parameters of the buck converter.
Note:  Figure 4, it can be seen that there is an overshoot voltage and steady-state error. The setpoint value is represented by a dotted line and the output voltage is represented by a straight line. More detailed data is shown in Table 2

Design of ANN-PID controller
The control method applied in this adaptive power charge research is a combination of the ANN-PID controller. ANN is used to determine the value of the charging setpoint voltage which will be executed by the PID controller. Simulation of the learning process that exists in human brain is the concept of artificial neural network, therefore this method is known as human brain representation [5]. Artificial neural networks have ability to learn the characteristics of the given input. These characteristics will be stored and used to create a certain operation or rule so that it can be used to predict the possible output that appears [18]. From these characteristics, the ANN method will be very suitable to be applied in this system. Figure 5 shows a graph of ANN learning data which includes input (voltage and current) and target (setpoint voltage). The ANN algorithm used in this research is ANN with supervised learning, with the learning algorithm using FFBPNN (Feed Forward Backpropagation Neural Network). In Figure 6 there is a block diagram of ANN with 2 inputs (voltage and current), one hidden layer which has 10 neurons, and one output layer which has 1 neuron. The type of activation function is Logsig-Tansig. In this paper, the Levenberg-Marquardt learning algorithm is used to train the ANN back-propagation model. The backpropagation algorithm is algorithm that works by adjusting the weights based on the difference between output and desired target to decrease error rate [19]. The architecture backpropagation algorithm composed of three layers, there are input layer, hidden layer, and output layer. At the input layer, there is no computing process, but there is sending an X input signal to hidden layer. In the hidden layer and output layer, there is a computation process on the weights and biases. The amount of output from hidden and output layers is calculated based on certain activation functions. The activation functions used in this ANN architecture are: Logsig on the hidden layer and Tansig on the output layer.
The learning data is trained in nntool Matlab to get the best weights and biases for the neural network. The best weights and biases can be seen based on the regression graph. The following Figure 7 is a regression graph after learning. It can be seen that the regression graph reaches 1, which means that the weights and biases of ANN are appropriate and ANN can understand the learning data that have been taught. After getting the setpoint value from the ANN process, then PID controller will execute the ANN output for constant voltage charging process. PID controller is a combination of three control systems, including: proportional control (P), integral control (I), and derivative control (D) [20]- [22]. Diagram block of PID controller can be seen in Figure 8. : derivative gain In a closed loop system can be seen clearly the effect of each controller (proportional, integral, and derivative). Table 3 shows the effect of each controller. Table 3 shows that there are advantages and disadvantages to each Proportional (P), Integral (I), and Derivative (D) control. Therefore, the combination of the three controls known as the PID controller can complement each other so that it can become a better control. Overall, PID control functionate to [23]− [25]: i) accelerate the system response to reach setpoint, ii) remove offset, iii) makes a big starting change and decrease overshoot.

RESULTS AND DISCUSSION
The adaptive power charge simulation circuit in Figure 9 is made in MATLAB software. Consists of a Buck converter circuit with ANN-PID control. There are 5 types of DC loads used, including handphone that has a charging voltage of 5 V, camera battery 8.4 V, RC car battery 12.6 V, DC drill battery 15 V, and laptop 19 V.
From Figure 9, the output of the buck converter will be connected to one of five loads. For example, the connected load is a laptop. To control the output voltage of the buck converter, the ANN-PID control method is used. In the ANN block there are 2 inputs, namely current and voltage. When the ANN gets an input voltage of 16.27 V and a current of 2.2 A, the ANN produces an output of 19 V. This value will be used as a setpoint to be executed by the PID control. So that in this case the system will provide a charging voltage of 19 v for the laptop. Likewise for the other 4 types of loads, will be adjusted to the respective charging voltages. Figure 10 is the ANN output and error result in determining the target setpoint voltage that has been learned. In the output graph, it can be seen that the ANN output results have shown five-step setpoints, there are 5 V, 8.4 V, 12.6 V, 15 V, and 19 V. The error graph shows the error value between the ANN output and the target. The data learned amounted to 967 so that the graph also displays plot values of 967 data. As shown in Figure  9 that error value between ANN output and learning data target is relatively small, therefore the ANN output is accurate. Further details of the ANN outputs and errors are summarized in the Table 4. From Table 4, it can be seen that the error value between ANN output and target data that has been learned is very small. For a handphone with a 5 Volt setpoint, the error is 2.41e-5%. For a Camera battery with an 8.4 Volt setpoint, the error value is 3.39e-5%. For an RC car battery with a 12.6 Volt setpoint, the error value is 2.70e-4%. For a DC drill battery with a 15 Volt setpoint, the error value is 4.02e-4%. And for a Laptop with a 19 Volt setpoint, the error value is 5.17e-7%. So that the average error for the ANN output is 1.46e-4%. The error value is so small and the ANN that was designed successfully applied to this adaptive power charge system. After ANN generates the setpoint voltage, it will then be executed by PID controller. Figures 11 (a)-(e) shows the simulation results of 5 load variations, including handphone, camera battery, RC car battery, DC drill battery, and laptop.   The simulation results of the adaptive power charge system using the ANN-PID control method that has been designed have reached the target and following the expected results. With five different types of DC loads, the ANN-PID controller can provide a stable charging voltage according to the setpoint of each type of DC load. For more details, the data for the five types of DC loads can be seen in the Table 5. From Table 5 can be seen that the adaptive power charge system that has been designed can provide a charging voltage that is following the kind of load connected. When the kind of load connected is a Handphone with a 5-volt setpoint, the system provides a stable charging voltage at 4.993 volts, so the error value is 0.14%. When the kind of load connected is a Camera battery with an 8.4-volt setpoint, the system provides a stable charging voltage at 8.394 volts, so the error value is 0.06%. When the kind of load connected is an Rc car battery with a 12.6-volt set point, the system provides a stable charging voltage at 12.6 V, so the error value is 0%. When the kind of load connected is a DC drill battery with a 15-volt setpoint, the system provides a stable charging voltage at 15.01 V, so the error value is 0.067%. When the kind of load connected is a laptop with a 19-volt setpoint, the system provides a stable charging voltage at 19.01 V, so the error value is 0.053%. ANN-PID control takes an average of 0.01 s to reach a steady state. From the five types of loads, the average error value is 0.064%. This research is a development of previous research [3]. In the previous research, there were 2 types of loads used, including handphone and laptop. The load identification method uses a logic program with voltage as the input parameter. The development in this research is on the aspect of the amount of load. More varied into 5 types. In addition, the development is on the load identification method. The identification method uses ANN with current and voltage as input parameters to determine the charging setpoint to be executed by 629 the PID control. The disadvantage of previous research is the determination of the setpoint based on the voltage range of the connected load, so that the application of the system is still limited to 2 types of devices. With the development using this ANN method, load identification is more flexible because ANN is able read load characteristics through current and voltage parameters with more learning data so that it is possible to be applied to more devices with smaller voltage differences.

CONCLUSION
After a series of tests, it was proven that the development from previous research had been successfully carried out. The data obtained show that the ANN method can accurately identify and determine the setpoint voltage of the five types of loads based on current and voltage characteristics. The average error value between ANN output and the target is 1.46e-4%. Meanwhile, PID control can maintain the output voltage stability at the setpoint value for each type of load during the charging process. The average error value between steady-state and setpoint voltages is 6.4e-2%. Thus, the combination of ANN-PID controllers in this research can be proper for adaptive charging systems.