Professional Documents
Culture Documents
EL-050
(Group Leader)
Muhammad Haris
Syed Dayab Hussain
Syed Ali Mujtaba
Ali Ahmed Khan
EL-059
EL-058
EL-049
EL-062
PROJECT ADVISORS
PROF. Ghulam Hussain
Professor, U.I.T.
(External Advisor)
[i]
ACKNOWLEDGEMENT
We like to thank Prof. Ghulam Hussain for helping us in the project and giving us his
priceless advice especially in transformer design issues. Also we like to thank Syed Huzaif
Ali without him our project will never come to an end; we greatly honor his timeless efforts
in the making of this project. We also give credit to Sir Tariq Rehman for his great support
throughout the year and solve our problems that we face in our project. Last but not the
least we also want to thank Miss Madiha Shabbir who manage us all the necessary
equipment and resources which was necessary important in the development of the project.
[ii]
ABSTRACT
Online Hybrid Inverter targets the basic problem of Pakistan -the energy crisis. The scope
of the project covers Maximum Peak Power Tracking of both the sources with the main
feature of flux additivity, delivering a fluctuation free power to the users. The project is one
of a kind in Pakistan that utilizes both the sources at the same time. The system also
involves efficient charging that keeps the battery life long lasting. The user can also
monitor the status of the system from remote location via internet. The whole system is
connected to PC via a dedicated USB interface which is also a prominent feature of the
system.
[iii]
TABLE OF CONTENT
CHAPTER NO. 01 .................................................................................................................... 3
INTRODUCTION ...................................................................................................................................... 3
1.1 CONVENTIONAL STRUCTURE: ............................................................................................................. 3
1.2 MULTIPORT STRUCTURE: .................................................................................................................... 4
1.3 BASIC METHODOLOGIES: .................................................................................................................... 6
1.3.1 TIME SHARING: ....................................................................................................................... 6
1.3.2 FLUX ADDITIVITY:.................................................................................................................. 8
[iv]
[v]
[1]
CHAPTER NO. 01
INTRODUCTION
Hybrid power sources are becoming more and more popular. For example, like the power
coming for the solar PV array are heavily relying on weather condition. Also the wind
power is not reliable especially in Karachi. So to compensate the fluctuations of power
from both the sources hybrid energy system is used. The whole project is concentrated on
multiport converters which is a promising concept. Further the feature of MPPT, inverter,
smart charger, communication with internet is performed.
[2]
Figure 1.1: different storage position in hybrid power source (a) In parallel with main source (b) on the main power
flow path and (c) connected to the dc bus through bidirectional dc-dc converter
[3]
storage, and load. The whole system is able to operate in both stand-alone and gridconnected modes. In case of stand-alone.[2]
Multiport
multi-port structure
Structure
Structure
yes
No
Conversion steps
Minimized
Control scheme
separated control
Centralized control
complicated, slow
simple, fast
Transformer
multiple single,
Multi-winding
Implementation effort
High
low
[4]
[5]
Figure 1.3: Multiport converter using the flyback topology, showing (a) two-input flyback converter, (b) MIMO flyback
converter, and (c) typical gating signals for the two-input flyback converter.
Figure 1.4: Multiport converter based on the time-sharing concept, showing (a) topology and (b) typical gating signals.
[6]
adding up the produced magnetic fluxes together in the magnetic core of the coupled
transformer. With phase-shifted PWM control, the proposed converter can draw power
from two different dc sources and deliver it to the load individually and simultaneously,
and output voltage regulation and power flow control can be achieved. Due to the currentfed structure of the converter, the converter has the ability to accommodate voltage
variations of the sources. However, this topology is not bidirectional. Although softswitching is achievable, the current stress of the switches is high. Therefore, its application
is limited to medium-/low-power applications.
[7]
CHAPTER NO. 02
OVERVIEW OF THE SYSTEM
CHARGE CONTROLLER
WIND
GENRATOR
BUCK
CONVERTER
WIND OVER
VOLTAGE
PROTECTION
MPPT
MPPT
MULTIPORT HYBRID
CONVERTER
SOURCE
CONTROLLER
FLYBACK
CONVERTER
EFFICIENT
CHARGER
BATTERY BANK
I
S
O
L
A
T
I
O
N
12VDC
12VDC
INVERTER
DC-DC
CONVERTER
DC-AC
CONVERTER
PWM CONTROLLER
DATA
PUBLISHING
[8]
CHAPTER NO. 03
MAXIMUM PEAK POWER TRACKING
3.1 MPPT:
Maximum power point tracking (MPPT) is a technique that grid tie inverters, battery
chargers and similar devices use to get the maximum possible power from the PV array or
wind turbines. Solar cells and wind turbines have a complex relationship between solar
irradiation and wind speeds and total resistance that produces a non-linear output efficiency
known as the I-V curve. It is the purpose of the MPPT system to sample the output of the
system and apply a resistance (load) to obtain maximum power for any given
environmental conditions. Essentially, this defines the current that the inverter should draw
from the PV in order to get the maximum possible power. [1]
The peak power is reached with the help of a dc/dc converter by adjusting its duty cycle
such that the resistance corresponding to the peak power is obtained. Manual tracking of
duty cycle is not possible so automatic tracking is preferred to manual tracking. An
automatic tracking can be performed by utilizing various algorithms (for solar). [2]
a. Perturb and observe
b. Incremental Conductance.
c. Parasitic Capacitance.
d. Voltage Based Peak Power Tracking.
e. Current Based peak power Tracking.
[9]
Peak
Power
BUCK CONVERTER
Switch
MOSFET
Driver
PWM
Controller
Controller
DAC
Figure 3.1: Block diagram showing the main parts of Solar MPPT and their interconnections.
By taking the value of open circuit voltage after every 5 seconds the controller multiplies
the value to 0.75 and sends it to the PWM controller which drives the buck regulator and
sets the desired Vmpp.
[10]
Figure 3.2: showing the basic structure of Buck converter working in asynchronous mode.
3.1.1.2.2 DRIVER:
The PWM controller itself cannot drive the MOSFET due to its high gate to source
capacitance. So an intermediate stage is required which provide enough current at high
frequency. For driving the MOSFET IR2110 is used. The IR2110 is running in
bootstrapping configuration for driving the high side MOSFET. For more details of
bootstrapping and its calculation see section 6.4.4
[11]
25.3V
18.8V
24V
18.1V
24.5V
18.3V
Table 3.1: Voc vs. Vmpp
[12]
18.8
18.7
18.6
18.5
18.4
18.3
18.2
18.1
18
23.8
24
24.2
24.4
24.6
24.8
25
25.2
Figure 3.3: Shows that the output is approximately 75% of the input voltage (Voc).
25.4
[13]
Figure 3.4: Model of the wind turbine used to study the effects of air speed on frequency, power, voltage and current.
3.2.2 RESULTS:
The result shows the effect of wind speed over the output voltage, frequency and other
parameters.
[14]
(a)
[15]
(b)
Figure 3.5: (a) and (b) shows the characteristic curves of different parameters of a wind turbine.
[16]
When the steady state is reached the algorithm oscillates around the peak point. In order to
keep the power variation small the perturbation size is kept very small. The algorithm is
developed in such a manner that it sets a reference voltage of the module corresponding to
the peak voltage of the module.
[17]
BUCK CONVERTER
WIND
TURBINE
Driver
LOAD
Controller
Figure 3.7: Architecture designed for Wind Maximum Peak Power Tracking.
3.2.4.1 CONTROLLER:
For controlling purposes the microcontroller PIC 16f877 is used. The controller receives
the feedback from the load and calculates the output power and sets the duty cycle
according to the following algorithm.
[18]
Start
Read V and I
from turbine
P= V(t) * I(t)
P= P(t)-P(t-1)
At V= V(t)- V(t-1)
No
YES
P>0
V<0
No
V<0
YES
D=D+D
YES
No
D=D-D
D=D-D
Driver
D=D+D
[19]
Vmpp
18
14
20
16.7
24
19.4
22
18.6
16
11.7
Table 3.2: shows the relation between Input voltage and Vmpp
[20]
17
16
15
14
13
12
11
10
15
16
17
18
19
20
21
22
23
24
25
Figure 3.8: shows the effect of input voltage on maximum peak power point.
[21]
CHAPTER NO. 04
MULTIPORT HYBRID CONVERTER
The multiport hybrid converter is MISO (Multiple Input Single Output) system and it is the
backbone of any hybrid energy system. Its function is to combine the power of multiple
sources on a single DC line. The main features of online hybrid inverters multiport hybrid
converter are:
1. Complete Isolation of the sources.
2. A highly efficient 220 volts fly-back regulator.
3. Works on the principle of flux additivity.
4. Draw power from the sources according to the power available.
5. Under-voltage shutdown with hysteresis feature.
[22]
4.1 ARCHITECTURE:
WIND MAXIMUM
PEAK POWER
MODULE
PWM
CONTROLLER
OPTO
ISOLATOR
MOSFET
OPTO
ISOLATOR
SOLAR
MAXIMUM PEAK
POWER MODULE
FILTER
Secondary
Pulse Transformer
Primary1
Primary2
MOSFET
[23]
MOSFET
IGBT
Frequency
>20Khz
<20Khz
Voltage
<250
>1000
Losses
Medium
High
Temperature
Ambient
>100C
[24]
Primary 1
Primary 2
Secondary
Turns(N)
Wire size(AWG)
24
20
24
Strands
Current(A)
[25]
Figure 4.2: Core of the pulse transformer (the physical windings and turns)
Value
Unit
5300
Vrms
Isolation Resistance
>1012
Switching time
Us
[26]
In the final prototype we use EL817 optocoupler because of its small size and cheapness
factor. It is 3 times smaller and about 30 times cheaper than ILQ74. It gives excellent
results at the specified frequency with complete isolation.
Parameter
Value
Unit
5000
Vrms
Isolation resistance
5x1010
Switching Time
3.5
Us
[27]
Figure 4.3: Simulation results of the source controller indicating the two voltage levels.
[28]
Vout
Iin
Iout
Efficiency
Inferences
12
222
2.1
0.07
63%
15
222
1.59
0.07
65%
18
221
1.28
0.07
67%
high efficiency.
24
221
0.96
0.07
67%
Current I(A)
1.95
1.75
1.55
1.35
1.15
0.95
0.75
11
13
15
17
19
21
23
25
[29]
(a)
Efficiency
68%
67%
66%
Efficiency
65%
64%
63%
0
10
15
20
25
30
(b)
Figure 4.4:(a) V-I characteristic curve of multiport hybrid converter at 16W load.(b) Efficiency analysis of the multiport
hybrid converter (Note the efficiency is increasing as increasing in voltage)
[30]
Source2
Multiport Hybrid
Converter
Vin1
Iin1
Vin2
Iin2
Vout
Iout
12
0.53
18
0.86
222
0.07
14
0.92
15
1.27
222
0.07
15
1.24
14
0.93
221
0.07
18
0.95
12
0.50
222
0.07
Flux additivity
1.3
1.2
Current (A)
1.1
1
0.9
0.8
0.7
0.6
0.5
0.4
10
11
12
13
14
15
16
17
18
19
Voltage (V)
Figure 4.5: Shows the principle of flux additivity. The power is fed to the load by the combination of both the sources.
[31]
4.4 CONCLUSION:
The flux additivity is successfully performed which indicates that higher the voltage the
higher the flux generated which in turns produces more power at the output.
[32]
CHAPTER NO. 05
CHARGE CONTROLLER DESIGN
In this chapter we will discuss the buck regulator, charge controller and the battery bank
design according to the requirements of ONLINE HYBRID INVERETER.
The output voltage (200V) of multiport hybrid converter cannot be fed directly to the
charging circuit. To overcome this problem a buck converter is designed which maintains
an output voltage of 30 volts to drive the charging circuit. The complete description of this
converter has been discussed in section 3.1.1.2.1.
[33]
[34]
A gate driver IC IR2110 has been used in this converter in bootstrap mode to
minimize the heating and effecting switching of pass device.
IRF840 is used as a pass element which can easily pass 13A of current and having
drain to source voltage tolerance up to 600 volts.
[35]
always require at least 4 batteries to make the system work, and to increase the backup
time we would have to add 4 more batteries, no less is useful.
Large number of batteries in parallel increases the amount of current in the system, thereby
increasing the power losses. Hence, we have to select battery bank in such a way so as to
minimize losses as well as the number of batteries required by the system for its
performance. We have proposed the following design after optimizing the power losses and
the battery requirement.
[36]
The charging of batteries is always an issue of debate when we are talking about the usage
of batteries in any power backup or alternate energy systems. Batteries must be charged in
such a way that minimum of the system power is lost while they are charging and the
charging time also needed to be as small as possible. Furthermore, overcharging the
batteries and letting them to be discharged below a particular point DOD (Depth of
Discharge) point also decreases the battery life.
To overcome all of these problems, and for increasing the efficiency of the system, the need
of a charge controller is evident. A charge controller, also known as charge regulator or
battery regulator limits the rate at which electric current is added to or drawn from electric
batteries. It prevents overcharging and may prevent against over voltage, which can reduce
battery performance or lifespan, and may pose a safety risk. It may also prevent completely
draining ("deep discharging") a battery, or perform controlled discharges, depending on the
battery technology, to protect battery life. The accepted design will provide this output with
the least amount of total losses. The design is to be tested with batteries of different ratings
for the verification that it meets all the needs.
5.3.1 OBJECTIVE:
Alternate Energy Systems comprise of batteries for increasing the backup time, in the
absence of the sources of power (wind & solar energy). We are using 12V 20Ahr batteries
connected in series and parallel to provide the maximum backup time of 6hrs. The battery
bank acts a unit of 24V 80Ahr battery. We need to charge the 24V 80Ahr battery bank in
minimum time without trading off for the battery life for our 1kw system. The batteries can
be charged by a current ranging from 6-8 Amps taking the charging time from 8 hr to a
[37]
minimum of 2 hrs for one battery. The battery life is reduced by over charging and also by
discharging it below the DOD (Depth of Discharge) point. We have connected the batteries
in series, so the battery equalization also needed to be maintained for a longer battery life.
The primary objective for charge controller designing was to develop efficient charging
mechanism for the rated battery bank of 24V 80Ah, along with providing sufficient
protection circuitry.
5.3.2 SALIENT FEATURES
Intelligent charging of the battery bank
No PWM based charging required as the Charge Controller provides the appropriate
analogue voltage to control the pass element.
[38]
for expressing charge and discharge current rates, i.e., a 2.5 amp-hour battery charging at
500mA is said to be charging at a C/5 rate. Battery life performance is measured in one of
two ways; cycle life or stand-by life. Cycle life refers to the number of charge and
discharge cycles that a battery can go through before its capacity is reduced to some
threshold level. Standby life, or float life, is simply a measure of how long the battery can
be maintained in a fully charged state and be able to provide proper service when called
upon. The measure which actually indicates useful life expectancy in a given application
will depend on the particulars of the application. In general, both aspects of battery life will
be important.
During the charge cycle of a typical lead-acid cell, lead sulfate, PbSO4, is converted to lead
on the batterys negative plate and lead dioxide on the batterys positive plate. Once the
majority of the lead sulfate has been converted, overcharge reactions begin. The typical
result of over-charge is the generation of hydrogen and oxygen gas. In unsealed batteries
this results in the immediate loss of water. In sealed cells, at moderate charge rates, the
majority of the hydrogen and oxygen recombine before dehydration occurs. In either type
of cell, prolonged charging rates significantly above C/500, will result in dehydration,
accelerated grid corrosion, and reduced service life.
5.4.1 DUAL LEVEL FLOAT CHARGER:
Charging Algorithm:
For efficient charging to the battery bank the charging cycle of dual level float charger is
divided into four stages. The charging sequence is illustrated by the charger state plot in
figure 5.5.
[39]
[40]
current diminishes. Over-charge is terminated when the current reduces to a low value,
typically one-tenth the bulk charge rate.
4. Float-Charge To maintain full capacity a fixed voltage is applied to the battery. The
charger will deliver whatever current is necessary to sustain the float voltage and
compensate for leakage current. When a load is applied to the battery, the charger will
supply the majority of the current up to the bulk-charge current level. It will remain in the
float state until the battery voltage drops to 90% of the float voltage, at which point
operation will revert to the bulk charge state.
5.4.2 DESIGN REQUIREMENTS:
For charging the battery bank of 24V 80A, we need a charger that meets all the following
design requirements:
Over charging of battery and prolonged charging rates significantly above C/10 will
result in dehydration, accelerated grid corrosion, and reduced service life.
At charge rates of >C/5, less than 80% of the cells previously discharged capacity
will be returned as the over-charge reaction begins. For over-charge to coincide
with 100% return of capacity, charge rates must typically be reduced to less than
C/100.
To accept higher rates the battery voltage must be allowed to increase as overcharge is approached. The over-charge reaction begins when the cell voltage rises
sharply, and becomes excessive when it levels out and starts down again
[41]
The charger needs to provide the battery with the correct float charge level by
applying a constant voltage to it. This should be large enough to compensate for
self-discharge without degrading the battery from excessive overcharging.
With the proper float charge, sealed lead-acid batteries are expected to give standby
service for 6 to 10 years. Errors of just five percent in a float chargers
characteristics can halve this expected life.
Before design and implementation of the charge controller of the battery bank, we designed
a low power charge controller of 12v 12Ahrs batteries to check the design and
performance.
We have used UC3906 designed as a dual level float charger. It starts charging the battery
in bulk charge mode, until it reaches the overcharge voltage where charger decreases it
current and over charge the battery up to an extent while working in over charge mode.
After the charging of battery, it enters float charge mode to protect battery from low self
discharge.
CALCULATIONS:
Overcharge Voltage, VOC = 14.7v
Float Voltage, VF = 13.9v
Trickle Bias Voltage, VT = 10v
IMAX = 2.5A (charging current in bulk charging mode)
R c = 44.2k
RD = 732k
RA = 205.5k
RB = 17.4k
Rs = 0.33 (Current sensing resistance) ; for 12h battery
RT = 140 (Trickle Bias resistance) ; for IT = 100mA (Trickle bias current)
[42]
OBSERVATIONS:
MODES
TRICKLE CHARGE
BULK CHARGE
OVER CHARGE
FLOAT
VOLTAGE (V)
CURRENT (A)
LESS THAN 7V
.1 - .2
10.2 12.2
2.3
14.0 14.7
2.3 1.5
13.9
.23
Table 5.1: Modes of charging of 12V 12Ahr battery
3
2.5
CURRENT
2
1.5
1
0.5
0
0
10
12
14
16
VOLTAGE
Figure 5.6: Dual level float charging curve
[43]
OBSERVATIONS:
MODES
TRICKLE CHARGE
BULK CHARGE
OVER CHARGE
FLOAT
VOLTAGE (V)
CURRENT (A)
LESS THAN 14V
.2 - .3
20.2 24.2
2.7
28.0 28.7
2.8 1.9
26.9
.25
Table 5.2: Modes of charging of 24V 12Ahr battery
3.5
3
CURRENT
2.5
2
1.5
1
0.5
0
0
10
15
20
VOLTAGE
25
30
35
[44]
The pass element must have sufficient current and power to easily facilitate
maximum charging rate at the maximum input to output differential.
The device must have high current gain at maximum charge rate to keep the drive
current required to less than 25mA.
The open loop gain of both the voltage and the current control loops are dependent
on the pass element and its configuration.
Switching loses must be negligible in pass element in order to maintain the modes
of charging.
We are using BJT TIP 127 as pass transistor in composite common emitter configuration.
The configuration holds the following characteristics:
VCBO = 100 V
VCEO = 100 V
VEBO= 5 V
IC = 5A DC & 8A pulse
IB= 120 mA
Output Capacitance = 300pF
[45]
[46]
CHAPTER NO. 06
INVERTER
The dc-ac converters and commonly known inverters aim to efficiently transform Dc power
source to a high voltage Ac source similar to the power that is available at the electrical
wall outlet. Inverters are used in many applications as in situations where low voltage DC
sources such as batteries, solar panels or fuel cells and wind turbine must be converted so
that devices can run of AC power. The method, in which the low voltage DC power is
inverted, is completed in two steps. The first being the conversion of the low voltage DC
power to a high voltage DC power source, and then being the conversion of the high DC
source to an AC waveform using pulse width modulation. Another method to complete the
desired outcome would be to first convert the low voltage DC power to AC, and then use a
transformer to boost the voltage to 220volts.
Of the different DC-AC inverters on the market today there are essentially two different
forms of AC output generated: modified sine wave, and pure sine wave. A modified sine
wave can be seen as more of a square wave than a sine wave; it passes the high DC voltage
for specified amounts of time so that the average power and rms voltage are the same as if
it were a sine wave. These types of inverters are much cheaper than pure sine wave
inverters and therefore are attractive alternatives.
[47]
6.2 ARCHITECTURE:
Battery
bank
MOSFE
T
Transfo
rmer
H-Bridge
Driver
Driver
PWM controller
Short Circuit
Protection
Control Signal
DC/AC converter
Overvoltage
Protection
[48]
Figure 6.2: Model of a AC-DC and DC-AC converter used to study different parameter of inverter.
[49]
Figure 6.3: shows the effect of Vdc on different parameter such as load voltage current and modulation index.
[50]
Figure 6.4: FFT analysis of the load Voltage. It shows the THD of 2% at the modulation index of 0.8.
[51]
6.4.2 H-BRIDGE:
For transforming 311Vdc to 220Vrms sinusoidal output an h-bridge is implemented. It
works on 50Hz frequency. The technique of modified sinusoid is adopted due to the
following reason:
1. Less switching power loss.
2. Works fine on inductive load.
3. Requires simple circuitry.
4. Cheap as there is no feedback component.
[52]
Parameter
Value
Units
500
Drain Current
13
Rds(on)
0.85
[53]
Similar considerations apply to the turn-off interval. Figure shows theoretical waveform for
the MOSFET during the turn-off interval.
Figure 6.7: shows the waveforms for turn on and turn off MOSFET.
[54]
Now, while designing a suitable MGD for the H-bridge, we employed an IC namely
IR2110.International Rectifiers IRS2110 integrate most of the functions required to drive
one high-side and one low-side power MOSFET or IGBT in a compact, high performance
package. With the addition of few components, they provide very fast switching speeds and
low power dissipation. Used in the bootstrap mode, they can operate in most applications
from frequencies in the tens of Hz up to hundreds of kHz.
The bootstrapping principle is used due to its ease and symmetry from the previous stage.
In Figure 3-14, the block diagram of the IR2110 shows the typical IC structure. It
comprises a drive circuit for a ground referenced power transistor, another for a high-side
one, level translators and input logic circuitry.
Also, the precise application of the circuit is visible in the diagram. We have used the IC in
same configuration. The calculation of bootstrap capacitor was done using equation.
[55]
where:
Qg = Gate charge of high-side FET
f = frequency of operation
ICbs (leak) = bootstrap capacitor leakage current
Iqbs (max) = Maximum VBS quiescent current
VCC = Logic section voltage source
Vf = Forward voltage drop across the bootstrap diode
VLS = Voltage drop across the low-side FET or load
VMin = Minimum voltage between VB and VS.
Qls = level shift charge required per cycle (typically 5nC for 500 V) [3]
By choosing appropriate values the value come out to be CBOOST 1uF and the max peak
current for charging is 1A so 1N4007 diode is used as bootstrap diode.
[56]
CHAPTER NO. 7
INTERFACING, GUI AND BROADCASTING
The human interface and display should be very much attractive and user friendly so that
lay man can easily understand it and can realize the whole process with in seconds and the
user requires no manual to analyze his power consumption.
To make an eye-catching GUI we used LABVIEW but to make our data reachable to
LABVIEW for display and broad casting we have to make an interface, the interface that
will transfer our data to computer for display. The best and most latest way of communicate
or transfer data to computer is Universal Serial Bus (USB).
The figure 7.1 clearly demonstrates the main blocks of interfacing and broadcasting of data;
BROADCASTING
CHARGE
CONTROLLER
USB
INTERFACE
(PIC 18F4550)
LABVIEW
INVERTER
USB INTERFACING AND BROADCASTING
[57]
[58]
a data packets created by the device drivers by a PCs software programs. It supports every
peripheral that can be connected to PC .
7.1.1.1 USB ARCHITECTURE:
The USB is based on a 'tiered star topology' in which there is a single host controller and up
to 127 'slave' devices. The host controller is PC and the slaves are the USB devices which
can be connected to USB port or USB hubs. The USB hubs are used when there is not
enough USB port for the USB connection. The hub can be plugged into another hub and so
on however the maximum number of tier allowed is six.
All the communications on the USB bus are initiated by the host (PC) meaning that, only
PC can enumerate the communication with its USB device connected to it. The USB device
cannot initiate a transfer, but must wait to be asked by the host PC to transfer data. The only
exception to this is when a device has been put into 'suspend' (a low power state) by the
host then the device can signal a 'remote wakeup'.
7.1.1.2 DATA TRANSACTIONS:
Transactions are simple transfer of data which are built using packets. The packets are the
smallest element of data transmission. The packet can be categorized by its format. There
are four types of packet format which are token packet, data packet, handshake packet and
SOF (Start of Frame) packet. Each of the packets has its own function and the difference
between them is based on the PID (Packet Identifier) the packet starts with.
A successful transaction is a sequence of three packets which perform a simple but secure
data transfer. There are three types of transactions which are OUT transaction, IN
transaction and SETUP transaction with four different ways to transfer the data (data flow
[59]
types). OUT is always mean from host to device while IN means from device to host. All of
the transactions are met at the endpoints. The endpoints are the source or sink of data. A
device can have up to 16 IN and 16 OUT endpoints. Each of endpoints is connected to
pipes to transfer the data.
[60]
There are four types of data transfer and each of the data flow (transfer) types is made by
more than one or more transaction type. They are bulk transfer, isynchronous transfer,
interrupt transfer and control transfer.
Bulk transfer is used to transfer large amounts of data, as fast as possible. The host will
schedule bulk transfer after the other transfer types has been allocated. If an OUT endpoint
has been defined to use bulk transfer then the host will transfer the data through it.
Similarly for IN transaction, if the IN endpoint is defined to use bulk transfer.
Isynchronous transfer is used for applications such as audio data transfer where it is
important to maintain the data flow. Compared to bulk transfer, isynchronous transfer has a
guaranteed bandwidth. Isynchronous packet may contain up to 1023 bytes at full speed or
1024 bytes at high speed and it is not allowed at low speed data transfer.
Interrupt transfer is used when we need to regularly update any changes in the device
status. For application example is mouse or a keyboard. It is regularly scheduled the IN and
OUT transactions and typically the host will fetch only one packet at an interval. Interrupt
packets can have any size from 1 to 8 bytes at low speed, 1 to 64 bytes at full speed and 1
to 1024 bytes at high speed.
The last data flow type is control transfer which is a bi-directional transfer because it uses
both IN and OUT endpoints. Each of USB devices must have this type of transfer as the
control transfer will be used for initial configuration of the device (enumeration). It uses
special endpoints which are Endpoint 0 that is made of the combination of Endpoint 0 OUT
and Endpoint 0 IN. They may be used (on the same endpoints) after configuration as part of
the device-specific control protocol, if required.
[61]
During record process, the host will retrieve vendor ID, product ID and other information
using control transfer. This data is retrievable as a group of standard requests for testing
whether communication is working or not. The standard request can be found in the USB
specifications.
TRAMSFER TYPE
Control
CHARACTERISTICS
Upto 15.8MB/s.
APPLICATIONS
Everything
support these.
Extendable: custom
functions.
Interrupt
Upto 49 MB/s.
Asynchronous.
Guaranteed
throughput.
[62]
Isochronous
Upto 49MB/s.
High speed.
No error correction.
Guaranteed
Audio , Video
bandwidth.
Bulk
Upto 53MB/s.
Storage.
unused bus).
Error correction.
[63]
CONTACT
SIGNAL NAME
NUMBER
DESCRIPTIO
TYPICAL CABLE
COLOUR
1.
Vcc
5VDC
Red
2.
D-
Data-
White
3.
D+
Data+
Green
4.
GND
Ground
Black
When a device is connected to a USB port, the port will immediately determine the speed
of the device by looking at the data lines D- and D+. The high speed device will pull the
data line D+ to high and if the data line D- goes high, the port knows that the connected
device is a low-speed device. If both voltages fall below 0.8V for more than 2.5
microseconds, the port will assume the device is being disconnected. If both voltages rise
up to 2.5V for more than 2.5 microseconds, the device is being plugged in.
Every device that has the USB interface needs to have a device driver that will load into a
PC. It is a software interface between the external USB device and the application software,
the USB software driver and the host hub controller driver. A device driver simplifies
programming by acting as translator between the hardware device with the applications or
operating system.
[64]
The application software will read or receive the signals or data from the USB device
through the device driver. The device driver needs to be created together with the USB
device on its operating system.
However, to create a device driver needs a deep understanding of the device and both of its
hardware and software operations. Thus the task of writing drivers usually falls to software
engineers who work for hardware-development companies. This is because they have better
information than most outsiders about the design of their hardware.
7.1.3 GRAPHICAL USER INTERFACE AND LABVIEW:
[65]
protocols (RS232, GPIB, etc.), powerful toolsets for process control and data fitting, fast
and easy user interface construction and an efficient code executive environment.
7.1.3.1 NI-VISA:
NI-VISA stands for National Instrument-Virtual Instrument Software Architecture. It is one
of the National Instrument software together with LabVIEW software. NI-VISA is a highlevel API mainly used to communicate with a USB device.
[66]
It is platform, bus and environment independent which means the same API (Application
Programming Interface) is used regardless the operating system used to communicate the
USB device with LabVIEW.
NI-VISA provides some functions such as NI-VISA Read and Write to be used as
commands for interfacing. There are two types of classes resources supported by VISA
which are USB INSTR and USB RAW. These classes will determine the type of USB
device that we want to communicate with LabVIEW software and each type will use
different protocols. USB INSTR resource class is for instrument control while USB RAW
is a USB device that uses its own communication protocol defined by the manufacturer. For
the USB device used in this project, the type of resource class is USB RAW device.
It is more complicated to communicate with USB RAW device as it has its own protocol.
As mentioned earlier, USB used four types of communications which are control, interrupt,
bulk and isynchronous endpoints. However, NI-VISA only supports for three types of
communication that are control, bulk and interrupt transfer types.
When NI-VISA detects the USB device, it automatically scans for the lowest available
endpoint for each type.
[67]
is compliant with both USB low-speed and full-speed specifications. When the
[68]
PIC18F4550 is used for USB connectivity, it must have either a 6 MHz or 48 MHz clock
for USB operation, depending on whether Low-Speed or Full-Speed mode is being used.
From the figure 7.5, the pins 23 and 24 are used for USB transactions. Pin 23 is connected
to D- data line and pin 24 is connected to D+ data line.
7.2 METHODOLOGY
The main purpose of this block is to take the voltage, current and power values from the sources,
charge controller, battery bank and from inverter and make a graph of voltages from the solar and
wind, display the output power of the system and voltages and currents of battery bank. The
methodology approach of this block is present in the flow chart;
USB DEVICE
Building of USB Firm ware
INTERFACING
Interface the USB with NI-VISA software
LABVIEW APPLICATION
Build a Labview User Application
[69]
PIC 18F4550
Scale voltages
and currents to
5VDC
USB
connector
1- ANALOGUE INPUTS:
The analogue inputs are coming from sources, charge controller and inverter.
2- SACALE VOLTAGE BLOCK:
Since PIC or any other controller will work on 5VDC maximum so we have to scaled down
the analogue voltages and current to 5VDC.
3- PIC 18F4550:
The type of PIC used in this project is 18F4550 40Pin PDIP. There are four ports for
analog or digital input and output which defined as Port A, Port B, Port C, Port D.
All of these ports had been used for the data acquisition of the voltages and current.
Hence, this project did not concern on the input output port of the device instead of
the data lines only.
[70]
[71]
After a USB device has been successfully created, it needs to be interfaced with LABVIEW
software so that they can communicate with each other. In order to interface the device with
[72]
LABVIEW software, NI-VISA software was used. There are two steps taken in order to
configure the USB device with NI-VISA.
1- Create INF file using Driver development Wizard.
2- Install INF file and USB device
The INF file is created by using Driver Development Wizard. This step is to tell the
operating system (Windows) to use NI-VISA as the default driver for the device. The
wizard gathers the information that is necessary to allow NI-VISA to control the USB
device. The wizard will generate an INF file for use with the compatible Windows.
Once the INF file is generated at the specific path, the file was installed followed by
installing the device driver. In order to install the device driver, once the USB device is
connected to the USB port, Windows will automatically search for the device driver and
will suggest the default driver to be used with the device. By default, the device driver used
for the USB device was the driver provided by Microchip Inc. The Microchip Inc. driver is
for general used meaning that any USB device created by using PIC microcontroller can
use the driver provided by the manufacturer.
Hence, in order to use NI-VISA as the default driver, the device driver was updated in the
Device Manager window. Now, the USB device is ready to communicate with LABVIEW
application.
[73]
Once the USB firmware has been completely done, the LABVIEW design process was took
place. In order to design the LABVIEW GUI, we need to determine the type of USB
transfer to be used. For this project, the type of transfer used is control transfer because all
of the USB device use control transfer during enumeration process.
The LABVIEW application was designed to communicate between the USB device and
LABVIEW software and receive the values of current and voltages from USB device. A
host PC will retrieve vendor ID, product ID and other information via control transfer
[74]
during the enumeration. This data is retrievable as a group of standard requests. Each and
every USB device will respond to the standard requests in order to test whether the
communication is working or not.
A flowchart has been designed to understand the flow of the LABVIEW application design
process;
[75]
The block of VI shows in figure 7.11 is used to take the data from the USB device and
make decisions according to the logic circuitry in the VI to display the power, voltages and
current values. As we are transmitting four signals so we use case structure to display their
values according to it (as mentioned in Figure 7.12).
[76]
Figure 7.13: complete VI to generate GUI After recieving data from USB.
In LabVIEW software, there are two windows to be used for the design process. First
window is the Front Panel window and the second window is the Block Diagram window.
Both of the windows have different functions. The front panel window shows the actual
GUI and actual user application once the design is complete while the block diagram shows
the behind code that controls the program. The GUI of the whole online hybrid system are
shown in Figure 7.14.
[77]
This GUI clearly shows the graph of input sources i.e. voltages from solar and wind and the meters
are used to display the power coming from wind and solar.
7.2.4 BROADCASTING:
The GUI that displays the whole process conditions will b broadcast over internet so that a
person can check his power consumption and progress of his energy system from anywhere
in the world.
We used the lab view Web publishing tool for this purpose the final web page that a person
can access from anywhere from the world is shown in Figure 7.15.
[78]
7.3 RESULTS:
The data from USB port is successfully retrieve and their graphs and power values has been
displayed in the GUI.
The webpage of the GUI is successfully published and checked by opening this page on
LAN.
[vi]
REFERENCES
CHAPTER NO. 01: INTRODUCTION
[1] Multiport hybrid converters for hybrid power sources, Haimin Tao, Joerge L.Duarte and
Macrel A.M. Hendrix.
[2] Integration of sustainable energy sources through power electronic converters in small
distributed electricity generation systems, Haimin Tao.
[vii]
Labview forums.
[viii]
NOMENCLATURE
V
Voltage V
Vout
Output voltage V.
Vin
Input voltage V.
vd
Current A.
Id
Il
Load current A.
Resistance .
Rl
Load resistance .
Capacitance F.
Inductance H.
Power W.
Vmpp