Microcontroller Controlled Inverter Application
E05( DEDESIN
Department of Electrical and Electronics Engineering
Suleyman Demirel University
Faculty of Engineering
TURKEY
M(68' KAHRIMAN
Department of Electrical and Electronics Engineering
Suleyman Demirel University
Faculty of Engineering
TURKEY
O=/(0 COSKUN
Department of Electrical and Electronics Engineering
Suleyman Demirel University
Faculty of Engineering
TURKEY
1 Introduction
An inverter is an electrical power converter that converts
direct current (DC) to alternating current (AC). AC power
generated at the inverter output; It can be at any voltage
and frequency depending on the transformers used, the
switching and control circuits. In other words, they
convert 12, 24 or 48 V DC battery voltage to 230 V AC
50 Hz voltage. They work in minimum and maximum
ranges.
If it is necessary to summarize the application areas; such
as mobile vehicles, renewable energy applications such as
wind and solar energy, remote areas where grid electricity
is not available, communication applications including
GSM, battery backup energy applications against power
cuts.
Abstract: - The limited use of fossil fuels has increased the interest in renewable energy sources. Renewable energy
sources are generally direct current (DC) production. The popularity of inverters converting from DC to AC is increasing
due to the generation of the generated DC signal and the current grid being alternating current (AC). In this study, a
computer-controlled inverter was designed with the 16F877 microcontroller chosen as the model, and frequency and
amplitude controls were realized with the serial communication system of this structure. A digital-analog converter
(DAC) circuit is formed by connecting the R-2R ladder type resistor to the relevant ports of the microprocessor. With
the codes written to the microprocessor, the signal response was taken from the DAC circuit, and the signal response at
the ports was combined with the inverter and collector operational amplifier (op-amp) circuits, and the inverter design
was completed.
Key-Words: Inverter, PC control, Serial communication, Microcontroller
Received: July 18, 2021. Revised: January 22, 2022. Accepted: February 19, 2022. Published: March 26, 2022.
WSEAS TRANSACTIONS on COMPUTERS
DOI: 10.37394/23205.2022.21.15
Emre Dedesin, Mesud Kahriman, Ozlem Coskun
E-ISSN: 2224-2872
103
Volume 21, 2022
PC-controlled applications have become widespread due
to their different advantages. Speed control of
asynchronous motors, which occupy a lot of space in the
application area, can be done by frequency change. In this
respect, the speed control of asynchronous motors can be
easily achieved in the system created. Since the system is
PC-controlled, it allows control over the internet and thus
from remote points.
2 Literature Reviews
Mallalieu, Arieatas, So'Brien have developed a low-cost
PC-controlled measurement laboratory. It has the
possibility to control and command 8 different channels in
its works [1]. Tolbert and Habetler proposed a multistage
carrier-based inverter. The inverter they propose is
implemented with a 6-stage diode to operate at 10 kW
power [2]. Levi, Vukosavic, Martin Jones A single-phase
multi-motor system has been realized. A voltage source
inverter with a controlled drive system has been realized
by utilizing a single source. They used multiple driver
circuits for variable speed controls [3]. Noguchi,
Yamamoto and Kondo; Torque controlled application was
carried out with inverter. By reducing the fluctuations in
the stator flux, they reduced the fluctuations in torque by
30%. In their system, they applied a PWM signal to the
stator using a switching element [4].
Yen-Shin Lai suggested NSVM technique instead of
classical SVM for motor control with PWM. They
observed that the common mode voltage decreased by
50% with the proposed method. They used PC with
INTELQ80586 CPU processor to drive IGBTs to their
systems [5]. Ye, Jain, C.Sen, for alternating current high
frequency and high voltage low current applications; They
proposed a current sharing loop and a voltage feedback
control loop. By using the proposed system, 500 kHz, 100
W inverter modules were connected in parallel and an
inverter with 500 kHz 28 V effective value was realized
[6]. Lai and Chen; They proposed direct torque control for
induction motor drives. The method they recommend;
They have shown that it can be used even in the 1
cycle/minute region [7]. Peng proposed an inverter
topology that compensates for the voltage itself. In the
proposed structure, MOSFETs are switched, allowing the
application of inverters and converters at different levels
[8].
In this study, the input signal to the microprocessor is
realized with the relevant codes written in the Micro-Code
Studio program. A digital-analog converter (DAC) circuit
is formed by connecting the R-2R ladder type resistor at
the microprocessor output to the PORTB and PORTC
outputs of the microprocessor. The signal at the PORTB
output is given to the inverting op-amp circuit, and the
input signal is output with a 180° phase difference and
given to the collector op-amp circuit with the input signal
coming from PORTC. Thus, the two input signals have
formed the positive (+) and negative (-) alternans of the
sinusoidal signal at the collector op-amp circuit output. A
10 μF C filter is used to get rid of the output harmonics.
In order to provide remote control of this design in a PC
environment, a serial communication system has been
implemented by using RS232 circuit and NI Labview
program. This serial communication system provides a
sensitive control opportunity by controlling the frequency
and amplitude of the signal at the inverter output. While
the output signal has no frequency limitation, its
amplitude value is limited to 24 Volts (-12 / +12), which
is the supply voltage of the collector op-amp circuit.
3 Material and Method
3.1. Digital-to-Analog Converters (DAC)
Circuits that convert a digital information signal into
voltage or current proportional to its digital value are
called digital-analog converters. This voltage or current is
an analog signal that changes according to the values at
the input. Figure 1 shows the block diagram of a 4-bit
input DAC.
Figure 1. Block diagram of the DAC system
In D/A conversion processes, weight resistance DAC, R-
2R ladder type DAC or PWM (Pulse Width Modulation)
method is used.
3.2. Weight Resistive DAC Circuit
Figure 2 shows a simple circuit of the D/A converter. It is
used as an op-amp collector in the circuit. The output
voltage is equal to the sum of the weights of the D, C, B,
a digital inputs.
Output voltage,
WSEAS TRANSACTIONS on COMPUTERS
DOI: 10.37394/23205.2022.21.15
Emre Dedesin, Mesud Kahriman, Ozlem Coskun
E-ISSN: 2224-2872
104
Volume 21, 2022
Figure 2. Weight resistive DAC circuit
3.3. R-2R Ladder Type DAC Circuit
It is the most used method for converting digital
information to analog information. The R-2R ladder type
circuit is shown in Figure 3. The output voltage is
calculated as given in equation 2:
In this design, a DAC circuit is formed by connecting one
string of R-2R ladder type resistor microprocessor to
PORTB and the other string to PORTC. The expected
signal response is obtained thanks to the inverter and
collector op-amps used in the DAC circuit by writing the
relevant codes to the microprocessor with the Micro Code
Studio program.
Figure 3. R-2R DAC circuit
3.4. Supply Layer
It is the floor used to provide the necessary energy of the
inverter circuit. The supply stage has been designed to
provide the +5 Volt (V) supply voltages required for the
circuit to work. A 7805 voltage regulator is used to
provide the +5 V voltage needed by the microcontroller.
Thanks to the capacitors added to the circuit, it is tried to
prevent unwanted interference. As a result, it is possible
to operate the inverter circuit by using any external power
source providing +9 V - +30 V DC voltages. The circuit
diagram is shown in Figure 4.
Figure 4. 7805 supply stage circuit diagram
The +12 V / -12 V DC supply required for the operation
of the collector and inverting op-amp circuits was used,
respectively, with 7812 and 7912 regulators. Since the
microcontroller needs +5 V DC voltage, three regulator
circuits can work with the same DC supply source. The
diagram of 7812 and 7912 regulator circuits is shown in
Figure 5.
Figure 5. 7812 and 7912 supply stage circuit diagram
WSEAS TRANSACTIONS on COMPUTERS
DOI: 10.37394/23205.2022.21.15
Emre Dedesin, Mesud Kahriman, Ozlem Coskun
E-ISSN: 2224-2872
105
Volume 21, 2022
3.5. Microprocessor Layer
The microprocessor stage is designed to fulfill the
function of the R-2R ladder type DAC circuit. 16F877, a
powerful product of the PIC family, is used as a
microprocessor. PIC (Peripheral Interface Controller) is
the name given to the microcontrollers produced by
Microchip. In PIC products, the command word size and
the bus length can be different. Produced PIC
microcontrollers are divided into different family names
according to the data bus bit number and word size of the
controller.
The reason for using the 16F877 microprocessor in this
design is that there are 33 I/O ports. In this direction, the
first block of the R-2R ladder type resistor scheme is
connected to 8 bits of PORTB, and the next second block
is connected to 8 bits of PORTC.
The information signal from PORTB constitutes the
negative alternan of the output signal, and the information
signal from PORTC constitutes the positive alternan of
the output signal. In order for the waveform formed in
PORT B to turn into negative, the PORTB output is input
into the inverting op-amp circuit. When the PORTC
output collector op-amp circuit is given with the obtained
waveform, the desired sinus signal is obtained.
3.6. MAX-232 Communication Layer
The voltage levels in the serial port, which is one of the
communication units opening from the computer to the
outside world, vary between +15 V -15 V. These levels
are incompatible with circuits that communicate at TTL
level (0 V5 V), the serial port of the computer can be
communicated with circuits at TTL (transistor to
transistor logic) level through the integrated circuit called
MAX-232 serial port buffer.
The MAX-232 communication layer communicates with
the NI Labview program in serial communication
standard. PIC 16F877 microcontroller uses TX-
transmitter, RX-receiver pins of MAX-232 for serial
communication. The circuit ISIS diagram is given in
Figure 6.
Figure 6. MAX-232 communication layer schematic
3.7. DAC Application
The block structure of the implemented system is given in
Figure 7.
Figure 7. PC-controlled inverter block structure
When a symmetrical 9-30 V DC supply is made from the
J1 and J2 pins in the circuit shown in Figure 8., the +12V
-12V supply voltage needed by the op-amp will be
obtained thanks to the 7812 and 7912 regulator circuits.
With the 7805 regulator circuit, the microprocessor is
supplied with +5V.
WSEAS TRANSACTIONS on COMPUTERS
DOI: 10.37394/23205.2022.21.15
Emre Dedesin, Mesud Kahriman, Ozlem Coskun
E-ISSN: 2224-2872
106
Volume 21, 2022
Figure 8. Inverter circuit schematic with 16-bit bus
For the circuit whose schematic circuit is shown in Figure
8, a printed circuit design has been made and the circuit
shown in Figure 9 has been drawn. Figure 10 shows its
realization.
Figure 9. Inverter printed circuit drawing
For the circuit whose schematic circuit is shown in Figure
8, a printed circuit design has been made and the circuit
shown in Figure 9 has been drawn. Figure 10 shows its
realization.
Figure 10. Realized inverter circuit
WSEAS TRANSACTIONS on COMPUTERS
DOI: 10.37394/23205.2022.21.15
Emre Dedesin, Mesud Kahriman, Ozlem Coskun
E-ISSN: 2224-2872
107
Volume 21, 2022
Despite the voltage and frequency values entered from
the NI Labview communication interface program, the
sinus code written to the microprocessor changes at that
rate. In this way, the desired signal response is obtained
from the op-amp output with the DAC assembly
connected to the ports of the microprocessors.
While performing serial communication, a key character
is needed in order for the microcontroller to receive
correct data from the data coming from the PC. In
practice; As seen in Figure 12 and Figure 13, V for
voltage value and T for frequency is selected as the key.
4 Conclusions and Discussion
The signal at the output of PORTB (yellow sine indicated
in Figure 11) is given to the inverting op-amp circuit, and
the input signal is output with 180° phase difference (pink
colored sinus indicated in Figure 11), with the input signal
coming from PORTC (Figure 11'). The blue colored sine)
collector is given to the op-amp circuit. Thus, the two
input signals have formed the positive (+) and negative (-)
alternans of the sinusoidal signal at the collector op-amp
circuit output (green colored sinus in Figure 11).
Figure 11. PORTB, PORTC, invert and collect op-amp
output waveforms
Ready serial communication interface of NI Labview
software is used for controlling the inverter from PC. The
frequency of the sine waveform to be created with the
interface used can be easily adjusted by the user.
Sample results for the interface used are given in Figure
12 and Figure 13. The 'V1T50' command written to the
user interface shows that the voltage value of the Inverter
output signal remains constant and the transition time of
the R-2R ladder assembly in PORTB and PORTC is
determined as 50μS. Thus, Vpp=10.6 V, f=11.42 Hz was
obtained. Signal response observed from the inverter
output is as shown in Figure 12.
Figure 12. Inverter output waveform (Volt/Div: 2V
Time/Div: 17.5Ms)
The 'V2T500' command written to the serial
communication system shows that the voltage value of the
inverter output signal is doubled and the transition time of
the R-2R ladder assembly in PORTB and PORTC is
determined as 500 μS. Thus, Vpp=20.5 V, f=7.14 Hz was
obtained. Signal response observed from the inverter
output is as shown in Figure 13.
Figure 13. Inverter output waveform (Volt/Div: 2V
Time/Div: 17.5Ms )
WSEAS TRANSACTIONS on COMPUTERS
DOI: 10.37394/23205.2022.21.15
Emre Dedesin, Mesud Kahriman, Ozlem Coskun
E-ISSN: 2224-2872
108
Volume 21, 2022
Inverter design is realized with PIC controlled weight
resistive R-2R ladder type (DAC) circuit. With the
addition of RS232 serial communication integration to
this structure, the inverter output has become PC
controlled with an interface program from a second
channel. Thus, the inverter circuit has become
controllable from the internet environment, that is, from
remote points. Thanks to the interface used, the output
voltage and frequency of the designed inverter can be
adjusted simply by the user.
References:
[1]Mallalieu K, Arieatas R, Soapos;Brien D. An
inexpensive PC-based laboratory configuration for
teaching electronic instrumentation. IEEE Transactions
on Education, Volume 37, Issue 1, pp. 91 96, 1994.
[2]Tolbert LM, Habetler TG. Novel multilevel inverter
carrier-based PWM method. Industry Applications, IEEE
Transactions on, vol. 35, p. 1098-1107, 1999.
[3]Levi E, Jones M, Vukosavic SN, Toliyat HA. A novel
concept of a multiphase, multimotor vector controlled
drive system supplied from a single voltage source
inverter. Power Electronics, IEEE Transactions on, vol.
19, p. 320-335, 2004.
[4]Noguchi T, Yamamoto M, Kondo S, Takahashi I.
Enlarging switching frequency in direct torque-controlled
inverter by means of dithering. Industry Applications,
IEEE Transactions on, vol. 35, p. 1358-1366, 1999.
[5]Lai YS. Investigations into the effects of PWM
techniques on common mode voltage for inverter-
controlled induction motor drives. in Power Engineering
Society 1999 Winter Meeting, IEEE, pp. 35-40, 1999.
[6]Ye Z, Jain PK, Sen PC. Circulating current
minimization in high-frequency AC power distribution
architecture with multiple inverter modules operated in
parallel. Industrial Electronics, IEEE Transactions on,
vol. 54, pp. 2673-2687, 2007.
[7]Lai YS, Chen JH. A new approach to direct torque
control of induction motor drives for constant inverter
switching frequency and torque ripple reduction. Energy
Conversion, IEEE Transactions on, vol. 16, p. 220-227,
2001.
[8]Peng FZ. A generalized multilevel inverter topology
with self voltage balancing. Industry Applications, IEEE
Transactions on, vol. 37, p. 611-618, 2001.
Creative Commons Attribution License 4.0
(Attribution 4.0 International, CC BY 4.0)
This article is published under the terms of the Creative
Commons Attribution License 4.0
https://creativecommons.org/licenses/by/4.0/deed.en_US
WSEAS TRANSACTIONS on COMPUTERS
DOI: 10.37394/23205.2022.21.15
Emre Dedesin, Mesud Kahriman, Ozlem Coskun
E-ISSN: 2224-2872
109
Volume 21, 2022