Professional Documents
Culture Documents
B.Sc.Project
Presented By:
Ahmed Khalil Ibrahim
13
144
19
163
125
164
129
165
138
166
ACKNOWLEDGMENT
This project consumed huge amount of work, research and dedication. Still,
implementation would not have been possible if we did not have a support of many
individuals. Therefore we would like to extend our sincere gratitude to all of them.
First of all we are all very thankful to Prof. Dr. Mohamed Yousry for his scientific and
moral support and for providing necessary guidance concerning projects
implementation, his constant assessments and evaluations of our work throughout
this whole year have been a great help.
We would like to express our sincere thanks towards everyone in our project who
devoted his time and knowledge in the implementation of this project, there have
been a few ups and downs but we really came out with something and we all benefited
from the whole experience.
Nevertheless, we express our gratitude toward our families and colleagues for their
kind co-operation and encouragement which helped us in the completion of this
project, we may have been a nuisance for some but we are really blessed for having
such great families, truly they spared no effort for our sake.
II
CONTENTS
Module 1 Home Automation
Chapter 1 Introduction to Smart Homes
1.1 The history of smart homes.................................................................2
1.2 Nest products.......................................................................................9
1.3 Samsung SmartThings product..........................................................10
1.4 Smart Home Controlling Systems......................................................13
Chapter 2 Implemented Hardware
2.1 Power Supply.....................................................................................16
2.2 Light System.......................................................................................19
2.3 Shading System..................................................................................20
2.4 Air Conditioning System.....................................................................21
2.5 Door System.......................................................................................22
Chapter 3 Connecting to the Internet
3.1 Internet of things...............................................................................23
3.2 Setting the web server.......................................................................25
3.3 MVC Architecture..............................................................................26
3.4 Database Structure............................................................................27
3.5 Action and Logic.................................................................................28
3.6 Responsive Design (View)..................................................................29
3.7 Web Service.......................................................................................32
Chapter 4 Smart Materials
4.1 Introduction.......................................................................................39
4.2 Wall Insulations.................................................................................40
4.3 Roof Insulations.................................................................................47
4.4 Floor Insulations................................................................................48
4.5 Energy-Efficient Windows..................................................................50
4.6 Energy-Efficient Doors.......................................................................52
III
Module 1
Home Automation
Chapter 1
Introduction to Smart Homes
1.1 The History of Smart Homes
The idea of home automation isnt a recent concept in anyway but it has been more
of a case of technology catching up with the idea. Home automation was a topic of
science fiction for many years and in Ray Bradbury`s short story There will come soft
Rains he wrote about an automated home which continues to work despite no one
living in it.
The remote control it all started with the wireless remote control, which was first
unveiled by Nikola Tesla in 1898 when he controlled boat by sending it radio waves.
By 1984, Pico had developed a joint venture with GE for a product called the
Homeminder. It was a VCR styled package a bit bigger than a cable set top box. It
connected to the TV and was operated by an infrared remote. Eventually the GE
division responsible for the Homeminder was closed and the units were repackaged
and sold to Radio Shack.
In the early 1980s, X10 lacked an official computer interface. Dave Rye of X10 says that
In the early days there were a lot of computer enthusiasts using X10. There were
third party computer interfaces available even before we introduced one. E.g. one by
Steve Ciarcia of Circuit Cellar Ink magazine (marketed by Micromint).
Shortly after the Homeminder, X10 developed their first computer interface for
Mattels short-lived Aquarius computer. X10s Aquarius computer interface eventually
morphed first into the Radio Shack Color Computer Interface, and then into X10s long
lived CP-290 unit, which was sold until the X10 replaced it with the Active Home
controller in the late 1990s. Over the years, the CP-290 has had a long list of both
official and shareware software so that it could be used with Apple IIs, Macs, DOS,
and Windows in all of its many versions.
It was also in 1984, according to Dave Rye, a vice president and technical manager
with X10 (USA) Inc., that BSR went belly up and so we pulled out in 1984 and formed
X10 (USA) Inc. (we being Pico). Pico is now a wholly owned subsidiary of X10 Ltd.
In 1989, X10 introduced the first low-cost self-installed wireless security system. Then
came the Voice Dialer security system, the Monitored security system, as well as
Personal Assistance versions. In 1995, X10 set up its own monitoring station called
Orca Monitoring Services in Seattle, Washington. Today, it monitors security systems
developed and manufactured by X10 for Radio Shack, Phillips Consumer Electronics,
(Magnavox) and the X10 Powerhouse brand.
1.1.5 2010 - Nest enters the picture
Designer of the iPod Tony Fadell started Nest because he believed the existing
products for home automation were too clunky and appealing to only the techsavvy. Since then, the company has developed next generation, wi-fi connected
thermostats and smoke alarms.
As the largest cross-industry consortium in the smart home space, the AllSeen Alliance
aimed for all products to work together in the home.
1.1.10 CES 2014
LG launched a line of smart appliances equipped with
HomeChat, allowing people to communicate with
devices through a mobile message app. Shopping and
don't remember what's stocked in the fridge? Just
send a text. Overall, the Internet of Things was a huge
theme at CES, and more importantly, 2014 revolved
around
partnerships.
SmartThings
unveiled
SmartThings Labs, expanding its home automation to
Belkin, Sonos, Philips and more.
Set connected lights to turn on and off automatically as people come and go
Set connected lights to turn on and off automatically as you open doors
Price: $39.99
10
Monitor whether lights, electronics, and small appliances are turned on or off
Set lights, electronics, and small appliances to turn on and off automatically
Price: $54.99
4. The SmartThings Arrival Sensor can send you a notification when people, pets, and
cars arrive and leave your home. Simply place it in a childs bag, around a pets
collar, or in your car to stay connected to loved ones. And by keeping it on your
keychain, you can trigger it to emit a beeping noise to help you find your keys at
home.
The SmartThings Arrival Sensor is wireless, simple to install, and easy to connect to
your SmartThings Hub.
Set connected lights to turn on and off automatically as people come and go
11
The SmartThings Hub is the heart of your smart home. It connects wirelessly with
hundreds of compatible smart devices, allowing you to monitor, control, and secure
your home from anywhere.
5. The SmartThings Hub is simple to install and easy to use with the free SmartThings
app. With a SmartThings Hub you can connect smart sensors, lights, locks,
cameras, and more to:
Add any of the hundreds of compatible smart devices to enhance your home
Price: $99.00
6. The Lighting and Energy Starter Bundle includes our most popular devices needed
to get you started with adding smart lights to your home. Simply connect your
lights to your SmartThings Hub, download the free SmartThings mobile app, and
then connect the two OSRAM On/Off/Dim Smart Lights and the Motion Sensor
included in this bundle to start customizing lights in your home.
With the Lighting and Energy Starter Bundle, you can:
6. Smart Speaker
It must be a bluetooth speaker and let you control a number of smart home gadgets,
as well as connect to other smart home hubs and read your audiobooks, check the
weather, and even let you purchase things online just by using your voice. And, as a
speaker it`s sounds must be great, too.
Amazon echo is recommended.
7. Smoke Detector
It has an industrial-grade smoke sensor, tests itself automatically, and lasts up to a
decade. It's also must be the first home alarm you can hush from your phone without
any extra hardware required. and have friendly human voice that gives you an early
warning. That way you can handle burning toast before it becomes a burning toaster.
Nest smoke alarm is recommended.
8. Smart Home Lock
Electronic door lock you can use your own personal code to enter your home with just
a few simple pushes of a button and lock it with just one. You also get more control
over who has access to your home. Just assign a temporary code to whoever needs
one and delete it when you see fit. Now you can totally eliminate the need for keys
kwikset is recommended.
9. Best Cookware
You can adjust the crock pot's settings from anywhere, receive reminders, change the
cook time, adjust the cooking temperature, use the timer to calculate cook times and
process, or check the status of your dish so you can come home to a perfectly cooked
meal.
belkin wemo is recommended.
10. Water Monitor:
By the time you discover a water leak in your home, its going to cost a fortune to get
it fixed. So it must detect those leaks before they get serious. Attach its sensors to
water-prone places like sinks and toilets, and if a drop of water falls, an alert is sent to
the hub so you can act immediately amd can Monitor your home 24/7 which lets you
set your own alerts and shows you all the locations of your sensors as well as the
temperature and humidity in those areas.
Wally home is recommended.
14
15
Chapter 2
Implemented Hardware
2.1 Systems
2.1.1 Power Supply
We created a smart power supply for our project that draws its power alternatively
from computer PSU and a Solar panel, this power supply does the desired functions of
measurement, protection and calculation then displays the results on LCD for the
users.
Functions:
1- Measurements
The microcontroller can measure up to 5v Dc, this is used to measure all voltages and
currents of the system
A) Voltage measurement
The system uses 3 levels of dc voltages (3.3V, 5V, 12V) both 3.3 and 5 V are measured
directly through the microcontroller while the 12 V is measured
through a voltage divider
16
2- Protection
A) Under voltage protection
All voltage levels are measured and compared to acceptable levels, if the voltage
drops below these levels the system gives a notification then shutdown.
B) Overload and Short-circuit protection:
The current for every circuit is calculated and a higher margin is given then a suitable
fuse is provided to every circuit to achieve the protection from current changes.
C) Overvoltage protection:
The power supply is provided with over voltage protection on both the 220 AC
voltage side and the DC side that shuts down the PSU automatically when over voltage
occurs.
3- Monitoring
The power supply is constantly measuring the voltages and currents of both the PSU
and the solar panel. Then it performs calculations to find power, energy, cost of energy
per session, total cost of energy, and the cost saved by using the solar panel.
PSU
P = V*I/0.95
Solar
P=V*I
Energy
E=P*t
Cost is calculated according to latest tariff from the ministry of power and electricity,
where the prices are 7.5, 14.5, 16, 30.5, 40.5 and 71 PT for 50, 100, 200, 350, 650 and
1000 KW respectively.
** The energy consumption is saved in the EEPROM of the microcontroller and the
usage of every session is added to the total usage.
17
20
Chapter 3
Connecting to the internet
23
Cost Savings. Many companies will adopt IoT to save money. Measurement provides
actual performance data and equipment health, instead of just estimates. Businesses,
particularly industrial companies, lose money when equipment fails. With new sensor
information, IoT can help a company save money by minimizing equipment failure and
allowing the business to perform planned maintenance. Sensors can also measuring
items, such as driving behavior and speed, to reduce fuel expense and wear and tear
on consumables. New smart meters in homes and businesses can also provide data
that helps people understand energy consumption and opportunities for cost savings.
Applying this idea to our model, we connected every device to the main controller
giving every item an id to be accessed later by the network to send and receive data
from the main server. This gave every device its own identification plus its normal
function throw manual control or automatic control and behavior example: a lamb
can be:
- turned on/off through a button
- has a dimmer behavior through sensors and automatic computation.
- send its status to the server
- get controlled by the server if a web/mobile signal is received.
24
25
The model defines what data the app should contain. If the state of this data changes,
then the model will usually notify the view (so the display can change as needed) and
sometimes the controller (if different logic is needed to control the updated view).
The view defines how the app's data should be displayed. It sends input data from the
user through it GUI to the controller and receive any changes from it.
The controller is responsible for responding to user input and perform interactions on
the data model objects. The controller receives the input, it validates the input and
then performs the business operation that modifies the state of the data model.
There are a few variations of the MVC design pattern such as MVP (ModelView
Presenter) and MVVP(ModelViewViewModel). Even with the so called MVC design
pattern itself, there is some variation between the traditional MVC pattern vs the
modern interpretation in various programming languages. For example, some MVC
based frameworks will have the view observe the changes in the models while others
will let the controller handle the view update. This article is not focused on the
comparison of various implementations but rather on the separationofconcerns
and its importance in writing modern web apps.
26
Using Bootstrap and JQuery to make a responsive design, it is a design that respond
to different hardware, the window size and its content differ from a desktop to tablet
to a mobile.
A Room has a name and description that can be edited with the edit button and can
be destroyed with the destroy button. The latest device status is shown in a table
with red and green colors to show if the status is on/off with a matching icon to the
device to offer a better view.
To change the status of any device
when click on the edit button
shown in the fig.3.9 another table
appear which is a form with
buttons on/off that make a POST
request to the server to update
the status of the device.
The button shows the previous
devices status as checked button
to change and to keep the status
of the unchanged device when
updated.
Fig.3.9: Edit Button
The table with the devices status is being updated dynamically without any
interference from the user or without using the refresh button, to update the device
status if any change occurred in the server from other place e.g. mobile application,
tablet or another computer. For any problems or glitches in the system the user can
send us feedback about his problem to be fixed, through the contact page.
32
The Web API is done through the route action of the rails application in which we
append the url link of the site with an /api/ extension plus a user token to make it
more secure, as there is no password to protect the user privacy nor a way for a
machine to enter a username and password to access the rooms and devices, this
done through the token. Every user get assigned with a unique token that can be
hardcoded in the smart house application to access the corresponding record in the
database.
33
Chapter 4
Smart Materials
4.1 Introduction
Smart materials are materials, systems, and products that behave dynamically
unlike conventional building materials, which are static. This property allows them to
react and adapt to environmental changes. Their particular characteristics
are the result of physical or chemical influences upon the material, such as different
temperatures or direct sunlight.
34
A cavity wall is made up of two walls with a gap in between, known as the
cavity; the outer leaf is usually made of brick, and the inner layer of brick or
concrete block.
A solid wall has no cavity; each wall is a single solid wall, usually made of brick
or stone.
Older houses are more likely to have solid walls while the modern are cavity walls but
more expensive. Insulating your solid walls could cut your heating costs considerably,
because solid walls let through twice as much heat as cavity walls do. The good news
is they can be insulated.
35
36
Cavity wall insulation normally takes around two hours to install, but this depends on
the size of the house and other factors, such as ease of access.
4.2.2.1.2 Is cavity wall insulation suitable for your home?
Your home will usually be suitable for cavity wall insulation if it meets these criteria:
It is more than 10 years old (most newer houses will have insulation already).
The Cavity Insulation Guarantee Agency (CIGA) (Go to the CIGA website)
Internal wall insulation is done by fitting rigid insulation boards to the wall, or building
a stud wall filled in with insulation material such as mineral wool fiber.
External wall insulation involves fixing a layer of insulation material to the wall, then
covering it with a special type of render (plasterwork) or cladding. The finish can be
smooth, textured, painted, tiled, paneled, pebble-dashed, or finished with brick slips.
A) Internal wall insulation
Internal solid wall insulation usually involves fitting ready-made rolls or boards of
insulating material over the inside walls of your house. This can be disruptive - you'll
need to relocate plug sockets, radiators and fitted furniture.
Your walls will need to be carefully prepared before internal insulation can be fitted.
Any damaged plaster needs to be either repaired or removed, and bare brickwork
should be treated to eliminate areas where air can escape. Youll also experience a
slight reduction in floor space due to the extra thickness of insulated walls.
However, this option is usually cheaper than external solid wall insulation and can be
installed on a rolling, room-by-room basis.
Advantages and Disadvantages:
Requires skirting boards, door frames and external fittings to be removed and
reattached
Fills cracks and gaps in the brickwork, which will reduce draughts
Reduces condensation on internal walls and can help prevent damp (but will
not solve rising or penetration damp)
39
40
m2K/W
ft2Fh/BTU
0.76 - 1.46
R-4.3 - R-8.3
0.97 - 1.2
R-5.5 - R-6.8
0.97 - 1.14
R-5.5 - R-6.5
0.63 - 0.82
R-3.6 - R-4.7
R-3.85 - R-4.2
Air-entrained concrete
0.69
R-3.90
Fiberglass batts
0.55 - 0.76
R-3.1 - R-4.3
0.65
R-3.7
0.63
R-3.6
Cardboard
0.52 - 0.7
R-3 - R-4
0.52 - 0.68
R-3 - R-3.85
Cellulose wet-spray
0.52 - 0.67
R-3 - R-3.8
Straw bale
0.26
R-1.45
Softwood (most)
0.25
R-1.41
Hardwood (most)
0.12
R-0.71
Brick
0.03
R-0.2
Glass
0.025
R-0.14
Poured concrete
0.014
R-0.08
Steel stud
5.3x10-4
R-0.003
Reduction in heat loss does not follow R-values linearly, but in an inverse logarithmic
curve. Because R-values are 1 / conductance (U), doubling the thickness of insulation
will not cut heat loss in half. Rather, there is an exponential decay of heat flow,
where the difference between no insulation and one inch (or one cm) of a particular
insulation may save 80% of heat loss, while going from one inch to two inches of that
insulation saves an additional 9%, and going from 9 inches to ten inches only saves
an additional 1%.
4.3 Roof Insulation
4.3.1 Do you have a flat or pitched roof?
The type of insulation you should choose will depend on the type of roof you have. If
you have a pitched roof, there are two options: warm or cold loft insulation. For flat
roofs, there are three options available: warm deck, cold deck or inverted roof.
4.3.1.1 Pitched Roof
A) Cold loft insulation for pitched roofs
The simplest and cheapest roof insulation is the classic cold loft option. This is often
called just loft insulation. This type places insulation over and between the wooden
joists, above the ceiling of your home's top floor. It will stop the heat escaping from
the living area of your home, but leave the loft space uninsulated. This means it will
remain cold in winter and warm up in summer.
This is the only type of roof insulation you can apply to have the costs covered by
an insulation grant. It's also fairly easy to do as a DIY project, and you can buy loft
insulation from most high street DIY stores.
B) Warm loft insulation for pitched roofs
If you can't install cold loft insulation because, for
example, you're using your loft as a living space, you
will need to consider warm loft insulation.
For a warm loft, you install insulation directly under the
roof in the plane of the roof's pitch (slope). Insulation
will reduce heat loss and your loft space won't become
excessively hot in summer or cold in winter.
It's not as easy as laying rolls of insulation, but it can
still be done as a DIY job if you'd rather not pay an
installer.
One important point to remember with a warm loft solution is the need ventilation
immediately below the roof tiles. This prevents condensation build up or water getting
in through or around the tiles, which could cause the roof structure to rot.
42
Warm deck or warm roof has insulation above the roof deck (the panel
underneath the roofing material that's usually made of wood), and is
recommended in damp and cold areas such as Britain.
Cold deck or cold roof has insulation below the roof deck and the associated
joists. Typically, you leave a gap for ventilation, as condensation may form
that can lead to rot. In both warm deck and cold deck options, the weather
membrane, typically formed of roofing felt and bitumen, will be the topmost
layer, protecting against rain.
Inverted roof has insulation that goes above the weather membrane,
effectively protecting it from heat and cold that can shorten its life and that
of the roof deck. It can even protect against wear and tear if there is access
to the roof. With an inverted roof, the top-most layer is generally gravel or a
similar material.
43
44
It's even easier to insulate your timber floor if you have an unheated cellar or
basement space underneath that you can get into. Check that the joists supporting
the floorboards are in good condition and don't show any signs of wet or dry rot.
If the joists are okay, you can fit insulation in between them and hold it in place with
netting if necessary. The basement's 'ceiling' should then have plasterboard fixed
directly to the undersides of the joists, to provide fire resistance and you can then
fit more rigid insulation underneath the 'ceiling' to benefit from even more insulation.
Rugs and carpets on the floor will also help your feet feel warmer, which might mean
you don't feel the need to put the heating on as much.
4.5 Energy-Efficient Windows
All properties lose heat through their windows. But energy-efficient glazing keeps your
home warmer and quieter as well as reducing your energy bills. That might mean
double or triple-glazing, secondary glazing, or just heavier curtains.
4.5.1 How energy-efficient glazing works
Double-glazed windows have two sheets of glass with a gap in between, usually about
16mm, to create an insulating barrier that keeps heat in. This is sometimes filled with
gas. Triple-glazed windows have three sheets of glass, but arent always better than
double-glazed windows.
Energy-efficient windows come in a range of frame materials and styles.
Performance criteria vary according to the following:
Fig.4.9: Double-glazed
45
Aluminum or steel frames are slim and long-lasting, and may be recycled.
46
Peace and quiet: as well as keeping the heat in, energy efficient-windows
insulate your home against external noise.
Reduced condensation: energy-efficient glazing reduces condensation buildup on the inside of windows.
The costs and savings for energy-efficient glazing will be different for each home and
each window, depending on its size, material and the installer you choose. Double
glazing should last for 20 years or more.
4.6 Energy-Efficient doors
Like any other part of the home, doors can be insulated and draught-proofed to
prevent heat from escaping. Building regulations state that installing a new door
requires approval from the relevant buildings control body, and new external doors
now generally contain integrated insula4.6tion to reduce heat loss and comply with
the regulations.
A properly fitted new external door should include an effective draught-proofing
system. Existing doors can be improved by fitting draught-proofing strips around the
seals and the letterbox. Fitting draught-proofing to the doors and windows will save
the typical household between 25 and 35 a year.
47
Fig.4.12
Air conditioners efficiencies are greatly affected by the heating and cooling loads occur
in the building because of radiant energy from the sun that enters through windows,
is absorbed by furniture, walls, and equipment, within the building, and is later
radiated as heat within the building and also affected by the heat conducted through
the building envelope (walls, roofs, floors and windows) to or from the environment
around the building.
The efficiencies of air conditioners are usually measured in terms of their Energy
Efficiency Ratios (EER)
EER= Btu of cooling / (watt-hours of electric energy input)
4.8.1 Cooling Loads Calculations
The cooling load due to summation of heat conduction
Q
total
=Q
transmission
+Q
person sensible
+Q
light
+Q
solar
+Q
equipment
48
The cooling load due to solar radiation through windows can be calculated by
Q
solar
=AxSCxMSHGxCLF
Where
=h +h +
o
X
k
Materials
1-Common brick
(8 cm)
2-Cement plaster
(2 cm)
k=0.38
4-Paint
(2.4 mm)
K=0. 26
Number of Layers
2
2
2
2
49
B) Roof:
1
=h +h +
o
X
k
Materials
Number of Layers
k=1.5
2-Cement (3 cm)
K=0.72
3-Tile(2.54 cm)
K=0.84
K=0.38
5-Paint
(2.4 mm)
K=0.26
(Watt)
50
Lighting accounts for 18% of a typical households electricity bill. You can cut your
lighting bill and energy use by changing which bulbs you use and how you use
them. Houses typically use a mixture of standard light fittings and downlights or
spotlight fittings. Energy efficient bulbs are available for both types of fittings.
51
4.9.2 Comparison Chart between LED Lights, Incandescent Light Bulbs and CFLs
52
An in-home display (IHD) unit will be provided along with the smart meter as part of
the program. This device is the most visible part of the smart metering system and
provides up-to-date real-time information on gas and electricity use in pounds and
pence, as well as units of energy. The display also presents historical information on
consumption so that you can compare current and past use.
4.10.1.2 What are the benefits of smart meters?
They enable you to see when you're using the most energy and how much it's
costing you. This means you can adapt your energy use and cut down on waste
to provide long-term carbon and financial savings.
They provide you with accurate and real-time information about your energy
use, enabling you to make informed decisions about your energy
behavior. Currently many of us receive estimated bills after the energy has
been used, making it difficult to reconcile costs with usage.
remote access to turn your heating on and off, or control the temperature in
your home, using a mobile app
memory to remember your routine energy use - this information can then be
used to set heating preferences automatically
the ability to control the heating in different areas of your home, to avoid
wasting energy by heating un-used rooms
Information about how much energy your heating system is using. Some
devices can store information so that you can see your energy use over time.
They allow you greater control and give you the option to be more flexible with
your heating settings.
They can help you to manage your heating more efficiently and potentially
help you save money on your energy bills. For example, if you are going to be
home late one evening, you can remotely change your settings to prevent the
heating from turning on until you arrive home.
54
They allow you to adjust your heating very easily, helping to make your home
more comfortable very quickly. Be aware, if you use the control to turn the
heating on more frequently, or to a higher temperature than it usually would
be, you could find you use more energy, and your bills go up.
The additional information they provide about your energy use can help you
to work out the optimum heating for your home, and show you any wasteful
heating habits that might be raising your bills.
55
Module 2
Solar Energy
56
Chapter 1
Introduction to Solar Energy
1.1 Introduction
Solar energy is radiant energy from the sun. It is vital to us because it provides the
world directly or indirectlywith almost all of its energy. In addition to provide the
energy that sustains the world, solar energy is stored in fossil fuels and biomass, and
is responsible for powering the water cycle and producing wind. Every day the sun
radiates, or sends out, an enormous amount of energy. The sun radiates more energy
in one second than people have used since the beginning of time! Solar energy comes
from within the sun itself. Like other stars, the sun is a big ball of gases mostly
hydrogen and helium. The hydrogen atoms in the suns core combine to form helium
and radiant energy in a process called nuclear fusion. Only a small part of the solar
energy that the sun radiates into space ever reaches the earth, but that is more than
enough to supply all our energy needs. Every day enough solar energy reaches the
earth to supply our nations energy needs for a year!
People have harnessed solar energy for centuries. As early as the 7th century B.C.,
people used simple magnifying glasses to concentrate the light of the sun into beams
so hot they could cause wood to catch fire. In the 1860s in France, a scientist named
Auguste Mouchout used heat from a solar collector to make steam to drive a steam
engine. Around the same time in the United States, John Ericsson developed the first
realistic application of solar energy using a solar reflector to drive an engine in a steam
boiler. With coal becoming widely used, neither of these inventions became part of
the mainstream. Early in the 1900s, scientists and engineers began seriously
researching ways to use solar energy. The solar water heater gained popularity during
this time in Florida, California, and the Southwest. The industry was in full swing just
before World War II. This growth lasted until the mid- 1950s, when low-cost, natural
gas became the primary fuel for heating homes and water, and solar heating lost
popularity. The public and world governments remained largely indifferent to the
possibilities of solar energy until the energy crises of the 1970s. Research efforts in the
U.S. and around the world since that time have resulted in tremendous improvements
in solar technologies for heating water and buildings and making electricity.
Solar energy is an alternative to conventional energy technologies, but other forms of
energy can many times seem more practical to use. The most important disadvantage
about solar energy is that the access on a short-term basis can be uncertain. The total
incoming radiation normally doesnt vary much from year to year (typically 5 per
cent), but it is not easy to predict on a day-to-day basis.
57
However, there are more advanced solutions. One area of great interest is windows
with switchable coats. These can control the amount of radiation which is let in or out
through a window. There are several kinds of coatings which can be regulated
electrically, while other types react to temperature or radiation directly. In buildings
with a cooling demand, such active systems for regulating the solar radiation entry,
are often just as important for reducing the demand for cooling as for contributing to
space heating.
1.3 Active Solar Energy
A solar collector gathers solar radiation and converts the energy to heat. In its simplest
form, it can be a surface that is exposed to the sun. The light that is absorbed by the
plate is converted into heat. The plate has channels where water or another heat
transfer medium circulates.
58
The medium is then distributed to the space where heat is needed. There are several
practical designs of this concept. In order for a solar collector to function well, it must
meet three requirements:
The solar collector surface - the absorber should be black to absorb as much
radiation as possible and reflect as little as possible
- The heat in the absorber must be transmitted effectively to the heat transfer
medium. Al or Cu are good heat conductors
- The solar collector must not have too large heat losses. In all but very simple
devices, the sides and back are insulated and a transparent cover is therefore
used.
A solar collector collects solar energy more or less effectively, depending on
construction and the choice of materials. An effective collector with low losses can
deliver heat with a high temperature, but is relatively expensive. One therefore
chooses a solar collector based on the needs that the plant is to meet and the practical
circumstances with regard to the installation. If one only needs moderate
temperatures, an inexpensive model could be adequate.
-
Water is the most common heat transfer medium in solar collectors. Water is
inexpensive and gives good heat transport capacity through small pipes. The
disadvantage with water is that it can freeze, and that water leakage can damage the
building. Adding an antifreeze agent avoids the freezing problem but adds cost and
increases the risk for environmental impact. Air is even cheaper than water, it doesnt
freeze and small leakages dont lead to practical problems. However, air has much
poorer heat transfer properties than water.
Much larger air ducts than the equivalent water pipe is required to transfer heat. Air
heating collectors are therefore more expensive and less effective than water heating
collectors.
For high temperature applications other heat transfer media are used such as oil or
melted salt. Research has also been done on using liquid sodium.
The solar collector is the key component in the solar energy system. It is an important
part of the system cost and sets limits for what the system can deliver. Therefore there
are several types that are adapted to different performance requirements.
The flat plate solar collector is the most common one. It consists of a flat plate where
water runs through channels. Usually, the solar collector is equipped with one or more
glass covers to decrease heat loss. The more one wishes to reduce the losses from a
flat plate solar collector, the more advanced and expensive materials and technologies
must be used.
59
Solar heating is most common in single-family houses and terrace houses, but can also
be used in larger systems, for instance in apartment blocks. Status and trends Active
solar energy in buildings is a technically mature technology, and little research activity
is carried out in the field. However, the technology is commercially immature, and
therefore large efforts are put into making production methods, marketing channels
and installation work more efficient. Increased production volumes are important in
order to bring down costs.
The costs depend on where in the world the system will be used since energy
consumption, solar irradiance and cost structure vary.
In generation, Most of the worlds electricity is produced by steam turbines. Solar
energy can also be used to generate steam for steam turbines. In order to achieve the
high temperatures necessary, more than 350oC, the sunlight must be concentrated.
Systems that concentrate the light more than ten times only see a small part of the
sky.
In practice, they can therefore only concentrate direct sunlight. For that reason, solar
thermal power plants must be located in areas with a lot of clear weather. The optical
systems that concentrate the light must be directed towards the sun all the time.
Therefore, they must be equipped with a device called a tracker allowing them to
follow the suns movement over the sky continuously.
A thermal power plant is a complicated installation, consisting of collector or mirror
field, steam generation system, turbines, cooling systems and a number of auxiliary
systems. However, much of these plants consist of conventional technologies that
show significant economy of scale. Therefore, large solar thermal power plants can
produce electrical power at a lower cost than solar cells. The value chain for thermal
solar power plants is largely the same as the one for conventional power plants and
include, besides solar specific components as mirrors, advanced solar collectors,
buffer storage and related mechanics, standard components such as pipes, heat
exchangers, steam equipment, turbines, control systems, etc. All full-scale plants have
reserve burners to keep the power plant working when incoming radiation is
insufficient.
60
Chapter 2
Photovoltaic (PV) Systems
2.1 Introduction
We now will use the gained knowledge to discuss complete PV systems Photovoltaic
Systems. A PV system contains many different components besides the PV modules.
For successfully planning a PV system it is crucial to understand the function of the
different components and to know their major specifications. Further, it is important
to know the effect on the location of the (expected) performance of a PV system.
2.2 Components of a PV System
Solar cell can convert the energy contained in the solar radiation into electrical energy.
Due to the limited size of the solar cell it only delivers a limited amount of power under
fixed current-voltage conditions that are not practical for most applications. In order
to use solar electricity for practical devices, which require a particular voltage and/or
current for their operation, a number of solar cells have to be connected together to
form a solar panel, also called a PV module. For large-scale generation of solar
electricity solar panels are connected together into a solar array.
Although, the solar panels are the heart of a PV system, many other components are
required for a working system that we already discussed very briefly above. Together,
these components are called the Balance of System (BOS). Which components are
required depends on whether the system is connected to the electricity grid or
whether it is designed as a stand-alone system.
The most important components belonging to the BOS are:
A mounting structure is used to fix the modules and to direct them towards the sun.
Energy storage is a vital part of stand-alone systems because it assures that the
system can deliver electricity during the night and in periods of bad weather. Usually,
batteries are used as energy storage units.
DC-DC converters are used to convert the module output, which will have a variable
voltage depending on the time of the day and the weather conditions, to a fixed
voltage output that e. g. can be used to charge a battery or that is used as input for an
inverter in a grid-connected system.
Inverters or DC-AC converters are used in grid connected systems to convert the DC
electricity originating from the PV modules into AC electricity that can be fed into the
electricity grid.
61
CHAPTER 2 PV SYSTEMS
Cables are used to connect the different components of the PV system with each
other and to the electrical load.
It is important to choose cables of sufficient thickness in order to minimize resistive
losses. Even though not a part of the PV system itself, the electric load, i.e. all the
electric appliances that are connected to it have to be taken into account during the
planning phase. Further, it has to be considered whether the loads are AC or DC loads.
CHAPTER 2 PV SYSTEMS
Figure 2.2: Illustrating (a) a solar cell, (b) a PV module, (c) a Solar panel, and (d) a PV
array
63
CHAPTER 2 PV SYSTEMS
Fig.2.3: Illustrating (a) a series connection of three solar cells and (b) realization of
such a series connection foe cells with a classical front metal grid. (c) Illustrating a
parallel connection of three solar cells. (d) I-V curves of solar cells connected in
series and parallel.
64
CHAPTER 2 PV SYSTEMS
It also may have to feed both AC and DC loads, have reserve power and may even
include a back-up generator. Depending on the system configuration, we can
distinguish three main types of PV systems: stand-alone, grid-connected, and hybrid.
The basic PV system principles and elements remain the same. Systems are adapted
to meet particular requirements by varying the type and quantity of the basic
elements.
2.4.1 Stand-Alone Systems
Stand-alone systems rely on solar power only. These systems can consist of the PV
modules and a load only or they can include batteries for energy storage.
When using batteries charge regulators are included, which switch off the PV modules
when batteries are fully charged, and may switch off the load to prevent the batteries
from being discharged below a certain limit. The batteries must have enough capacity
to store the energy produced during the day to be used at night and during periods of
poor weather. Figure 2.5 shows schematically examples of stand-alone systems; (a) a
simple DC PV system without a battery and (b) a large PV system with both DC and AC
loads.
CHAPTER 2 PV SYSTEMS
In small systems as they are installed in residential homes, the inverter is connected
to the distribution board, from where the PV-generated power is transferred into the
electricity grid or to AC appliances in the house.
These systems do not require batteries, since they are connected to the grid, which
acts as a buffer into that an oversupply of PV electricity is transported while the grid
also supplies the house with electricity in times of insufficient PV power generation.
Large PV fields act as power stations from that all the generated PV electricity is
directly transported to the electricity grid. They can reach peak powers of up to several
hundreds of MWp. Figure 2.7 shows a 25.7 MWp system installed in Germany.
Figure 2.7: The 25.7 MWp Lauingen Energy Park in Bavarian Swabia, Germany [82]
66
CHAPTER 2 PV SYSTEMS
CHAPTER 2 PV SYSTEMS
68
CHAPTER 2 PV SYSTEMS
Figure 2.10: A generic I-V curve and the associated P-V curve. The maximum power
point (MPP) is indicated
69
CHAPTER 2 PV SYSTEMS
70
CHAPTER 2 PV SYSTEMS
71
CHAPTER 2 PV SYSTEMS
CHAPTER 2 PV SYSTEMS
It is the latest approximation of the Vmpp. For any change of the operating point, the
algorithm compares the instantaneous with the incremental conductance values.
If the incremental conductance is larger than the negative of the instantaneous
conductance, the current operating point is to the left of the MPP; consequently, Vref
must be incremented. In contrast, if the incremental conductance is lower than the
negative of the instantaneous conductance, the current operating point is to the left
of the MPP and it is consequently decremented. This process is iterated until the
incremental conductance is the same as the negative instantaneous conductance, in
which case Vref = Vmpp. The incremental conductance algorithm can be more
efficient than the P&O algorithm as it does not meander around the MPP under steady
state conditions. Further, small sampling intervals make it less susceptible to changing
illumination conditions. However, under conditions that are strongly varying and
under partial shading, the incremental conductance method might also become less
efficient. The major drawback of this algorithm is the complexity of its hardware
implementation. Not only currents and voltages must be measured, but also the
instantaneous and incremental conductance must be calculated and compared.
2.6 Advantages and Disadvantages of Solar PV
2.6.1 Advantages of Solar PV
1. PV panels provide clean green energy. During electricity generation with PV
panels there is no harmful greenhouse gas emissions thus solar PV is
environmentally friendly.
2. Solar energy is energy supplied by nature it is thus free and abundant!
3. Solar energy can be made available almost anywhere there is sunlight.
4. Solar energy is especially appropriate for smart energy networks with
distributed power generation DPG is indeed the next generation power
network structure!
5. Solar Panels cost is currently on a fast reducing track and is expected to
continue reducing for the next years consequently solar PV panels has indeed
a highly promising future both for economic viability and environmental
sustainability.
6. Photovoltaic panels, through photoelectric phenomenon, produce electricity
in a direct electricity generation way.
7. Operating and maintenance costs for PV panels are considered to be low,
almost negligible, compared to costs of other renewable energy systems.
73
CHAPTER 2 PV SYSTEMS
As in all renewable energy sources, solar energy has intermittency issues; not
shining at night but also during daytime there may be cloudy or rainy weather.
2.
3.
4.
5.
6.
Solar panels efficiency levels are relatively low (between 14%-25%) compared
to the efficiency levels of other renewable energy systems.
7.
Chapter 3
Concentrated Solar Power
3.1 Introduction
Concentrated solar power (CSP), also referred to as solar thermal power, and
generates electricity by using sunlight to heat a fluid. The heated fluid is then used to
create steam that drives a turbine-generator set. Because CSP systems heat a fluid
prior to generating electricity, thermal energy storage can be readily incorporated into
the design of CSP plants, making them a potential source of dispatch able renewable
power. Furthermore, because the power generation unit in a CSP system is similar to
that of current fossil-fuel thermal power systems (i.e., steam cycle, steam turbine and
generator), CSP technology is well suited for use in hybrid configurations with fossilfuel plants, particularly natural gas combined cycle plants.
3.2 Basics of Concentrated Solar Power
CSP systems employ mirrors to direct and focus solar radiation on a heat transfer fluid.
This fluid, which may be a synthetic oil, molten salt, or steam, is then used to generate
electricity either by direct expansion through a turbine (if the heat transfer fluid is the
same as the fluid passing through the turbine) or via heat transfer to a separate fluid
(often steam or organic vapor), which expands in a turbine and generates electricity.
The two process steps that most affect overall CSP plant efficiency are the solar-toheat step within the solar collector and the heat-to-electricity step in the power
generation block CSP system architectures that focus the solar energy to a point,
rather than on a line, can yield higher working fluid temperatures, and thus have an
inherently higher theoretical efficiency. As discussed later however, their potential for
higher efficiency can come with added system complexity and cost. In practice both
line- and point-focus systems have been deployed depending on the specific technoeconomic requirements of a project.
CSP has a range of characteristics that make it an attractive power generation
pathway. First, like photovoltaic (PV) technology, CSP offers a means of exploiting the
worlds very large and broadly distributed solar resource.
Because CSP involves a solar-to-heat conversion step, it is possible and in fact
relatively straightforward to incorporate high-efficiency thermal energy storage in
the architecture of a CSP plant. This means CSP plants can provide dispatch able
renewable electricity. The third compelling feature of CSP technology is the ease with
which it can be hybridized with other thermal generation options, such as fossil-fuel
combustion, thus providing a flexible power plant that can exploit the solar resource
while also being fully dispatch able at night and during other periods of low solar
insolation Along with its inherently attractive features, however, CPS suffers from
some serious shortcomings. First, CSP systems can only exploit direct solar radiation.
I this contrasts with non-concentrating PV systems that can also exploit diffused
sunlight. As a result, intermittent cloud cover or hazy skies can affect generation from
CSP plants more than generation from PV systems. Adding thermal storage helps
alleviate this issue. However, storage also adds capital and operating costs, which may
or may not be economically justify able.
75
Second, CSP is very sensitive to scale. Specific cally, CSP systems need to be large (tens
of megawatts or larger) to approach their techno-economic optimum in terms of
maximizing efficiency and minimizing costs. This contrasts with PV technology, where
system cost depends on scale but efficiency does not.
The practical result is that developing a commercial CSP plant requires a very large
capital investment and presents financial risks that only a limited set of investors are
capable of taking on. As more CSP deployment occurs, the investment risk profile will
change and a larger pool of investors will emerge. However, this pool will still be much
smaller than that for PV systems, which can be deployed at scales ranging anywhere
from a few kilowatts to hundreds of megawatts.
Combining the large land requirements of CSP plants with the need for this land to be
flat and subject to high levels of direct sunlight restricts the land base suitable for siting
CSP. In the United States the vast majority of CSP-suitable land is located in the
Southwest. Recent studies have concluded that in this region, between 54,000 and
87,000 square miles of land may be suitable for CSP plants.2, 3 Depending on
assumptions about system capacity factories and thermal storage, this land base could
support between 6.8 and 7.4 terawatts (TW) of generation capacity. These are
enormous numbers compared to the nameplate capacity of the entire U.S. electricity
generation fleet, which currently totals 1.15 TW. Of course, it is also worth noting that
54,000 square miles is an area almost exactly the size of the state of New York. The
geographic distribution of CSP-suitable land across the southwestern United States,
as identified by the U.S. Department of Energys National Renewable Energy
Laboratory (NREL).
3.3 Concentrated Solar Power Technologies
Fundamentally, a CSP plant is simply a thermal power plant where solar-derived heat
is converted into electricity subject to thermodynamic efficiency limitations. Since the
temperatures produced by collecting the suns heat in todays CSP designs do not
reach the same levels as the temperatures achieved in modern coal or natural gas
plants, CSPs heat-to-electricity conversion efficiency is lower than that of fossil-fi red
power plants.
Importantly though, this efficiency deficit is not inherent: to the extent that advances
in system design and materials enable CSP systems to achieve higher temperatures,
the efficiency differential compared to fossil-fi red systems could shrink substantially.
The Figure below provides a quantitative illustration of energy flows and losses
through a contemporary CSP system from incident solar radiation to generated
electricity delivered to the grid. In this example, less than half (42%) of the total
incident solar energy is delivered to the boiler as heat as a result of energy losses
associated with the CSP systems mirror array and thermal receiver. Owing to the
thermodynamics of the Rankine cycle, only 40% of this captured thermal energy is
then converted to electricity, meaning that after plant power needs are met, the CSP
plants net electrical energy output represents just 16% of the incident solar energy.
This example provides a clear illustration of the substantial opportunity that exists to
improve overall CSP efficiency.
76
Solar-to-heat conversion losses can be reduced through improved mirror systems and
the design of thermal receivers with lower convective and re-radiative losses, while
designs that allow for higher working fluid temperatures will improve heat-toelectricity efficiency. Whereas the overall efficiency of todays advanced fossil-fuel
generation plants, which use combined cycle gas turbine (CCGT) technology is about
55%, the overall efficiency of the CSP plant in Figure 3.1 is 16%. Note that the steam
turbine portions of both the CCGT and CSP plants are comparable in efficiency.
Fig.3.1: Energy flows and losses through a contemporary CSP system from incident
solar radiation
A thermal solar power plant can be divided into three subsystems consisting of the
collector, the thermal storage and the power cycle. Another important aspect of the
system is the medium that is used to transport heat from the collector field to the
power cycle and the medium used for thermal storage. The different characteristics
and the most common medium used in a typical thermal concentrating solar power
plant will be presented:
3.3.1 Collector
The concentrating device of a thermal solar power plant consists of mirrors, the
collector, focusing the incoming solar irradiation on to a heat -absorbing device, the
receiver. This is done because the solar irradiation per square meter on earth is too
small to heat anything to a desired temperature used in power generating
applications. By concentrating the irradiation from a large area on to a small point high
temperatures can be reached [1]. The arrangement of the mirrors differs depending
on which type of CSP plant configuration that is used.
Most mirror configurations use a tracking system to follow the movement of the sun
in the sky in order to maximize the heat collection throughout the day. This can be
done with either one (east-west direction) or two axes (additionally north-south
direction). Systems using one axis require less investment and maintenance cost at
somewhat lower performance compared to two-axis tracking system.
77
Fig.3.3: Molten salt storage tanks at the Solana Generating Station in Arizona
78
Fig.3.4: basic strategy for longer-term thermal energy storage for CSP technologies
80
81
As already noted, two broad design paradigms exist for CSP systems:
1- line focus and point focus
. As the names suggest, line-focus systems concentrate sunlight on a line,
2- point focus systems
Concentrate light to a point. Because the latter approach is able to achieve higher
working fluid temperatures, point-focus designs can achieve higher efficiencies than
line-focus designs.
82
83
3.4.1.1 Advantages
The parabolic trough design is the most mature CSP technology and has been used in
the United States since the Solar Energy Generating Systems (SEGS) project began
coming on line in 1984. Since that time the design has undergone a great deal of
optimization. As a result, parabolic trough CSP is now considered a commercial
technology. Similar to other solar technologies, parabolic trough technology can be
equipped with a tracking system that rotates the mirrors to track the sun as it moves
across the sky every day. Alternatively, the parabolic troughs can be adjusted
seasonally this avoids the high cost of adding tracking capability but results in lower
overall efficiency.
3.4.1.2 Disadvantages and Design Limitations
Although it is now a relatively mature technology, parabolic trough CSP has significant
drawbacks. The main drawback is high capital cost due to the need for many rows of
mirror and collector units to increase the temperature of the heat transfer fluid. Also,
parabolic trough systems suffer from problems with convective heat loss and reradiation, as well as mechanical strain and leakage at moving joints. Some of the
operating SEGS plants have experienced these mechanical problems, though they
have been resolved with operating experience. Similar operating challenges will no
doubt occur in new designs and new operating regimes. Finally, the heat transfer fluid
operates at relatively low temperatures (400C or less), leading to low overall
thermodynamic efficiency.
84
Fig.3.9: The solar power plant 'Gemasolar' situated near Seville in Spain
85
3.4.2.1 Advantages
Because solar towers can utilize a hotter working fluid than troughs, they offer a path
to higher efficiency. Additionally, as towers utilize a lower heat transfer surface area,
convective losses can be reduced. Finally, , higher operating temperatures in the solar
tower make it possible to add thermal storage more efficiently because the size
(volume) of thermal storage required is smaller. This reduces both the cost and the
heat losses of the storage system.
86
87
88
89
90
91
Direct
Closed Loop (aka Indirect)
Drainback
The next figure focuses on active systems (closed loop) as most collectors will be
installed in this format.
92
Design Details
The liquid circulated through the collector is separate from the water in the
main hot water system
The liquid can be plain water, or a glycol-water mix for areas that need freeze
protection.
The heat transfer between the closed loop and main system water is achieved
via a heat exchanger, either internal coil inside the storage tank, or external
heat exchanger.
Advantages
93
Disadvantages
Not as efficient as direct flow system, due to the need to use a heat exchanger
In cold regions, anti-freeze liquid must be inspected and changed periodically
(every 2-5 years). Warm regions can just use water.
System cost is higher due to need for:
Heat transfer fluid (normally propylene glycol based anti-freeze)
More complex pump station (fill & drain valves, pressure relief valve, air
separator etc.)
94
Evacuated tube solar collectors, as depicted in Figure 3.19 below, have an absorber
with a selective coating enclosed in a sealed glass vacuum tube. They are good at
capturing the energy from the sun; their thermal losses to the environment are
extremely low. Systems presently on the market use a sealed heat-pipe on each tube
to extract heat from the absorber (a liquid is vaporized while in contact with the heated
absorber, heat is recovered at the top of the tube while the vapour condenses, and
condensate Returns by gravity to the absorber).
95
96
97
98
R = thermal resistance
R is measured by two laws depend on heat transfer way
heat transfer by two ways: 1- conduction R= L/kA
2- convection R= 1/hA
k: - Thermal conductivity in conduction
h: - Thermal conductivity in convection
3.7 Simulation of Design a parabolic trough solar power system
Design a parabolic trough solar power system to make steam to power a 1MW
steam turbine.
First we estimate the mass flow rate of steam
Second we estimate the flow rate of oil:
Third we estimate the main required (the number of solar troughs)
Siemens steam turbine SST-060 (up to 6 MW)
Inlet pressure [1]:
kJ
s
101
Module 3
Wind Energy
102
Chapter 1
Wind Turbines Systems
1.1. Introduction
Wind is simple air in motion. The uneven heating of the earths surface causes it by the sun.
Since the earth's surface is made of very different types of land and water, it absorbs the sun's
heat at different rates. During the day, the air above the land heats up more quickly than the
air over water. The warm air over the land expands and rises, and the heavier, cooler air rushes
in to take its place, creating winds. At night, the winds are reversed because the air cools more
rapidly over land than over water.
Today, wind energy is mainly used to generate electricity. Wind is called a renewable energy
source because the wind will blow as long as the sun shines.
103
American colonists used windmills to grind wheat and corn, to pump water, and to cut wood
at sawmills. As late as the 1920s, Americans used small windmills to generate electricity in
rural areas without electric service. When power lines began to transport electricity to rural
areas in the 1930s, local windmills were used less and less, though they can still be seen on
some Western ranches.
Wind turbines convert the kinetic energy in the wind into mechanical power. This mechanical
power can be used for specific tasks (such as grinding grain or pumping water) or a generator
can convert this mechanical power into electricity. So how do wind turbines make electricity?
Simply stated, a wind turbine works the opposite of a fan. Instead of using electricity to make
wind, like a fan, wind turbines use wind to make electricity. The wind turns the blades, which
spin a shaft, which connects to a generator and makes electricity.
104
During the modern era the wind energy has been utilized mainly to generate electricity
through the use of wind turbines, where the wind rust through the blades of wind turbine
causing a lifting force (similar to the force that is produced on both ends of plane wings) this
force leads to rotate the blades which in turn are linked to o rotation axis, and it Is in turn Is
linked (with or without a gearbox) to electric generator that works on electricity generation.
The technology of wind turbines in the sea has evolved a lot over the post period as it is
considered a significant contributor in securing our energy needs.
Wind generators need clean and sufficiently fast wind to produce electricity. Clean wind is
strong and laminar, which means it flows in smooth streamlines and is not disrupted by nearby
obstacles.
Coastal locations, and flat rural areas without significant vegetation or buildings, offer the most
laminar wind flow. Small wind systems should generally be installed only in these areas.
Significant turbulence is caused by terrain such as steep hills and cliffs as well as ground clutter
such as trees and nearby buildings or structures.
Urban areas have a poor wind resource that is usually extremely turbulent. Productive wind
power systems place the wind generator on tall towers in clean wind, well above areas of
turbulence caused by obstructions usually impossible in urban areas.
some European countries such as Denmark, Germany and Britain has Introduced this
technology as a major contributor in their electrical networks, and many of the largest
companies in the world participate and compete strongly in this industry.
105
If the site seems suitable, quantify the wind resource, usually with the help of a wind site
assessor or installer, to estimate how much energy a wind turbine will produce at this site.
The wind varies with the seasons, and many locations have stronger winds in winter. Many
coastal regions often have sea breezes as their prevailing winds in summer.
Determining the average annual wind speed (typically measured in meters/second) at the
site may be challenging, although several state government programs are developing tools
to help estimate wind resources. When estimating the output of a wind system at your site,
wind site assessors or installers should use:
Multiple wind speed data sources (e.g. wind maps or modeling, automatic weather stations,
nearby monitoring sites) to generate a robust understanding of wind patterns at the site.
Topography maps and a site visit to estimate wind shear (the rate at which the wind speed
changes with increasing height from the ground).
The proximity of trees, buildings and other obstacles to estimate turbulence intensity.
The power curve of the wind system, obtained from the manufacturer, which shows the
expected power output of the turbine in any given wind speed.
106
Off-grid small wind systems usually require a minimum average annual wind speed of at
least 45m/s to be cost effective; for grid connected systems the annual average should be
greater than 6m/s.
Automatic weather stations typically monitor wind speeds at 10m above ground level;
wind models typically estimate wind speeds at heights of 5080m. Note the height at
which annual wind speed data is sourced, because if it is not exactly the same as the height
of the tower, the wind site assessor must estimate the wind speed at the tower height.
For example, a site with 5m/s average annual wind speed at a height of 30m may only have
3m/s average wind speed at a height of 12m. In this case, a wind system placed on a 12m
tower produces negligible electricity; the same system on a 30m tower produces at least
ten times more electricity.
This turbine produces around 5,000kWh/year with an average annual wind speed of 4m/s or
around 15,000kWh/year at 6m/s. taller towers and good siting allows wind systems to access
faster wind speeds.
107
Manufacturers should state the cut-in wind speed of the turbine, the speed at which the
wind generator begins to turn and generate power. In areas with frequent light winds, a low
cut-in speed is important for maximum output. Prioritize sites on elevated, open land where
winds are unimpeded by trees and buildings. That is where wind turbines generate the most
energy.
Sites on elevated, open land where winds are unimpeded by trees and buildings should be
prioritized, as this is where wind turbines generate the most energy. Site turbines away from
turbulent winds caused by any obstacles, if possible. In cases where wind systems can not be
sited away from obstacles, an appropriately tall tower is critical.
108
1.2.3 Features wind turbines are placed in the sea for land-based turbines
1 - Low Voice Noise Ratio: The wind turbines through its work, they send annoying voice,
which has led to cause problems for people who live in the vicinity of the wind station, so
that some farmers complain that their animals are affected by noise of the wind turbine
blades, so the existence of wind turbines in the sea softens the impact of this problem,
whether for human or animals that live in the surrounding areas.
2- It does not pose a threat to the lives of migratory birds: wind turbines located on dry land
often cause the death of many birds that clashes with Its animated blades, despite the fact
that some countries that rely on wind power are working on avoiding that problem by not
establishing wind stations in the way of birds migration, wind turbines that are positioned
at sea ends the problem as the birds often fly over the ocean.
3- Wind turbines have no large visual impact where it is located far from accommodation; so
they do not affect the general view. The only negative point for wind turbines in sea than
those on land is The cost: where this negative point is considered the biggest, where it is
possible that the cost of generated power increase from these turbines around (2.5 to 3.5
times) than those found on land, but in any case still wind turbines at sea is on under
development industry and the high cost will decrease with time, and this high cost because
of the difficult working conditions for the
109
installation and maintenance of turbines in the sea, which require the use of private vessels to
be installed in the sea.
110
They typically use more than one technology to generate electricity, such as wind and solar
photovoltaic combined, to take full advantage of seasonal and daily variations in wind and
solar resources.
1.3.2 Grid Connected Wind Turbines
To connect the output of the wind turbine to the utility grid, it must have the same voltage
level, frequency & phase shift angle. So, some auxiliary systems are used to maintain this level
accurately
Freestanding
Crane
Guyed lattice
Installed on ground,
lifted with crane
Tilt-up
Installed on ground,
lifted with crane
Base
710% of tower
height for concrete
foundation
Maintenance
Climb
Climb
Lower turbine
twice/year
Cost
Expensive
Least expensive
Mid-range cost
111
Fig.1.6: Tilt-up, fixed and freestanding towers have different footprints on the ground.
112
tower heights
Wind speed increases, and turbulence decreases, with height. Below the height of 20m the
friction between wind and earth slows the wind speed significantly. This zone is also often very
turbulent. Install the wind generator on the highest tower that is practicable and cost effective
for the site.
Towers of at least 24m height are appropriate in areas where the land is flat or elevated and
there are no obstacles within 150m. The tower should also be at least 300m away from any
steep bluffs or sharp changes in elevation. Place the turbine in the area of smooth laminar air.
The diagram illustrates how to test for smooth laminar air using a balloon, tag lines and a tether
line. Install the highest possible tower for the site.
113
114
Benefits from placing wind turbines in deep water go back to two factors:
- Wind at sea is stronger than that al the beach.
- Projects in this case will be far from the shore line, and would not have any auditory Impact
or visual pollution on anyone and thus reduce opposition from establishing them. Of course,
the very high cost for this kind of projects is one of the most important challenges facing the
use of wind turbines in deep water.
115
116
117
Points
HAWTs
VAWTs
Source of producing
Large
Large
electricity
Yes
Yes
Fanatical feasibility
High
Low
Operating speed
From 1kw to 6
Less than 50 kw
Megawatts
Maintenance
Relatively hard
Easy
Size
Commercial
Non-commercial (small
applications)
Positioning
118
119
120
Synchronous generator
1- Wound rotor generator (WRSG)
121
122
Points
Excitation
Induction
Synchronous
SCIG
WRIG
OSIG
DFIG
WRSG
PMSG
Not self-
Not self-
Not self-
Can be
Self-excited
Self-excited
excited
excited
excited
selfexcited
Price
Cheap
Expensive
Cheap
Cheap
Expensive
Expensive
Simple
Complicated
Complicated
related to
SCIG
Mechanical Simple
Simple but
Simple
design
not robust
and
robust
robust
Use of
Must use
Must use
Must use
Must
Gear box is
gearbox
gearbox
gearbox
gearbox
use
not essential
essential
Wide
Restricted
Restricted
High
Moderate
High
gearbox
Speed
Restricted
Restricted
Wide but
range
restricted
operation
0-10%
Efficiency
Moderate
High
Moderate
Table 1.4: Comparison between types of synchronous and types of induction generator
123
124
125
The insulated gate bipolar transistors (IGBTs) are used as the power switches. Although
recent developments have make the IGBT with higher-voltage blocking capability closer to
the integrated gate-commutated thyristor (IGCT), the IGBT based two-level back-to-back
VSCs are applied mainly in the low-voltage, low or medium power drive industries. As
introduced in to increase the voltage level, as well as the power level of the conventional
two-level back-to-back VSCs, series-connected power switches can be applied. Based on this
topology of power switches connection, the series connected IGBTs distribute the voltage
and power stress on the single IGBT in the conventional two-level VSCs, which improves the
voltage and power level of the two-level VSCs. With the application of the series-connected
IGBT two-level high power inverters, the multi-pulse rectifiers become attractive selections
for the high power back-to-back VSCs. These types of rectifiers help in reducing the input
current harmonics, which is beneficial for the generators in wind turbine systems. Although
the series-connected IGBT VSC has greatly improved the voltage and power level of the twolevel VSC, it contributes nothing to reduce the dv/dt (the voltage change, dv, within the time
interval, dt, or to improve the power quality. Based on this concern, the multilevel converters
were investigated and commercialized. Among various types of multilevel converters, the
neutral-point clamped (NPC) converters, cascaded H-bridge (CHB) converters, flying
capacitor converters, and Active NPC converters are the most studied ones. Here, the
research on NPC and CHB converters which are the most widely applied types of multilevel
converters will be reviewed.
126
127
128
Chapter 2
Doubly-fed Induction Generator (DFIG) system
2.1. Introduction
This chapter introduces the operation and control of a Doubly-fed Induction Generator (DFIG)
system. The DFIG is currently the system of choice for multi-MW wind turbines.
The aerodynamic system must be capable of operating over a wide wind speed range in order
to achieve optimum aerodynamic efficiency by tracking the optimum tip-speed ratio.
Therefore, the generators rotor must be able to operate at a variable rotational speed. The
DFIG system therefore operates in both sub- and super-synchronous modes with a rotor speed
range around the synchronous speed. The stator circuit is directly connected to the grid while
the rotor winding is connected via slip-rings to a three-phase converter. For variable-speed
systems where the speed range requirements are small, for example 30% of synchronous
speed, the DFIG offers adequate performance and is sufficient for the speed range required to
exploit typical wind resources.
An AC-DC-AC converter is included in the induction generator rotor circuit. The power
electronic converters need only be rated to handle a fraction of the total power the rotor
power typically about 30% nominal generator power. Therefore, the losses in the power
electronic converter can be reduced, compared to a system where the converter has to handle
the entire power, and the system cost is lower due to the partially-rated power electronics.
This chapter will introduce the basic features and normal operation of DFIG systems for wind
power applications basing the description on the standard induction generator. Different
aspects that will be described include their variable-speed feature, power converters and their
associated control systems, and application issues.
2.2. Steady-state operation of the Doubly-Fed Induction Generator (DFIG)
The DFIG is an induction machine with a wound rotor where the rotor and stator are both
connected to electrical sources, hence the term doubly-fed. The rotor has three phase
windings which are energized with three-phase currents. These rotor currents establish the
rotor magnetic field. The rotor magnetic field interacts with the stator magnetic field to
develop torque. The magnitude of the torque depends on the strength of the two fields (the
stator field and the rotor field) and the angular displacement between the two fields.
Mathematically, the torque is the vector product of the stator and rotor fields. Conceptually,
the torque is developed by magnetic attraction between magnet poles of opposite polarity
where, in this case, each of the rotor and stator magnetic fields establish a pair of magnet 260
poles, Fig.2.1 Clearly, optimum torque is developed when the two vectors are normal to each
other. If thestator winding is fed from a 3-phase balanced source the stator flux will have a
constant magnitude and will rotate at the synchronous speed. We will use the per-phase
equivalent circuit of the induction machine to lay the foundations for the discussion of torque
control in the DFIG.
129
The equivalent circuit of the induction machine is shown in Fig.2.2 the stator side has two
parasitic components, Rs and Ls, which represent the resistance of the stator phase winding
and the leakage inductance of the phase winding respectively. The leakage inductance models
all the flux generated by current in the stator windings that does not cross the air-gap of the
machine, it is therefore not useful for the production of torque. The stator resistance is a
natural consequence of the windings being fabricated from materials that are good conductors
but nonetheless have finite conductance (hence resistance).
The magnetizing branch, Lm, models the generation of useful flux in the machine flux that
crosses the air-gap either from stator to rotor or vice-versa.
Fig. 2.1: Magnetic pole system generated by currents in the stator and rotor windings. The
stator and the rotor field generate a torque that tends to try and align poles of opposite
polarity.
In this case, of rotor experiences a clockwise torque.
130
Like the stator circuit, the rotor circuit also has two parasitic elements. The rotor leakage
reactance, Lr, and the rotor resistance Rr. In addition, the rotor circuit models the generated
mechanical power by including an additional rotor resistance component, Rr(1s)/s. Note that
the rotor and stator circuits are linked via a transformer whose turns ratio depends on the
actual
turns ratio between the stator and rotor (1:k), and also the slip, s, of the machine.
In an induction machine the slip is defined as
Where ns and nr are the synchronous speed and the mechanical speed of the rotor
respectively.
The synchronous speed is given by
Where p = number of pole pairs and fe is the electrical frequency of the applied stator
voltage. We will first consider the operation of the machine as a standard induction motor. If
the rotor circuit is left open circuit and the rotor locked (standstill), when stator excitation is
applied, a voltage will be generated at the output terminals of the rotor circuit, V r. The
frequency of this output will be at the applied stator frequency as slip in this case is 1. If the
rotor is turned progressively faster and faster in the sub-synchronous mode, the frequency at
the output terminals of the rotor will decrease as the rotor accelerates towards the
synchronous speed. At synchronous speed the rotor frequency will be zero. As the rotor
accelerates beyond synchronous speed (the super-synchronous mode) the frequency of the
rotor voltage begins to increase again, but has the opposite phase sequence to the subsynchronous mode. Hence, the frequency of the rotor voltage is
No rotor currents can flow with the rotor open circuit, hence there is no torque production
as there is no rotor field r, Fig 2.1 If the rotor was short circuited externally, rotor currents
can flow, and they will flow at the frequency given by (3). The rotor currents produce a rotor
magnetic field, r, which rotates at the same mechanical speed as the stator field, s. The
two fields interact to produce torque, Fig. 2.1
It is important to recognize that the rotor magnetic field and the stator magnetic field both
rotate at the synchronous speed. The rotor may be turning asynchronously, but the rotor
field rotates at the same speed as the stator field.
The mechanical torque generated by the machine is found by calculating the power absorbed
(or generated) by the rotor resistance component Rr(1s)/s. This is shown to be
131
In an ideal induction machine, we can ignore the rotor and stator phase winding resistance
and leakage inductance. The per-phase equivalent circuit then becomes simple, Fig. 2.3 The
phasor diagram for the machine is shown. Note that the stator generated flux component is
normal to the rotor current (hence rotor flux) phasor giving the optimum conditions for
Fig. 2.3: Simplified equivalent circuit of the induction machine assuming low values of slip
and negligible stator and rotor leakage reactance. Phasor diagram demonstrates optimal
orientation of magnetizing current and rotor current.
Torque production (note this is true for low values of slip only). Using this simplified circuit
diagram, the mechanical torque production is then:
The key point in this development is to show that the developed torque is controlled by the
combination of the stator generated flux, m, and the rotor current magnitude, ir, if the two
vectors are maintained in quadrature, Fig. 2.1. In the DFIG system, torque is controlled by
calculating the physical position and magnitude of the stator generated flux (by monitoring
the position and magnitude of the applied stator voltage which in this case is imposed by the
grid voltage magnitude, frequency and phase) and regulating the rotor currents such that
they are normal to the stator flux with a magnitude that will generate the desired torque.
132
The DFIG system therefore has to control the magnitude, frequency and phase of the applied
rotor current. Most DFIG systems utilize closed-loop current control using a voltage-source
inverter (VSI). At this stage, the voltage source inverter can be viewed as a three-phase voltage
source whose magnitude and phase can be altered instantaneously this will be illustrated in
Section 2. Therefore, the VSI can be used to regulate the rotor current. In order to properly
position the rotor current knowledge of the physical position of the rotor is required using a
mechanical position sensor, for example. In such a way, the rotor current (hence flux) can be
oriented optimally with respect to the stator flux to generate the desired torque.
Fig. 2.4: Typical back-to-back arrangement of inverter and converter circuits to control power
flow.
133
The VSI is capable of generating any voltage with arbitrary frequency and phase (within the
limits of dc link voltage and switching frequency). Therefore, the VSI can be viewed and
modelled as an ideal controllable voltage source whose bandwidth is usually much higher than
the required excitation frequency required by the system.
For example, Fig. 2.5 shows a single line diagram of a grid-connected inverter. In this case the
inverter is simply modelled as an ideal voltage source that is generating a balanced set of threephase voltages whose magnitude and phase can be controlled relative to the grid voltage. This
provides the capability to control the flow of real and reactive power to the grid as will be
discussed later. Note that synchronization to the grid frequency is assumed.
In steady-state at fixed turbine speed for a lossless DFIG system, the mechanical power from
the wind turbine applied to the shaft is Pm = Ps + Pr. It follows that:
Therefore if the maximum slip is limited, say to 0.3, the rotor winding converters can be rated
as a fraction of the induction generator rated power. This is typically around 30% for DFIG in
wind power generation systems gives a slip range of 0.3. This is one key advantage of the
DFIG system over fully-rated power electronic systems. From the above relationships, the
stator and rotor power are Ps = Pm/(1s) and Pr = sPm/(1 s), respectively. To consider the
mechanical power change during different rotor speeds, the following analysis is carried out
with all terms in per unit values. The slip is assumed to vary from a sub-synchronous value of
+0.35 to a super synchronous value of -0.35.
134
Here we use the example wind turbine model in MATLAB (The Mathworks Inc., 2013):
The maximum value of Cp is 0.48 when = 0 for = 8.1. These are defined as base values for
per unit calculations. Here base wind speed is 12 m/s, gear ratio is 10, rotor radius is 5.16m.
When s = 0.2, Cp is 0.48 then Pm is 1.0 p.u. ideally. Hence for 2 pole-pair generator,
The above analysis is carried out in MATLAB programming, with the power flow results shown
in Fig.2.6 shows how the rotor and stator power vary as the rotor slip changes from sub- to
super-synchronous modes. The speed of the rotor has to change as wind speed changes in
order to track the maximum power point of the aerodynamic system. Slip, s, therefore is
related to incident wind speed. In this case, a slip of -0.2 occurs with rated wind speed (12 ms1). As wind speed drops, slip has to increase and in this case has a maximum value of 0.35.
135
136
The rotor-side converter uses a torque controller to regulate the wind turbine output power
and the voltage (or reactive power) measured at the machine stator terminals.
The power is controlled in order to follow a pre-defined turbine power-speed characteristic to
track the maximum power point. The actual electrical output power from the generator
terminals, added to the total power losses (mechanical and electrical) is compared with the
reference power obtained from the wind turbine characteristic. Usually, a ProportionalIntegral (PI) regulator is used at the outer control loop to reduce the power error (or rotor
speed error) to zero. The output of this regulator is the reference rotor current i rqref that must
be injected in the rotor winding by rotor-side converter. This q-axis component controls the
electromagnetic torque Te. The actual irq component of rotor current is compared with irqref
and the error is reduced to zero by a current PI regulator at the inner control loop. The output
of this current controller is the voltage vrq generated by the rotor-side converter. With another
similarly regulated ird and vrd component the required 3-phase voltages applied to the rotor
winding are obtained. The generic power control loop is illustrated in the next section.
2.3.3 The Grid-Side Converter (GSC)
The grid-side converter aims to regulate the voltage of the dc bus capacitor. Moreover, it is
allowed to generate or absorb reactive power for voltage support requirements. The function
is realized with two control loops as well: an outer regulation loop consisting of a dc voltage
regulator. The output of the dc voltage regulator is the reference current icdref for the current
regulator. The inner current regulation loop consists of a current regulator controlling the
magnitude and phase of the voltage generated by converter from the icdref produced by the dc
voltage regulator and specified q-axis icqref reference.
2.3.4 Converter losses
The losses of the converters can be divided into switching losses and conducting losses.
The switching losses of the transistors are the turn-on and turn-off losses. For the diode the
switching losses mainly consist of turn-off losses, i.e., reverse-recovery energy. The turn-on
and turn-off losses for the transistor and the reverse-recovery energy loss for a diode can be
found from data sheets. The conducting losses arise from the current through the transistors
and diodes. The transistor and the diode can be modeled as constant voltage drops, and a
resistance in series. The switching losses of the transistor can be considered to be
proportional to the current, for a given dc-link voltage. For a given dc-link voltage and
switching frequency, the switching losses of the IGBT and diode can be modeled as a
constant voltage drop that is independent of the current rating of the valves (Petersson,
2005).
2.3.5 DC-link model
The dc-link model describes the dc-link capacitor voltage variations as a function of the input
power to the dc-link (Ledesma & Usaola, 2005).
137
Where C is the capacitance, Vdc is the voltage, Wdc is the stored energy, and Pdc is the input
power to the dc link. The voltage and energy derivatives are
The Pdc is calculated as Pdc = Pin Pc. Where Pin is the input power from rotor-side converter
and Pc is the grid-side converter output power. The dc-link voltage varies as Pdc and is a
constant when Pdc = 0.
2.3.6 Basic Control of Real and Reactive Power using the RSC
The grid side converter is used to partly control the flow of real and reactive power from the
turbine system to the grid. The grid-side converter feeds the grid via a set of interfacing
inductors. Fig.2.7(a) shows the single phase equivalent circuit of the system. As previously
shown, the grid-side converter (a voltage source inverter) can generate a balanced set of
three-phase voltages at the supply frequency and that the voltage, E, can have a controllable
magnitude and phase. Load angle control is used to illustrate the basics of real and reactive
power control, though in practice, a more sophisticated control is used which provides
superior transient response. Load angle control mimics the operation of a synchronous
generator connected to the network. Essentially, load angle control uses the angle, , between
the voltage generated by the grid-side converter, E, and the grid voltage, V, Figure 7(b), to
control the real power, P, injected on to the grid. Likewise, reactive power, Q, is controlled
using the magnitude of the voltage generated by the grid-side converter. The steady-state
equations governing the real and reactive power flow from the grid-side converter to the grid
are
Where Xs is the reactance of the interfacing inductance. If is small the equations can be
simplified to
Showing that P can be controlled using load angle, , and Q can be controlled using the
magnitude of E. Interfacing inductance must be used to couple the output of the grid-side
converter shown in Figure 8 to the grid. The inductor is sized according to the rating of the
converter. Typically, the system will have a transformer on the turbine side of the point of
common coupling (PCC)
138
In addition, at the point of connection there is usually the need for a substation which includes
whatever equipment is required by local network codes, for example, plant to disconnect the
turbine under fault conditions.
The combination of control and power electronics enables the grid-side converter to produce
the necessary voltage magnitude, E, and load angle, , in order to meet a required Pc and Qc
demand set by the main system controller. The controller has to be able to synchronize to the
grid frequency and phase, in order to connect and supply power. This is typically carried out
using some form of phase-locked loop.
Fig. 2.7: (a) Single line diagram of steady-state generator-side converter connected to the
grid and (b) phasor diagram demonstrating load angle control of the grid-side converter to
establish exported real power and control of reactive power
At any instant, the power exported by the GSC is determined by the state of the DC link voltage.
The grid-side converter controller monitors the DC link voltage. If the DC link voltage rises, the
grid-side converter can export more real power by increasing the load angle in order that the
DC link voltage moves back towards it nominal value. If more power is being exported by the
GSC than is currently being generated by the RSC, the DC link voltage will fall below its nominal
value. The grid-side controller will then reduce the exported real power to allow the DC link
voltage to recover to its nominal value. In essence, the DC link voltage indicates power flow
balance between the generated energy and the exported energy in the rotor side. If the input
and output power to the dc link capacitor do not match then the dc link voltage will change.
The quality of the energy supplied to the network must meet basic requirements and the Grid
Code in force at the connection point will set these. The grid code specifies many performance
indicators of the quality of the energy supplied by the grid-side converter, along with other
important issues such as fault levels, anti-islanding and disconnection.
139
The relevant grid code(s) in operation must be determined prior to tendering for work on the
turbine power electronics and control. The grid code has important implications on the control
system of the turbine. One main concern in many turbine systems is what to do if the turbine
system loses its mains connection, say, for example, because of a network fault. Without a
mains connection the turbine is unable to export energy. If the generator-side controller
continues to generate power, the DC link capacitance will be over charged. Therefore, a grid
fault will require the generator to stop generating energy, which then means that there is no
longer a restraining torque to control the blade speed. In a wind turbine, a loss of supply will
cause an over speed condition, as the blade system will accelerate due to the aerodynamic
torque produced by the blades. Shorting resistors, or a crowbar circuit, are often switched
across the rotor circuit of the generator in order that the energy generated by the blade system
can be absorbed and the over-speed condition controlled to a safe and manageable level. in
addition, there are often aerodynamic (pitch control) and mechanical braking mechanisms
included in wind turbines as an additional over-speed safety measure.
Rs, Rr
Lm
Magnetizing inductance.
s, r, slip
P, Q
s, r
d, q
ref
140
This section will detail the vector-control techniques used for the independent control of
torque and rotor excitation current in the DFIG and decouple control of the active and reactive
power supplied to the grid. The vector control for the generator can be embedded in an
optimal power tracking controller for maximum energy capture in a wind power application.
By controlling the active power of the converter, it is possible to vary the rotational speed of
the generator, and thus the speed of the rotor of the wind turbine. This can then be used to
track the optimum tip-speed ratio as the incident wind speed changes thereby extracting the
maximum power from the incident wind. The grid-side converter control gives potential for
optimizing the grid integration with respect to steady-state operation conditions, power
quality and voltage stability.
2.4.1 Rotor-side converter control
The rotor-side converter (RSC) provides the excitation for the induction machine rotor. With
this PWM converter it is possible to control the torque hence the speed of the DFIG and also
the power factor at the stator terminals. The rotor-side converter provides a varying excitation
frequency depending on the wind speed conditions. The induction machine is controlled in a
synchronously rotating dq-axis frame, with the d-axis oriented along the stator-flux vector
position in one common implementation.
This is called stator-flux orientation (SFO) vector control. In this way, a decoupled control
between the electrical torque and the rotor excitation current is obtained. Consequently, the
active power and reactive power are controlled independently from each other.
There are other options for directional rotating frames. Orientation frames applied in
traditional vector control of induction machines such as rotor-flux orientation and
magnetizing-flux orientation, can also be utilized (Vas, 1990). Additionally, the orientation
(SVO) is also commonly-used in DFIG vector controller, as contrast with SFO (Muller et al.,
2002). To describe the control scheme, the general Parks model of an induction machine is
introduced. Using the motor convention in a static stator-oriented reference frame, without
saturation, the voltage vector equations are
Where
is the stator voltage imposed by the grid. The rotor voltage
is controlled by the
rotor-side converter and used to perform generator control.
The flux vector equations are
141
Where Ls and Lr are the stator and rotor self-inductances: Ls = Lm + Lls, Lr = Lm + Llr
Under stator-flux orientation (SFO), in dq-axis component form, the stator flux equations are:
142
The control system requires the measurement of the stator and rotor currents, stator voltage
and the mechanical rotor position. There is no need to know the rotor-induced EMF, as is the
case for the implementation with naturally commutated converters. Since the stator is
connected to the grid, and the influence of the stator resistance is small, the stator magnetizing
current ims can be considered constant (Pena et al., 1996).
Rotor excitation current control is realized by controlling rotor voltage. The i rd and irq error
signals are processed by associated PI controllers to give vrd and vrq, respectively.
To ensure good tracking of the rotor dq-axis currents, compensation terms are added to vrd
and vrq to obtain the reference voltages vrd* and vrq* according to
143
For the stator-voltage oriented control the above equation is an approximation. However, for
stator-flux orientation, the stator flux current ims is almost fixed to the stator voltage. For
torque mode control, since it is difficult to measure the torque, it is often realized in an openloop manner. The torque can be controlled by the q-axis component of the rotor current
irq. Therefore, the q-axis reference current, irqref can be determined from the reference torque
Teref as
Also
144
Which demonstrates that the real and active powers from the grid-side converter are
controlled by the icd and icq components of current respectively.
To realize decoupled control, similar compensations are introduced likewise in previous
control to obtain the reference voltages vrd* and vrq*
The reference voltage vcd* and vcq* are then transformed by inverse-Park transformation to
give 3-phase voltage vcabc* for the final PWM signal generation for the converter IGBT
switching
145
The turbine blade is characterized by particular Cp - curves, and from these the Tm - r
characteristics may be derived for various values of wind velocity v.
Where r , is the shaft speed referred to the generator side of the gearbox. For wind velocities
higher than rated, the turbine energy capture must be limited by applying pitch control or
driving the machine to the stall point. For wind velocities below rated, the machine follows the
previous equation. There are two methods of achieving this which are termed current-mode
control or speed-mode control.
2.4.4 Current-mode control
This mode may be considered to be standard tracking mode. Given a shaft-speed
measurement, an electrical torque can be imposed on the DFIG according to previous
equation after compensating for the transmission friction losses:
146
improved tracking may be obtained over the current-control method above. Given a Tm signal,
then the DFIG can be driven to the optimum power curve by
147
Fig. 2.10 DFIG rotor equivalent circuit with all protection schemes shown.
148
Chapter 3
Permanent Magnet Synchronous Generator (PMSG) system
3.1- Modelling and Analysis of Direct-Drive Permanent Magnet Synchronous Generator
Wind Turbine Systems
The main components of a direct-drive permanent magnet synchronous generator (PMSG)
wind turbine are the wind turbine and the PMSG. The wind turbine captures the power from
the wind for the system, and the PMSG transforms the mechanical power into electric power.
In this section, the basic principles of the electric power generation will be introduced, and the
mathematical models of the wind turbine and the PMSG will be developed and analyzed.
3.1.1 Modelling of Wind Turbines
In order to investigate the effectiveness of the energy conversion in wind energy conversion
systems, first the available energy stored in the wind needs to be determined. Actually, the
energy in the wind can be treated as the kinetic energy of a large amount of air particles with
a total mass, , moving at a wind velocity, . Assuming that all the air particles are moving
at the same speed and direction before affecting the rotor blades of the wind turbine, the
potential available kinetic energy stored in the wind can be expressed according to the
following expression:
1
E = 2 mVW 2
(3.1)
Where, E , is the kinetic energy of the moving air particles, and m the total mass of the air
particles, while, VW , is the velocity of the air particles (wind speed). Since the air particles are
moving at a speed, VW , the total mass, m ,of the particles for a period of time, t, can be
rewritten as follows:
E = = 2
(3.2)
Where, ,is the air density, and A is the swept area of the wind turbine rotor. Here, r,is
the radius of the wind turbine rotor. Substituting expression (3.2) into (3.1), the kinetic
energy of the air particles can be expressed as follows:
1
E = 2 r 2 VW 3 t
(3.3)
From expression (1.3), the actual wind power at any instant of time can be represented as:
Pwind =
E
t
= 2 r 2 VW 3
(3.4)
Where, Pwind ,is the potentially available power in the wind. From expression (3.4), we can
observe that the wind power is proportional to the cube of the wind speed, which means
that a small increase of the wind speed will result in a large increase of the wind power.
149
Moreover, the power can also be increased by enlarging the wind turbine rotor radius since
the power is proportional to the square of this rotor radius. This is the reason that more and
more large scale wind turbine systems (up to 10MW) are being investigated and contemplated
nowadays. However, the power expressed in expression (3.4) can only stand for the maximum
potential power which is available when the wind with velocity, VW , passes through the swept
area of the wind turbine with radius, . In fact, only a portion of this potentially available power
can be captured by the wind turbine. In 1919, a German scientist Albert Betz had tried to
express the action of the air particles (the wind) passing through wind turbines. According to
Betz's idea, after impacting the rotor blades of the wind turbine, the velocity of the wind
decreases form VW to VW2 , which means that when the wind passes through the wind turbine
blades, there is still some kinetic power left in the wind. The relationship between the power
that is captured by the wind turbine and the potential maximum power in the wind can be
expressed as follows:
Cp =
PTurnine
(3.5)
PWind
Where, PTurnine is the mechanical power captured by the wind turbine, and Cp is the power
coefficient of the wind turbine which can be expressed as follows:
1
Cp = C1 (C2 C3 C4 C5 ) C6
(3.6)
Where,
1
1
+.08
.035
(3.7)
1+ 3
And,
= /
(3.8)
Where, , is the blade angle, and is the tip speed ratio of the wind turbine, while , , is
the angular speed of the wind turbine generator. The values of the coefficients (1 ~6) depend
on the type of the wind turbine.
150
151
As can be seen in Figure 3.1, the blade angle indicates how does the wind velocity impact the
wind turbine blades. The blade angle is the angle between the orientation of the blade and the
wind velocity vector. When, = 0 , the blade is fully impacted by the wind velocity, and the
wind turbine will capture the maximum power in the wind. The blade angle is usually
controlled at zero degree when the wind speed is lower than the rated wind speed of the
system to ensure a high efficiency of energy capture. When the wind speed becomes greater
than the rated value, the power captured by the system will exceed the rated power if the
blade angle stays unchanged at zero degree. It will make the generator and the power devices
work under higher than rated output, which is harmful to the system if sustained for any length
of time. Based on this concern, a control system for the modification of the blade angle
according to different wind conditions is needed for the wind turbine. Accordingly, the power
captured by the wind turbine can be rewritten as:
= (, )
(3.9)
152
153
The state space relationship of the terminal voltages of the PMSM to the phase currents and
the phase flux linkages due to the PMs and stator currents can be written as follows :
vas
Rs
v
[ bs ] = [ 0
vcs
0
0
Rs
0
as
0
ias
d
0 ] [ibs ] + [bs ]
dt
ics
Rs
cs
(3.10)
Where, , and are the instantaneous a, b, and c three-phase stator voltages, and
, and are the instantaneous three-phase stator currents. Here, is the stator winding
resistance per phase, and again, , and are the instantaneous flux linkages induced
by the three-phase AC currents and the PMs, which can be expressed in expanded form as
follows :
as
Laa
[bs ] = [Lba
Lca
cs
Lab
Lbb
Lcb
r cos(r )
Lac
ias
2
Lbc ] [ibs ] + [r cos(r 3 )]
2
ics
Lcc
r cos(r + 3 )
(3.11)
Where Laa , Lbb and Lcc are the self-inductances of the a, b, and c three-phases and Lab , Lac
, Lba , Lbc , Lca and Lcb are the mutual inductances between these phases, while , is the
rotor flux linkage caused by the permanent magnet. The self-inductances and mutual
inductances are all functions of . Thus, all of the inductances are time varying parameters.
3.2.2 Modelling of the PMSM in the -axes synchronously rotating reference frame:
The 0 Park's transformation is a mathematical transformation which aims to simplify the
analysis of synchronous machinery models, and was first introduced by R. H. Park in 1929 .In
the three-phase systems like PMSMs, the phase quantities which include stator voltages,
stator currents, and flux linkages, are time varying quantities. By applying Park's
transformation, which is in essence the projection of the phase quantities onto a rotating two
axes reference frame, the AC quantities are transformed to DC quantities, which are
independent of time. The to 0 transformation can be expressed in matrix form as
follows:
( )
[ ] = ( )
( +
( ) ( + ) [ ]
(3.12)
( )
[ ] = ( )
[( + )
( )
(
( +
[ ]
(3.13)
154
In expressions (3.12) and (3.13), and 0 can represent the stator voltages, stator
currents or flux linkages of the AC machines, respectively. Considering that under balanced
conditions, 0 =0, the voltage function of the PMSM in the -axes reference frame can be
expressed as follows:
= +
= +
(3.14)
+ +
(3.15)
Where and are the instantaneous stator voltages in the -axes reference frame,
and and are the instantaneous stator currents in the dq-axes reference frame. Here
and are the d-axis and q-axis inductances, and is the electrical angular speed of the rotor,
while is the peak/maximum phase flux linkage due to the rotor-mounted PMs. According
to expressions (3.14) and (3.15), the equivalent circuits of the PMSM in the dq -axes reference
frame can be drawn as shown in Figure 3.4:
= 2 ( + )
(3.16)
(3.17)
As a part of the input power, in the motoring mode, the active power is the power that is
transformed to mechanical power by the machine, which can be expressed as follows:
3
= 2 ( + )
(3.18)
Where,
= =
(3.19)
And
155
= + =
(3.20)
Here and are the back EMFs in the -axes reference frame, and and are the
-axes flux linkages. Substituting expressions (3.19) and (3.20) into (3.18), the active power can
be re-expressed as follows:
3
= 2 ( )
(3.21)
= = 2 (2)( )
(3.22)
Or
3
= 2 (2)( ( ) )
(3.23)
156
Two important PMSG control algorithms, the direct torque control (DTC) and the field
oriented control (FOC), are analyzed and compared. Then, the simulation results of the
generator-side converter control are given to validate the principles of control algorithms.
3.3.1 Maximum Power Point Tracking Control
Direct-drive PMSGs have the capability to work in a wide speed range. According to the
intensity of the wind, the wind turbine generators need to be controlled to operate in three
different modes.
the expression of the mechanical power captured by the wind turbine has been expressed as:
1
PTurbine = 2 r 2 Cp (, ) VW 3
(3.24)
As shown in equation (3.24), to control the captured mechanical power, PTurbine , at given
wind speed, VW , the only controllable term is the power coefficient,Cp (, ).
The power coefficient characteristic is shown in Figure 3.6. As can be seen in this figure,
different power coefficient curves correspond to different blade angles. For each case, there
is an optimal tip speed ratio, , which contributes to a peak power coefficient value which, in
turn, leads to a maximum power capture, PTurbine . In the MPPT operation mode, the pitch
angle is usually kept at zero degree.
157
In order to achieve the peak power coefficient value in the zero degree pitch angle curve in
Figure 3.6, the tip speed ratio needs to be controlled at the optimal value. From expression
(1.8), the control of the tip speed ratio is actually the control of the rotor speed of the PMSG.
A simplified scheme of tip speed ratio control is shown in Figure 3.7. From this figure, the wind
speed information is sensed by a sensor and sent to a microcontroller, from which the
reference speed of the PMSG can be calculated according to the optimal tip speed ratio.
Consequently, the generator speed will reach its reference value in the static state, and then
the MPPT control is achieved.
158
When choosing one control strategy of either DTC or FOC for the generator-side converter
control, their merits and drawbacks need to be analyzed and compared according to the
operation requirements of the direct-drive PMSG systems. The DTC approach has the
advantages that the electromagnetic torque can be changed very fast by changing the
reference, and no coordinate transforms and PI controllers are needed which decreases the
computational effort. On the other hand, the DTC approach also presents some disadvantages
such as: (1) the difficulty to control the torque at very low speed; (2) the high current and
torque ripples; and (3) the high noise level at low speed. When it comes to the FOC approach,
although its implementation requires large computational effort including PI control and
coordinate transformations, it possesses the following merits: (1) fast speed and torque
response; (2) outstanding low speed performance; and (3) low current and torque ripples. For
the application of direct-drive PMSG systems, the PMSGs are directly driven by the wind
turbine without a gearbox, which means that their operation speeds are always in a relatively
low range. Moreover, the torque ripples of the direct-drive PMSGs should be controlled at a
low level to decrease the mechanical stresses on the wind turbine. On the basis of the analysis
above, the FOC approach was found to be more suitable for the direct-drive PMSG systems
than the DTC approach.
3.3.3 Field Oriented Control based Generator-Side Converter Control
In Section 1, the torque expression of the PMSMs has been developed as follows:
3
= 2 (2)( ( ) )
(3.25)
For a surface mounted PM machine (SPM) which is applied in the case study system in this
thesis, the d-axis and q-axis inductances are equal ( = ). Thus, the torque expression can
be simplified and rewritten as follows:
3
= 2 (2)( )
(3.25.1)
In order to achieve the maximum torque per ampere, the d-axis current is set at zero ( = 0
). In expression (3.25.1), is the flux linkage due to the permanent magnets, which is a
constant. Thus, there will be a linear relationship between the electromagnetic torque and the
q-axis current, , such that the electromagnetic torque can be easily controlled by regulating
the q-axis current. The phasor diagram for the FOC approach is shown in Figure 3.8, and the
control scheme of the generator-side converter is shown in Figure 3.9.
159
160
As stated earlier, the FOC approach coupled to the optimal tip speed ratio based MPPT control
strategy is applied here as the control algorithm for the generator-side power converter. In
Figure 3.9 In the control system the optimum control method has been applied. The MSC
control system is based on rotor flux field orientation control (FOC). The position of rotor flux
vector e is obtained from the encoder or from the integral of the signal of speed sensor. The
control scheme consists of outer control loop, which regulates optimum value wopt of the
generator speed in order to obtain maximum energy from wind. The inner control loops
regulate the components of the stator current vector to follow the reference values: ids and
iqs . According to the characteristic of wind turbine (Figure 3.6) at any values of wind speed
the rotational speed of the turbine rotor wm should be regulated to the optimal value wopt .
= /
From
We get that
(3.26)
= = /
The above equation shows the reference speed in order to obtain the optimal value for tip
speed ratio opt . At optimum wind turbine speed and at the Cp =Cpmax the turbine can operate
with the maximum power. The reference d-axis current, ids is always set at zero in order to
reach the maximum torque at the minimum stator current. Meanwhile, the q-axis stator
current reference iqs is achieved by the operation of optimal control block on the base of
measured mechanical turbine speed wm and the wind speed VW .
The reference dq -axis stator currents ids and iqs .are compared with measured stator phase
currents of PMSG ids and iqs . The both error signals are sent to the two PI controllers. The
resultant signals, vpd and vpq , are the dq -axis reference voltages for the MSC control. The
reference voltages value vpd and vpq , are controlled through PI controllers. The reference
voltages are transformed to the three-phase voltages and then are sent to the sinusoidal pulse
width modulation (SPWM) block to produce switching signals for machine side converter.
3.4 Control of Grid-Side Converter
In direct-drive PMSG wind turbine systems, grid-connected converters play an important role
in transforming the DC power to AC power. As introduced earlier in Section 3, there are three
system variables that need to be strictly controlled. Namely, these variables are the speed of
the PMSG, the DC bus voltage, and the complex power (active and reactive power) injected
into the grid. As the generator-side converter controls the speed of the PMSG, the grid-side
converter regulates the DC bus voltage while controlling the active power and reactive power
injected into the grid.
In this section, the control approach for the grid-side converter is analyzed. This converter is
assumed to be operating on the basis of the principle of the sinusoidal pulse width modulation
(SPWM).
161
Figure 3.9 Simplified topology of the direct-drive PMSG wind generation system
As stated earlier, the main objective of the grid-side converter control is to regulate the
active and reactive power. The expressions of the active power and reactive power injected
into this grid can be written as follows:
3
= 2 ( + )
3
= 2 ( )
(3.27)
(3.28)
Where and are the grid currents in -axes reference frame, and are the grid
voltages in -axes reference frame. As can be seen in expressions (3.27) and (3.28),
the -axis and -axis components of the grid currents and voltages are coupled in cross
product fashion in the reactive power term, which makes the active power and reactive
power hard to control, and decreases the dynamic performance of the grid-side converter
control. Based on this coupling issue, the voltage oriented control (VOC) approach is applied
as the grid-side converter control algorithm. The VOC approach is implemented here in the
grid voltage synchronous reference frame, the -axis of the rotating reference frame is aligned
with the rotating grid voltage space vector. Accordingly, the axis component of the grid
voltage space vector is equal to zero. The phasor diagram of the VOC approach is shown in
Figure 3.10.
162
= 2 =
3
= 2
(3.27.1)
(3.28.1)
Where and are the voltage and current of the dc bus, respectively. From equations
(3.27.1) and (3.28.1), it can be observed that the active and reactive power can be controlled
independently by the -axis and -axis components of the grid currents, respectively. The
control scheme of the grid-side converter is shown in Figure 3.11.
163
(3.29)
+ +
(3.30)
Where, , represent components of the grid voltage vector in d and q axis; , represent components of the grid current vector in d and q axis; , represent voltage
vector of grid side converter in d and q axis; , - the inductance and resistance of the grid
filter; - angular frequency of the grid voltage.
164
REFERENCES
165
REFERENCES
166
REFERENCES
(8)-G. Boyle, Renewable Energy: Power for a Sustainable Future, Oxford University Press, ISBN:
0-1985-6452x, 1996.
(9)-H. Haeberlin, Evolution of inverters for grid connected PV-systems from 1989 to 2000, proc.
of the 17th European photovoltaic solar energy conference, 2001.
(10)-C.-J. Winter, L. L. Vant-Hull, R. L. Sizmann, Solar power plants, Springerverlag, ISBN: 03871-8897-5, 1991.
167
APPEDICES
Appendix A
Tools and Technologies
A-CONTROLLER
1-Raspberry Pi 2
The Raspberry Pi 2 Model B is the second generation Raspberry Pi. it has:
1GB RAM
4 USB ports
40 GPIO pins
Ethernet port
APPENDIX A
A-2
Because it has an ARMv7 processor and it can run the full range of ARM
GNU/Linux distributions, including Snappy Ubuntu Core, as well as Microsoft
Windows 10.
It can be easily connected to the internet.
It can be connected to other microcontrollers via serial connections.
2- Tiva C TM4C123G
The TM4C123G LaunchPad Evaluation Kit is a low-cost evaluation platform for ARM
Cortex-M4F based microcontrollers from Texas Instruments.
The ARM Cortex-M4F Based MCU TM4C123G LaunchPad Evaluation Kit (EKTM4C123GXL) offers these features:
APPENDIX A
A-3
3- Arduino UNO
The Uno is a microcontroller board based on the ATmega328P. It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz
quartz crystal, a USB connection, a power jack, an ICSP header and a reset button.
Microcontroller
ATmega328P
Operating Voltage
5V
7-12V
6-20V
Flash Memory
32 KB (ATmega328P)
of which 0.5 KB used by bootloader
SRAM
2 KB (ATmega328P)
EEPROM
1 KB (ATmega328P)
Clock Speed
16 MHz
APPENDIX A
A-4
B-SENSORS
1- LM35
The LM35 series are precision integrated-circuit temperature devices with an output
voltage linearly proportional to the Centigrade temperature. The LM35 device has an
advantage over linear temperature sensors calibrated in Kelvin, as the user is not
required to subtract a large constant voltage from the output to obtain convenient
Centigrade The LM35 device does not require any external calibration or trimming to
provide typical accuracies of C at room temperature and Cover a full 55C to
150C temperature range.
Features
Calibrated Directly in Celsius (Centigrade)
Linear + 10-mV/C Scale Factor
0.5C Ensured Accuracy (at 25C)
Rated for Full 55C to 150C Range
Suitable for Remote Applications
Low-Cost Due to Wafer-Level Trimming
Operates from 4 V to 30 V
APPENDIX A
A-5
2- LDR
A photoresistor (or light-dependent resistor, LDR, or photocell) is a light-controlled
variable resistor. The resistance of a photoresistor decreases with increasing incident
light intensity; in other words, it exhibits photoconductivity. A photoresistor can be
applied in light-sensitive detector circuits, and light- and dark-activated switching
circuits.
APPENDIX A
A-6
Specifications:
Resistance: 10-20Kohms
Dark resistance: 1M
APPENDIX A
A-7
3- IR Sensor
IR Sensors work by using a specific light sensor to detect a select light wavelength in
the Infra-Red (IR) spectrum. By using an LED which produces light at the same
wavelength as what the sensor is looking for, you can look at the intensity of the
received light. When an object is close to the sensor, the light from the LED bounces
off the object and into the light sensor. This results in a large jump in the intensity,
which can be detected using a threshold.
Specifications:
APPENDIX A
A-8
C-MISC
1- Motor Driver L298 H-Bridge
The L298 is an integrated monolithic circuit in a 15- lead Multiwatt and PowerSO20
packages. It is a high voltage, high
current dual full-bridge driver designed
to accept standard TTL logic levels and
drive inductive loads such as relays,
solenoids, DC and stepping motors. Two
enable inputs are provided to enable or
disable the device independently of the
input signals. The emitters of the lower
transistors of each bridge are connected
together and the corresponding external
terminal can be used for the connection
of an external sensing resistor.
Fig.A.9: Motor Driver L298 H-Bridge
Specifications:
APPENDIX A
A-9
2- jqc-3f Relay
A relay is an electrically operated switch.
Many relays use an electromagnet to
mechanically operate a switch, but other
operating principles are also used, such as
solid-state relays. Relays are used where
it is necessary to control a circuit by a lowpower signal (with complete electrical
isolation between control and controlled
circuits)
Specifications:
APPENDIX A
A-10
Relay Circuit
This circuit uses transistor to
energize the coil using a signal from
the controller
3- Optocoupler PC8X6
In electronics, an opto-isolator, also called an optocoupler, photocoupler, or optical
isolator, is a component that transfers electrical signals between two isolated circuits
by using light. Opto-isolators prevent high voltages from affecting the system receiving
the signal.
Features:
APPENDIX A
A-11
Optocoupler circuit
Fig.A.14: Optocoupler
APPENDIX A
A-12
APPENDIX A
A-13
Features:
Appendix B
Implemented Boards
1- Power Supply Board
This board provides many ports with different voltage output for ease of connection
and also provides protection through fuses.
APPENDIX B
B-1
APPENDIX B
B-2
3- Isolation Board
This board performs the isolation between control circuit and power circuit using
optocouplers
Appendix C
Programming Codes
Smart Power Supply Code
/// smart power supply ///
//// Graduation Project 2016 ////
#include <LiquidCrystal.h>
#include <EEPROM.h>
#define Vcurrent A0
#define Scurrent A1
#define V3 A1
#define V5 A2
#define V12 A3
#define V3Check A4
#define V5Check A5
#define V12Check 6
#define V3Red 8
#define V5Red 9
#define V12Red 10
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
double currentRead;
double SolarCurrentRead;
double voltage3Read;
double voltage5Read;
double voltage12Read;
double current;
double SolarCurrent;
double voltage3;
double voltage5;
double voltage12;
APPENDIX C
double voltage3Check;
double voltage5Check;
double voltage12Check;
double new_times;
double old_times;
double times;
double cost;
double saved_cost;
float power;
float solarPower;
float energy;
float SolarEnergy;
float times_energy;
float str_energy;
float tot_energy;
float saved_energy;
float solar_times_energy;
float solar_str_energy;
float solar_tot_energy;
float solar_saved_energy;
int eeAddress = 0;
int ssAddress = 100;
void voltageRead();
void printReading();
void calculateVoltage();
void calculatePower();
void calculateEnergy();
void calculateCost();
void printValue();
C-2
APPENDIX C
void fuse();
void solar();
void lcdPrint(char* identity, double value , char* unit);
void setup () {
pinMode(Vcurrent , INPUT);
pinMode(Scurrent , INPUT);
pinMode(V3 , INPUT);
pinMode(V5 , INPUT);
pinMode(V12 , INPUT);
pinMode(V3Check , INPUT);
pinMode(V5Check , INPUT);
pinMode(V12Check , INPUT);
pinMode(V3Red, OUTPUT);
pinMode(V5Red , OUTPUT);
pinMode(V12Red , OUTPUT);
lcd.begin(16, 2);
Serial.begin(9600);
str_energy = EEPROM.get(eeAddress , str_energy);
solar_str_energy = EEPROM.get(ssAddress , solar_str_energy);
}
void loop () {
voltageRead();
//printReading();
calculateVoltage();
calculatePower ();
calculateEnergy ();
calculateCost();
printVoltage();
//fuse();
C-3
APPENDIX C
lcd.display();
delay(100);
lcdPrint( "CURRENT ", current , " mA " );
lcdPrint( "Solar CURRENT ", SolarCurrent , " mA " );
//lcdPrint( "Voltage +3.3V bus" , voltage3 ," V " );
lcdPrint( "Voltage +5V bus" , voltage5 , " V ");
lcdPrint( "Voltage +12V bus" , voltage12 , " V " );
lcdPrint( "Power Used " , power , " W " );
lcdPrint( "Solar Power Used " , solarPower , " W " );
//lcdPrint( " Energy Used " , abs(energy) , " W.h " );
if (abs (energy) < 1000)
{
lcdPrint( "Energy Used " , abs(energy) , " W.h " );
}
else
{
lcdPrint( "Energy Used " , abs(energy)/1000 , " kW.h " );
}
if (abs (tot_energy) < 1000)
{
lcdPrint( "Total Energy Used " , abs(tot_energy) , " W.h " );
}
else
{
lcdPrint( "Total Energy Used " , abs(tot_energy)/1000 , " kW.h " );
}
lcdPrint( " Total Energy Cost " , abs(cost) , " L.E " );
if (abs (SolarEnergy) < 1000)
C-4
APPENDIX C
{
lcdPrint( "Solar Energy Used " , abs(SolarEnergy) , " W.h " );
}
else
{
lcdPrint( "Solar Energy Used " , abs(SolarEnergy)/1000 , " kW.h " );
}
if (abs (solar_tot_energy) < 1000)
{
lcdPrint( "Total Solar E_Used " , abs(solar_tot_energy) , " W.h " );
}
else
{
lcdPrint( "Total Solar E_Used " , abs(solar_tot_energy)/1000 , " kW.h " );
}
lcdPrint( "Total Cost Saved " , abs(saved_cost) , " L.E " );
}
void voltageRead () {
currentRead = analogRead(Vcurrent);
SolarCurrentRead = analogRead(SolarCurrent);
voltage3Read = analogRead(V3);
voltage3Check = analogRead(V3Check);
voltage5Read = analogRead(V5);
voltage5Check = analogRead(V5Check);
voltage12Read = analogRead(V12);
voltage12Check = analogRead(V12Check);
delay(100);
}
C-5
APPENDIX C
void printReading(){
Serial.print(currentRead);
Serial.print(voltage3Read);
Serial.print(voltage5Read);
Serial.println(voltage12Read);
}
void calculateVoltage (){
current = (currentRead * 5 /(1024*0.24))*1000;
SolarCurrent = (SolarCurrentRead * 5 /(1024*0.22))*1000;
voltage3= voltage3Read * 5 / 1024 ;
voltage5 = voltage5Read * 5 / 1024 ;
voltage12 = voltage5Read * 5 / 1024 ;
}
void calculatePower (){
power = (current/1000) * 5;
solarPower = (SolarCurrent/1000)*5;
}
void calculateEnergy (){
new_times = millis();
times = new_times - old_times ;
times_energy = power * (times/(1000*60*60));
energy = energy + times_energy ;
tot_energy = str_energy + energy ;
EEPROM.put(eeAddress, tot_energy);
old_times = new_times ;
solar_times_energy = solarPower * (20000/(1000*60*60));
SolarEnergy = SolarEnergy + solar_times_energy ;
solar_tot_energy = solar_str_energy + SolarEnergy ;
EEPROM.put(ssAddress, solar_tot_energy); }
C-6
APPENDIX C
void calculateCost(){
if ((tot_energy/1000)>50){
cost = 50 *(7.5/100);
if ( (tot_energy/1000) > 100){
cost = cost + 50 * (14.5/100);
if ((tot_energy/1000)>200){
cost = cost + 100 *(16/100);
cost = cost + ((tot_energy/1000) - 200) * 24 ;
saved_cost = (solar_tot_energy/1000)*(24/100);
}
else {
cost= cost+ ((tot_energy/1000) - 100)*(16/100);
saved_cost = (solar_tot_energy/1000)*(16/100);
}
}
else{
cost = cost + ((tot_energy/1000) - 50)*(14.5/100);
saved_cost = (solar_tot_energy/1000)*(14.5/100);
}
}
else{
cost = (tot_energy/1000) *(7.5/100);
saved_cost = (solar_tot_energy/1000)*(7.5/100);
}
}
void printVoltage (){
Serial.print(current);
Serial.print(voltage3);
Serial.print(voltage5);
C-7
APPENDIX C
Serial.println(voltage12);
}
void lcdPrint(char* identity , double value , char* unit){
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(identity);
// If we are writing the second line, move the cursor there
// and print the appropriate line.
lcd.setCursor(0, 1);
lcd.print(value);
lcd.print(unit);
delay(2000);
}
void fuse (){
if (voltage3Check< 100){
digitalWrite(V3Red,LOW);
}
else {
digitalWrite(V3Red,HIGH);
}
if (voltage5Check< 500){
digitalWrite(V5Red,LOW);
}
else {
digitalWrite(V5Red,HIGH);
}
if (voltage12Check==LOW){
digitalWrite(V12Red,LOW);
}
C-8
APPENDIX C
else {
digitalWrite(V12Red,HIGH);
}
}
void solar (){
if (SolarCurrent> 350){
digitalWrite(VC1,HIGH);
}
else {
digitalWrite(VC1,LOW);
}
if (SolarCurrent> 700){
digitalWrite(VC2,HIGH);
}
else {
digitalWrite(VC2,LOW);
}
if (SolarCurrent > 950){
digitalWrite(VC3,HIGH);
}
else {
digitalWrite(VC3,LOW);
}
}
Door lock code
/// smart Home ///
//// Graduation Project 2016 ////
#include <Wire.h>
#define SLAVE_ADDRESS 0x04
C-9
APPENDIX C
#include <Servo.h>
int out = GREEN_LED;
Servo myservo;
int Error = 0;
int last_Error = 0;
//General Room Structure
String retrive(int data);
typedef struct Room
{
int Light;
int AC;
int Curten[2];
int Room_Temp;
int Light_Level;
int temp;
int AC_Temp;
int Level;
int Sun_Light;
int Sun_Level;
boolean light_State;
boolean curten_State;
void get_Temperature(){
// int data = analogRead(this->Room_Temp);
this->temp = (5.0 * analogRead(this->Room_Temp) * 100.0) / 4096;
}
void getLight_Level(){
this->Level = map(analogRead(this->Light_Level), 0, 4096, 0, 1023) ;
this->Sun_Level = map(analogRead(this->Sun_Light), 0, 4096, 0, 1023) ;
}
C-10
APPENDIX C
void Temp_Control(){
int Kp = 20;
int Kd = 5;
this->get_Temperature();
Error = abs(this->AC_Temp - this->temp);
int Motor_Input = Kp*Error + Kd*last_Error;
if(Motor_Input > 255)
{
analogWrite(this->AC,255);
}
else if(Motor_Input < 50 && Motor_Input > 0)
{
analogWrite(this->AC,0);
}
else
{
analogWrite(this->AC,Motor_Input);
}
last_Error = Error;
//
this->get_Temperature();
//
//
//
digitalWrite(this->AC,HIGH);
//
//
//
//
digitalWrite(this->AC,LOW);
//
}
}
C-11
APPENDIX C
//
void Light_Control()
{
if(this->light_State)
{
if(this->curten_State)
{
myservo.write(0);
digitalWrite(this->Curten[0], LOW);
digitalWrite(this->Curten[1], HIGH);
delay(2000);
digitalWrite(this->Curten[0], HIGH);
digitalWrite(this->Curten[1], HIGH);
}
else{
myservo.write(180);
digitalWrite(this->Curten[0], HIGH);
digitalWrite(this->Curten[1], LOW);
delay(2000);
digitalWrite(this->Curten[0], HIGH);
digitalWrite(this->Curten[1], HIGH);
}
if(this-light_State)
{
this->getLight_Level();
}
else {
analogWrite(this->Light,0);
C-12
APPENDIX C
C-13
}
}
if(this->Sun_Level > 300)
{
digitalWrite(this->Light,LOW);
myservo.write(180);
digitalWrite(this->Curten[0], HIGH);
digitalWrite(this->Curten[1], LOW);
delay(3000);
digitalWrite(this->Curten[0], HIGH);
digitalWrite(this->Curten[1], HIGH);
}
else
{
digitalWrite(this->Light,HIGH);
myservo.write(0);
digitalWrite(this->Curten[0], LOW);
digitalWrite(this->Curten[1], HIGH);
delay(3000);
digitalWrite(this->Curten[0], HIGH);
digitalWrite(this->Curten[1], HIGH);
}
}
// For test
void Test(boolean Light,boolean ac)
{
if(this->Light != 0)
{
digitalWrite(this->Light,Light);
APPENDIX C
}
if(this->AC != 0)
{
digitalWrite(this->AC,ac);
}
}
}Room;
typedef struct Luxury
{
int Light;
int Door[3];
int Sensor;
int Bell;
int Sunshade;
void Door_Operation()
{
digitalWrite(this->Light,HIGH);
digitalWrite(this->Door[0],LOW);
digitalWrite(this->Door[1],HIGH);
//digitalWrite(this->Door[2],HIGH);
delay(1000);
digitalWrite(this->Door[1],LOW);
delay(2000);
digitalWrite(this->Door[0],HIGH);
digitalWrite(this->Door[1],LOW);
//digitalWrite(this->Door[2],HIGH);
delay(1000);
digitalWrite(this->Door[0],LOW);
digitalWrite(this->Light,LOW);
}
C-14
APPENDIX C
C-15
}Luxury;
int count = 0;
Room Bed_Room = {40,39,0,0,A3,0,0,29,0,0,0,false,false};
R1AC:PF_3
Room Living_Room = {37,36,30,4,A5,A4,0,0,0,A2,0,false,true};
R2AC:PC_5 / R2T:PD_2 /R2le:PD_3
Room Reception_Room = {35,0,0,0,0,0,0,0,0,0,false,false};
Luxury Garage = {34,33,13,12,11,0,0};
/ GDE:PA_3/ Gsen:PA_2
Luxury Main_Door = {}; //MD
void setup()
{
// put your setup code here, to run once:
//R1 Setup
pinMode(Bed_Room.Light,OUTPUT);
pinMode(Bed_Room.AC,OUTPUT);
pinMode(Bed_Room.Room_Temp,INPUT);
myservo.attach(PE_5);
//R2 Setup
pinMode(Living_Room.Light,OUTPUT);
pinMode(Living_Room.AC,OUTPUT);
pinMode(Living_Room.Room_Temp,INPUT);
pinMode(Living_Room.Light_Level,INPUT);
pinMode(Living_Room.Curten[0],OUTPUT);
pinMode(Living_Room.Curten[1],OUTPUT);
//R3 Setup
pinMode(Reception_Room .Light,OUTPUT);
//G Setup
pinMode(Garage.Light,OUTPUT);
pinMode(Garage.Door[0],OUTPUT);
//G
APPENDIX C
pinMode(Garage.Door[1],OUTPUT);
pinMode(Garage.Door[2],OUTPUT);
pinMode(Garage.Sensor,INPUT);
//MD
pinMode(Main_Door.Light,OUTPUT);
pinMode(Main_Door.Door[0],OUTPUT);
pinMode(Main_Door.Door[1],OUTPUT);
pinMode(Main_Door.Door[2],OUTPUT);
Serial.begin(9600);
// initialize i2c as slave
Wire.begin(SLAVE_ADDRESS);
Wire.setModule(1);
// define callbacks for i2c communication
Wire.onReceive(receiveData);
Wire.onRequest(sendData);
//Serial.begin(9600);
}
int oldSun = 0;
void loop()
{
//
int average = 0;
//
int data = 0;
//
//
//
Bed_Room.get_Temperature();
//
data += Bed_Room.temp;
//
delay(100);
//
//
Bed_Room.temp = data/10;
C-16
APPENDIX C
//Bed_Room.Temp_Control();
//Serial.println(Bed_Room.temp);
Living_Room.getLight_Level();
int newSun = Living_Room.Sun_Level;
if((oldSun < 300 && newSun > 300) || (oldSun > 300 && newSun < 300)){
Living_Room.Light_Control();
}
//Reception_Room.Test(HIGH, LOW);
//Bed_Room.Test(HIGH,LOW);
//digitalWrite(Bed_Room.Light,HIGH);
//Living_Room.Test(LOW,LOW);
//Living_Room.Light_Control();
if(digitalRead(Garage.Sensor))
{
Garage.Door_Operation();
}
//Serial.println(Bed_Room.temp);
//delay(500);
oldSun = newSun;
}
// callback for received data
void receiveData(int byteCount){
while(Wire.available()) {
int data = Wire.read();
int room_id = data/10;
int states = data%10;
int ac_id = data/100;
int ac_temp = data%100;
if(ac_id == 1)
C-17
APPENDIX C
{
Bed_Room.AC = ac_temp; // change with user value
}
if(ac_id == 3)
{
Living_Room.AC_Temp = ac_temp;
}
if(room_id == 11)
{
//Bed_Room
String out = retrive(states);
if(out[3] == '0')
{
//digitalWrite(Bed_Room.Light,LOW);
Bed_Room.light_State = false;
}
else
{
//digitalWrite(Bed_Room.Light,HIGH);
Bed_Room.light_State = true;
}
}
else if(room_id == 13)
{
//Living_Room
String out = retrive(states);
if(out[3] == '0')
{
C-18
APPENDIX C
//digitalWrite(Living_Room.Light,LOW);
Living_Room.light_State = false;
}
else
{
Living_Room.light_State = true;
}
if(out[2] == '0')
{
Living_Room.curten_State = false;
}
else
{
Living_Room.curten_State = true;
}
}
else if(room_id == 14)
{
//Reception_Room
String out = retrive(states);
if(out[3] == '0')
{
//digitalWrite(Reception_Room.Light,LOW);
Reception_Room.light_State = false;
}
else
{
//digitalWrite(Reception_Room.Light,HIGH);
Reception_Room.light_State = true;
}
C-19
APPENDIX C
}
}
}
// callback for sending data
void sendData(){
}
String retrive(int data)
{
String Data;
switch(data)
{
case 0:
Data = "0000";
break;
case 1:
Data = "0001";
break;
case 2:
Data = "0010";
break;
case 3:
Data = "0011";
break;
case 4:
Data = "0100";
break;
case 5:
Data = "0101";
break;
C-20
APPENDIX C
case 6:
Data = "0110";
break;
case 7:
Data = "0111";
break;
case 8:
Data = "1000";
break;
case 9:
Data = "1001";
break;
}
return Data;
}
C-21
APPENDIX C
// user.rb
class User < ActiveRecord::Base
has_secure_password
has_many :rooms
end
// room.rb
class Room < ActiveRecord::Base
belongs_to :user
has_many :devices, dependent: :destroy
end
// device.rb
class Device < ActiveRecord::Base
belongs_to :room
validates_inclusion_of :light, in: [true, false]
validates_inclusion_of :shade, in: [true, false]
validates_inclusion_of :door, in: [true, false]
validates_inclusion_of :camera, in: [true, false]
validates :ac, presence: true
end
Controller Snippet
//application_controller.rb
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_action :ensure_login
helper_method :logged_in?, :current_user
protected
def ensure_login
redirect_to login_path unless session[:user_id]
end
def logged_in?
session[:user_id]
end
def current_user
@current_user ||= User.find(session[:user_id])
End
C-22
APPENDIX C
end
//rooms_controller.rb
class RoomsController < ApplicationController
before_action :set_room, except: [:index, :new, :create]
helper_method :check_state, :add_active
# GET /rooms
def index
@rooms = current_user.rooms.all
end
# GET /rooms/new
def new
@room = current_user.rooms.new
end
# POST /rooms
def create
@room = current_user.rooms.new(room_params)
respond_to do |format|
if @room.save
format.html { redirect_to @room, notice: 'Room was successfully created.' }
format.json { render :show, status: :created, location: @room }
else
format.html { render :new }
format.json { render json: @room.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /rooms/1
def update
respond_to do |format|
if @room.update(room_params)
format.html { redirect_to @room, notice: 'Room was successfully updated.' }
format.json { render :show, status: :ok, location: @room }
else
format.html { render :edit }
format.json { render json: @room.errors, status: :unprocessable_entity }
end
end
end
# DELETE /rooms/1
def destroy
@room.destroy
respond_to do |format|
format.html { redirect_to rooms_url, notice: 'Room was successfully destroyed.' }
format.json { head :no_content }
end
C-23
APPENDIX C
end
def check_state(arg)
if arg == :ac
@devices_log? @devices_log.ac : 21
else
@devices_log? @devices_log[arg] : false
end
end
def add_active(arg, state)
if state
check_state(arg) ? "active" : ""
else
!check_state(arg) ? "active" : ""
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_room
@room = current_user.rooms.find(params[:id])
@devices_log = @room.devices.last
end
# Never trust parameters from the scary internet, only allow the white list through.
def room_params
params.require(:room).permit(:name, :description)
end
end
//devices_controller.rb
class DevicesController < ApplicationController
before_action :set_room
def create
@device = @room.devices.new(room_params)
if @device.save
flash[:success] = "Successfuly updated"
redirect_to @room #, notice: "Successfuly updated"
else
flash[:danger] = "Unable to update"
redirect_to @room #, alert: "Unable to update"
end
end
private
def set_room
@room = Room.find(params[:room_id])
end
def room_params
params.require(:device).permit(:light, :ac, :shade, :camera, :door)
end
end
C-24
APPENDIX C
View Snippet
// index.html.erb
<div class="container">
<p id="notice"><%= notice %></p>
<h2>Rooms</h2>
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-10 - col-md-offset-1 text-center">
<ul class="list-inline list-room">
<% @rooms.each do |room| %>
<li class="list-rooms-item">
<div class="room-item">
<%= link_to room do %>
<%= image_tag(cycle("room_1.png", "room_2.png", "room_3.png",
"room_4.png"), alt: "room", size: "300x300", class: "room-img") %>
<span class="room-title-block">
<span class="room-title"><%= room.name %> </span>
<span class="ranking">Show</span>
</span>
<% end %>
</div>
</li>
<% end %>
</ul>
</div>
</div>
</div>
// show.html.index
<div class="device">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-6 col-md-offset-3">
<% if @room.devices.blank? %>
<h3>Add Devices </h3>
<% else %>
<div id="dynamic"><%= render @devices_log %></div>
<% end %>
</div>
</div>
</div>
</div>
<div class="row">
<% if @room.devices.blank? %>
<div class="col-xs-12 col-md-4 col-md-offset-4">
<a class="btn btn-default btn-lg btn-block" role="button" data-toggle="collapse"
href="#collapseExample" aria-expanded="false" ariacontrols="collapseExample">Create</a>
C-25
APPENDIX C
</div>
<% else %>
<div class="col-xs-12 col-md-4 col-md-offset-4">
<a class="btn btn-default btn-lg btn-block" role="button" data-toggle="collapse"
href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Edit
</a>
</div>
<% end %>
</div>
<div style="padding:25px;"></div>
<div class="row">
<div class="collapse" id="collapseExample">
<div class="col-xs-6 col-xs-offset-3">
<%= render 'devices/create_form' %>
</div>
</div>
</div>
Web Service Snippet
// route.rb
Rails.application.routes.draw do
resource :homes
root "homes#index"
get "/login" => "homes#new", as: "login"
delete "/logout" => "homes#destroy", as: "logout"
resources :rooms do
resources :devices
end
namespace :api do
resources :rooms, only: [:show] do
resources :devices, only: [:create]
end
end
end
C-26
Appendix D
Simulation of Some Wind Turbines Systems
1-Simulation Results of Doubly-fed Induction Generator (DFIG)
APPENDIX D
D-2
APPENDIX D
D-3
APPENDIX D
D-4
APPENDIX D
D-5
APPENDIX D
D-6
APPENDIX D
D-7
APPENDIX D
D-8
APPENDIX D
D-9
100
575
Rated Power(VA)
4e6
Rated Frequency(Hz)
60
[0.003 0.3]
10000e-6
DC capacitor voltage(V)
1150
48
APPENDIX D
D-10
APPENDIX D
D-11
APPENDIX D
D-12
Fig.D.12: DQ Transformation
APPENDIX D
Rotor speed
D-13
APPENDIX D
Dc-Link Voltage
D-14
APPENDIX D
D-15
Grid voltage
Grid Current