Keywords: SEPIC Converter, PID Controller, Microcontroller, PIC18F4550, DC-DC Power
Keywords: SEPIC Converter, PID Controller, Microcontroller, PIC18F4550, DC-DC Power
Keywords: SEPIC Converter, PID Controller, Microcontroller, PIC18F4550, DC-DC Power
1. Introduction1
Renewable energies (RE) are energy sources that are naturally renewed fast enough to be
considered inexhaustible on a human scale[1]. They derive from cyclical, constant, or
random natural phenomena induced by; the Sun for the heat and light that it generates, the
wind for the kinetic energy that it produces, or hydraulic energy due to ocean currents[2].
Today, power electronics converters play a vital role in harnessing the energy produced and
controlling systems in a wide range of applications, from the smallest, such as power
harvesting and integrated devices, to the largest, such as electrical machine control, power
generation and transmission[3]. DC-DC power converters are widely used in renewable
energy conversion systems, particularly photovoltaics[4]. They are used to adapt the input
voltage of a system to the desired output voltage. They are found in MPPT solar
regulators[5], photovoltaic inverters, and battery management systems (BMS)[6].
Power converters use electronic components based on semiconductor switches, usually
Bipolar, MOSFET or IGBT technology. These transistors operate at different power and
*
Corresponding author: Ahmed GAGA, E-mail: gaga.ahmad@gmail.com
1
Laboratory of Physics and Engineering Sciences, Research team in Embedded Systems Engineering, Automation,
Signal, Telecommunications and Smart Materials, Department of Physics, USMS University, BeniMellal 23030,
Morocco.
2
Information Processing & Decision Support Laboratory (TIAD),National School of Applied Sciences,Sultan
MoulaySlimane University,BeniMellal, Morocco
frequency levels, ranging from low mains frequencies to high frequencies. In order to
optimally take into account the different requirements of various applications, power
converters are classified according to several characteristics[7]. These include isolated or
un-isolated converters, powered by current or voltage, and switched either hard-switched or
soft-switched. In the literature, there are four different types of conversion between two
initial forms of energy (AC-DC, DC-AC, DC-DC and AC-AC)[8][9]. The switch from one
form to another depends strongly on the application. For example, domestic grid-connected
devices require an AC-DC converter in their energy processing systems, such as
televisions. In addition, the integration of renewable energy sources into the grid requires
the use of inverters or so-called DC/AC converters to produce a constant or variable
alternating voltage output[10][11]. Still, many battery-powered devices use DC-DC
converters to provide the DC voltage required by the various internal components. In
addition, as mentioned above, DC-DC converters are used to optimize the energy produced
by renewable energy sources such as photovoltaic panels and wind turbines[12]. In order to
change the voltage or frequency of an AC power source, AC/AC converters are required
(e.g. a dimmer switch and a mains frequency changer). Power converters are non-linear
systems with a variable and complex structure[13]. Therefore, their performance does not
only depend on the design of the hardware part, but it is highly dependent on the adopted
control law. For this reason, it is important to understand some basic principles related to
power converter control. In the literature, the Average State Space model is used to model
and analyze the behavior of DC-DC converters in order to design appropriate
controllers[14]. There are three classes of control depending on the choice of the control
input.
• PWM-BasedLinear Control
• Control WithoutModulator
• Control With Embedded Modulator
The Pulse With Modulation (PWM) based linear control class presents the most widely
used control structure for controlling linear systems, including power converters. In this
case, the controller must track the average value of the converter output, which can be
either a value of current, voltage, torque, power, etc. Therefore, it generates an average
control input ( ). This control signal can not be directly operated by the converter. It is
synthesized by a modulation stage. Therefore, the controller generates a duty cycle to
control the average output value. To design this class of controller, the average model is
normally adopted while neglecting the modulator effect[15]. The advantage of using a
modulator is that it sets the switching frequency of the converter and produces a well-
defined spectrum. Therefore, several control objectives can be met by including the
modulator in the control loop. The PWM control technique uses linear controllers such as
proportional integral (PI), or proportional integral derivative (PID) or non-linear controllers
such as sliding mode, fuzzy logic,etc[16].
In this work, we will present the modeling and dimensioning of a non-isolated DC/DC
converter of the SEPIC type in continuous conduction mode (CCM). The converter
operates in an environment exposed to different disturbances sources such as variable input
voltage or load. This causes a variation in the DC-DC converter operating point. The state-
space representation or transfer function is established in the MATLAB/Simulink
environment. In addition, Bode and pole diagrams have been drawn for the transfer
function of the converter. To regulate the output voltage, a PID regulator will be adopted.
Then, a physical simulation will be performed under Proteus ISIS to verify the correct
operation of our design using real components. The PID controller will be fully
implemented in an 8-bit microcontroller PIC18F4550. It performs two main tasks. The first
289
A. GAGA et al: low cost PID controller implementation of SEPIC Converter using 8-bits
Microcontroller Target for Photovoltaic Applications
one is to execute the algorithm of the digital PID regulator to generate the control law ( ).
The second one is to transform this control variable into a real PWM output that can be
understood by the SEPIC converter using the internal Compare, Capture, PWM (CCP)
module of the microcontroller.
The SEPIC (Single Ended Primary Inductor Converter) is a DC-DC converter type that
provides a DC output voltage greater than, less than or equal to the input voltage [17]. The
output voltage of this converter type is controlled by a PWM signal with a variable duty
cycle. The control signal directly drives the power switch used in this converter, which is
usually a MOSFET. The hardware structure of the SEPIC converter is shown in Fig. 1. It is
similar to the BUCK-BOOST converter, but has the advantage of having a non-inverted
output.
There are two operating modes of the SEPIC converter, depending directly on the shape
of the current IL1 flowing through the input inductor L1. The mode is called continuous
conduction mode if the current flowing through inductance L1 never turns off (CCM). In
some cases, the amount of energy required by the load is small enough to be transferred in a
time shorter than a switching period. In this case, the current flowing through the
inductance becomes zero for part of the period, the so-called discontinuous conduction
mode (DCM). The SEPIC converter operation study is carried out in two operating phases
depending on the conduction state of switch 1.
1.2 Convertersizing
Fig. 2 shows the active state of switch S1 (saturated transistor). An input voltage VIN is
applied to the input inductor L1 terminal. The current flowing through this inductor will
increase linearly, thus storing energy in L1. At the same time, the energy in capacitor C1
passes through inductance L2 and the energy in capacitor C2 passes through charge RL.
The output voltage VO is held constant by capacitor C2.
290
J. Electrical Systems 18-2 (2022): 288-303
Fig. 3 shows the second operating state of the SEPIC converter, when switch S1 is open
(transistor blocked). This state implies that diode D1 is forward biased. Therefore, it is
conducted. It allows the current ID1 to flow. Then, the energy stored in the inductor L1 is
returned to the capacitor C1 and the stored energy in the inductor L2 is transferred to C2.
A PWM signal with a variable duty cycle is used in order to be able to vary the output
voltage according to the applied set point in order to have a constant output voltage. The
inductance values are mainly determined by the accepted ripple current ∆L. In general, a
40% ripple is allowed[14]. The ripple current flows through inductances of values equal to
L1 and L2. C1 is a coupling capacitor inserted at the input to pass the effective current. The
capacitor C2 at the output of the SEPIC converter is used to filter the output voltage and
keep it constant. The S1 Transistor must be able to support the sum of the two input and
output voltages, and to be crossed by a peak current equal to the sum of the peak currents of
each inductor. The diode D1 has the same parameters as the transistor S1. It must support a
maximal output current. In addition, it must support a reverse voltage equal to the voltage
supported by the transistor S1. The TABLE I summarizes all the mathematical expressions
governing the parameters that are included in the sizing phase.
Based on the analytical expressions given by the equations in TABLE I. The sizing
results of the different components of our SEPIC converter are obtained. TABLE II shows
the parameter symbol, the analytical value after calculation of the associated expression and
the practical value to be used in the real system.
291
A. GAGA et al: low cost PID controller implementation of SEPIC Converter using 8-bits
Microcontroller Target for Photovoltaic Applications
The SEPIC converter is controlled in voltage mode. The PWM modulator is configured
with an independent time base. The output voltage is measured by a voltage sensor and sent
to the microcontroller. This value is subtracted from the voltage reference in the software
part to calculate numerically the voltage error.
This error is then introduced into a control algorithm that produces a duty cycle value
based on the current error, the previous error, and the control history respectively. The
control algorithm output is also latched to the minimum and maximum duty cycle values
for hardware protection. The control algorithm in voltage mode must be executed at a fast
rate in order to achieve fast system dynamics. Among the linear control techniques is PID,
also called PID corrector (proportional, integral, derivative). It is a control system for
improving the performance of a closed-loop control of a given system[18]. It is the most
widely used controller in the industry where its correction qualities apply to multiple
physical quantities. A PID controller is a calculation algorithm that delivers a control signal
based on the difference between the set point and the measurement. It acts in three ways: a
proportional action where the error is multiplied by a gain G, followed by an integral action
where the error is integrated and divided by a gain Tiand finally, a derivative action where
the error is derived and multiplied by a gain Td.
In order to combine these three effects (P, I, and D), we distinguish several possible
configurations, which are; serial, parallel, or mixed. In this work, we adopt a parallel PID
structure that acts on the error. The equation used to describe the parallel PID controller is
292
ical Systems 18-2 (2022): 288-303
J. Electrical
translated into the feedback loop Eq (1). This form is thet simplest, sometimes called the
parallel equation, because each action (P, I, and D) occurs in separate terms of the equation,
the combined effect being a simple sum. The control signal at the output of the PID
controller is given by:
;5 6
45 6 = 78 e5t66 7< = ;5 6 7> (1)
Where ( ) is the output measurement, ?@ A is the reference variable which is often referred
to as the set point, and ( ) is the control signal generated at the controller output. The
control signal is therefore the sum of the following three terms; a proportional term to the
error (P), a term proportional to the integral of the error (I) and a term (D) which is
proportional to the derivative of the error. The controller parameters are the proportional
gain Tp, the time integral Ti, and the derivative time Td.
1.5 Controller design
In this part, we will show how to design a PID controller for the DC/DC converter SEPIC
type presented and dimensioned previously. This power electronics system (SEPIC) will be
modeled and simulated in the Simulink environment using SimScape Electrical multi- multi
physics components. Many power electronics systems cannot be linearized because they are
variable-structured
structured systems and use high-frequency
high switching components (transistors in
this case), such as the present SEPIC DC/DC converter that incorporates a pulse-width
pulse
modulator (PWM). However, most PID tuning tools and techniques design PID PI gains based
on a linearized model. To obtain such a model for a system that cannot be linearized, we are
faced with two possibilities; either to estimate the parameters of the linear system model
using the System Identification Toolbox software, or to estimate
es the frequency response of
the system over a range of frequencies. The complete model including the SEPIC converter
plus the PID control chain is given in Figure 5
In this model, a MOSFET controlled by a pulse width modulated (PWM) signal is used to
switch the transistor. The output voltage Vout must follow the reference value Vref. A digital
PID controller takes the voltage error (Vout - Vref) at the input and adjusts the PWM duty
293
A. GAGA et al: low cost PID controller implementation of SEPIC Converter using 8-bits
Microcontroller Target for Photovoltaic Applications
cycle at the output according to this error. To design the PID controller, we first need to
determine the steady state operating point at which we want the converter to operate. In this
work, we will use an operating point estimated from a simulation snapshot. The principle is
to specify the initial conditions of the model near an expected steady state point, and
simulate the model until it reaches a steady state. One can then create a linear operating
model based on the signals and equilibrium states. Afterwards, the model is initialized with
the inputs and states of the selected operating point. Before setting the parameters of the
PID control block, the structure of the controller must first be specified. Including the type,
shape, time domain, initial conditions, output saturation level, and anti-windup
configuration. In this work, we will use the current configuration of the controller, i.e. a
PID controller in parallel form with a discrete time domain without anti-windup. Once the
operating point of the SEPIC converter has been determined, the next step is to identify the
system parameters. For identification, a finite value for the Simulink model's stopping time
must be specified. Then the input data of the I/O will be used as the input of the Simulink
identification system. The simulation of the system as seen by the controller has started.
The software temporarily removes the PID Controller block from the model, then injects a
signal at the location of the PID block output and measures the resulting signal at the
location of the PID block input. This data describes the system response as seen by the
controller. Based on this response, a linear model of the SEPIC converter is estimated. The
excitation signal is a step whose properties are given in Figure 6
SIMULINK's PID Tuner utility identifies the equivalent model using the data generated
by the open-loop model simulation. The model parameters are set so that the identified
system response, when receiving the measured input, matches the measured output.
294
J. Electrical Systems 18-2 (2022): 288-303
After system identification, we found that the Prediction error estimate for linear and
nonlinear model usingprediction estimation method (PEM) was able to generate a model
that made the real system within 97.61% as shown in Fig. 7. The approximation model
adopted is a first-order system whose transfer function is given by equation (3).
7E
CD (3)
1 G. H
After identifying the transfer function of the SEPIC converter to a selected operating point
in steady state, this function will be used to determine the parameters of the controller. An
identification algorithm will be executed based on the selected input performance to
produce the optimal combination of the three controller actions. The result of the controller
parameters as well as the performance and robustness indications are shown in F Figure 8:
PID controller parameters and response performance
Microcontroller implementation
295
A. GAGA et al: low cost PID controller implementation of SEPIC Converter using 8-bits
Microcontroller Target for Photovoltaic Applications
is the hardware multiplier. The latter is widely used for faster control algorithms
calculation, which is an asset for our application due to the large number of operations that
can be contained in the intended applications. Matrix calculation in the PID algorithm, for
example. The PIC18F4550 therefore has higher computing power and allows a code size
reduction for multiplication algorithms. In addition, it can handle many applications that
were previously reserved for digital signal processors (DSP). A comparison of various
hardware and software multiplication operations, as well as the savings in memory and
execution time, is shown in TABLE III.
In addition, there are variants in the PIC18F family with specialized control peripherals,
including a PWM hardware module capable of generating pulse-width modulated signals,
which is widely used in many applications. In our study, the PIC18F4550 was used to
generate PWM signals. It is capable of generating a very high PWM frequency. It has two
RC1 and RC2 channels to produce PWM. The CCP module has several operating modes,
but in this work, it will be used in the PWM one. To force this mode, the first three bits of
the ECCPxCON control register must be set and the proper configuration must be done.
The PWM of a specific frequency is created by setting the proper clock value to force the
desired PWM period. The required clock value is determined by the following equation (4).
296
J. Electrical Systems 18-2 (2022): 288-303
After designing, sizing, and simulating our SEPIC converter, and the control structure
under the MATLAB/Simulink environment, we proceed directly to the practical part of this
work, which is divided into two elementary phases. The first one is the choice of the
components to realize the SEPIC system, and for that, we have to respect several
constraints imposed by the component availability in the market. As a power switch, a
power transistor of the IRF230 MOSFET type will be used. In contrast to the transistor
control in the MATLAB/Simulink simulations, this element cannot be driven directly by a
logic circuit, so an electrical level adaptation stage called a driver must be used. It must be
inserted between the transistor and the control unit. As a driver, we have chosen the IR2112
component. To recover the output voltage, we use a voltage sensor in the form of a voltage
divider dimensioned to be able to measure the maximum voltage that the SEPIC converter
can produce. An alphanumeric LCD display is also used in the assembly to display system
related information such as the set point and the actual output voltage.
As far as the control part is concerned, as mentioned above, the PID control algorithm
will be implemented in the PIC18F4550 microcontroller. In addition to developing the
control law, this processing unit transforms the control signal U( ) into a real PWM
control signal that will directly drive the transistor. In addition, the microcontroller
manages at the same time the display of the information on the LCD display. Three
potentiometers, RV1, RV2 and RV3, are connected to the analog port of the MCU,
which reads and analyzes in real time the analog values on the port and transforms them
into a suitable range to adjust the gains rates of the PID regulator. The complete
electronic circuit is given in Figure 10.
297
A. GAGA et al: low cost PID controller implementation of SEPIC Converter using 8-bits
Microcontroller Target for Photovoltaic Applications
Figure 11: SEPIC multi output voltage controlled by PID (VIN = 12 volts)
After verifying the correct behavior of the SEPIC converter in terms of reference
tracking, the second test consists of checking the system robustness following a load
variation for the same reference. Erreur ! Source du renvoi introuvable.12shows the
system response for several load values, respectively 20, 50, 100, and 10 Ohms. It can be
298
J. Electrical Systems 18-2 (2022): 288-303
noticed that the transient behavior becomes worse as the load increases, and the system
behaves like a second order and presents oscillations, but the proposed controller is able to
drive the response towards the desired value while still guaranteeing the selected
performance. The response time does not exceed 20 Milliseconds for a 100 Ohms load.
Stability is always guaranteed and accuracy is acceptable.
Figure 12: SEPIC Output voltage under Load variation (VIN = 12 volts)
The test scenario that follows is a mixture between a reference change and a load
variation in the same simulation cycle. The process is as follows: at the beginning, a set
point of 18 volts and a constant load are chosen, then at the 50 millisecond instant, the set
point is abruptly changed from 18 to 5 volts, and at the instant of 75 milliseconds, the load
is changed and the reference is kept at 5 volts. The response of the designed system to this
test is given in Fig. 13. It can be noticed that the system always keeps its performance and
resists to the reference change and load perturbation.
The final verification test is performed to check the system's performance against one or
more disturbances from the source, which is no longer constant in this case. For this
purpose, we will set the set point at 18 volts, and at the input, we will choose a multi-level
voltage source. The expected result of this test is to have an output equal to the value of the
selected set point and the system rejects more quickly the disturbances produced due to the
input voltage change of the converter system. The predictable behavior of this test is
confirmed by the result shown in Fig. 14. In this test, we have considered three levels of
input voltage, respectively, 12, 9 and 15 volts; the load value is fixed at 10 Ohms. The
system shows again that it is able to reject any source of disturbance and guarantee an
optimal response. The selected set point is 18 volts.
299
A. GAGA et al: low cost PID controller implementation of SEPIC Converter using 8-bits
Microcontroller Target for Photovoltaic Applications
The control law produced by the controller that gives the results is given in Fig. 14
(orange signal). We can clearly notice the ability of the controller to reject each time the
disturbances that appears in the system. Now, after having validated the correct operation of
our design to regulate the SEPIC converter output voltage, we move on to practical PID
algorithm validation in hardware. The PID regulator is fully implemented on the
PIC18F4550 microcontroller. The results given by Fig. 15 and Fig. 16 show clearly the
correct operation of our system on the hardware target. The two output voltage responses
are tested respectively at 24 volts and 15 volts. The microcontroller is therefore running the
PID algorithm in such a way to achieve the same performance confirmed by
MATLAB/Simulink simulation.
300
ical Systems 18-2 (2022): 288-303
J. Electrical
Figure 17shows
shows the hardware information of our microcontroller implementation, including
the used reference, the XC8 compiler, the memory space consumed on the flash program
memory as well as the reserved space on the RAM,
RAM and the debugging andprogramming
tool PICkit3
301
A. GAGA et al: low cost PID controller implementation of SEPIC Converter using 8-bits
Microcontroller Target for Photovoltaic Applications
Conclusion
In this work, we have developed a DC/DC conversion system including a PID controller.
The objective is to optimize and implement a digital controller version to regulate the
output voltage. The embedded target selected for this work is the low-cost 8-bit
microcontroller. We started by sizing and simulating the open-loop system, then we
linearized the model at an operating point to derive the equivalent transfer function of the
system, then we inserted the regulator whose parameters were identified based on the
estimated linear model of the converter. The set of simulations performed under
MATLAB/Simulink show the good performance of our solution. The performed
simulations and test scenarios clearly demonstrate the system dynamics, which became fast,
as well as the stability and accuracy of the response. After all simulations, a migration to
hardware was done by implementing the PID controller on a PIC18F4550 microcontroller.
The implementation results proved that the entire SEPIC/PID system worked well
experimentally based on real models of the electronic components in the PROTEUS
environment. This solution may be used in a wide range of applications, such as MPPT
solar regulators and battery management systems (BMS). In terms of economics, this
system has a good performance to price ratio since we were able to implement advanced
functionalities in a low-cost 8-bit microcontroller. Consequently, as a perspective of this
paper, we aim to apply all the proposed solutions in this work to develop a BMS battery
management system for photovoltaic applications.
References
[1] P. Swain, S. Jagadish, and K. N. S. U. Mahesh, “Integration of renewable sources of energy into power
grid,” TENSYMP 2017 - IEEE Int. Symp. Technol. Smart Cities, Oct. 2017, doi:
10.1109/TENCONSPRING.2017.8070012.
[2] B. S. Pali and S. Vadhera, “Renewable energy systems for generating electric power: A review,” 1st IEEE
Int. Conf. Power Electron. Intell. Control Energy Syst. ICPEICES 2016, Feb. 2017, doi:
10.1109/ICPEICES.2016.7853703.
[3] R. W. De Doncker, C. Meyer, R. U. Lenke, and F. Mura, “Power electronics for future utility applications,”
Proc. Int. Conf. Power Electron. Drive Syst., 2007, doi: 10.1109/PEDS.2007.4487666.
[4] Z. Sabiri, N. Machkour, E. Kheddioui, M. B. Camara, and B. Dakyo, “DC/DC converters for photovoltaic
applications-modeling and simulations,” Proc. 2014 Int. Renew. Sustain. Energy Conf. IRSEC 2014, pp.
209–213, Mar. 2014, doi: 10.1109/IRSEC.2014.7059812.
[5] A. Gaga, O. Diouri, N. Es-Sbai, and F. Errahimi, “Design and realization of an autonomous solar system,”
IOP Conf. Ser. Mater. Sci. Eng., vol. 186, no. 1, Mar. 2017, doi: 10.1088/1757-899X/186/1/012031.
[6] M. M. U. Rehman, F. Zhang, R. Zane, and D. Maksimovic, “Design and control of an integrated BMS/DC-
DC system for electric vehicles,” 2016 IEEE 17th Work. Control Model. Power Electron. COMPEL 2016,
Aug. 2016, doi: 10.1109/COMPEL.2016.7556729.
[7] A. Bubovich, “The comparison of different types of DC-DC converters in terms of low-voltage
implementation,” Proc. 5th IEEE Work. Adv. Information, Electron. Electr. Eng. AIEEE 2017, vol. 2018-
January, pp. 1–4, Jul. 2017, doi: 10.1109/AIEEE.2017.8270560.
[8] O. Diouri, N. Es-Sbai, F. Errahimi, A. Gaga, and C. Alaoui, “Control of single phase inverter using back-
stepping in stand-alone mode,” 2019 Int. Conf. Wirel. Technol. Embed. Intell. Syst. WITS 2019, Apr. 2019,
doi: 10.1109/WITS.2019.8723761.
[9] A. C. C. Hua and B. C. H. Cheng, “Design and implementation of power converters for wind energy
conversion system,” 2010 Int. Power Electron. Conf. - ECCE Asia -, IPEC 2010, pp. 323–328, 2010, doi:
10.1109/IPEC.2010.5542251.
[10] O. Diouri, A. Gaga, N. Es-Sbai, and F. Errahimi, “Design and simulation of a novel cascaded transformer
multilevel inverter topology for photovoltaic system,” Proc. 2015 IEEE Int. Renew. Sustain. Energy Conf.
IRSEC 2015, Apr. 2016, doi: 10.1109/IRSEC.2015.7454957.
[11] F. A. Samman and A. Azhari, “DC/AC power converter for home scale electricity systems powered by
renewable energy,” 2016 Int. Conf. Smart Green Technol. Electr. Inf. Syst. Adv. Smart Green Technol. to
Build Smart Soc. ICSGTEIS 2016 - Proc., pp. 149–154, Mar. 2017, doi: 10.1109/ICSGTEIS.2016.7885782.
[12] P. P. Surya, D. Irawan, and M. Zuhri, “Review and comparison of DC-DC converters for maximum power
point tracking system in standalone photovoltaic (PV) module,” Proceeding - ICAMIMIA 2017 Int. Conf.
Adv. Mechatronics, Intell. Manuf. Ind. Autom., pp. 242–247, Jun. 2018, doi:
10.1109/ICAMIMIA.2017.8387595.
302
J. Electrical Systems 18-2 (2022): 288-303
303