wind based measurement and uncertainity using kalman filtering
1. Wind Based Measurement And Uncertainity
Analysis With Kalman Filtering
PROJECT REPORT
SUBMITTED BY
UNDER THE GUIDENCE OF
Mr.M.RATHINA MOORTHY.B.E..,
Submitted for the fulfillment of completion of
Diploma in Electrical and Electronics Engineering
Of the Directorate Of Technical Education
Government of Tamilnadu.
2013-2014
K.PRADEEPRAJA N.PRASANNA
G.SIVASANKAR T.SUNDARRAJAN
K.THAMILARASAN G.ARAVINTH
2. ARULMURUGAN POLYTECHNIC COLLEGE
(An ISO 9001:2008 Certified Institution)
THENNILAI
BONAFIDE CERTFICATE
Roll No:……………….. Reg.No:………………
Certified that the project “Wind Based Measurement And
Uncertainity Analysis With Kalman Filtering” is a bonafide work done
by“……………………………………………..……………...”under my
supervision,during the academic year 2013-2014
Project Guide Head Of The Department
Submitted to the Directorate of Technical Education, Chennai for the final
year practical Examination held on …………………
Internal Examiner External Examiner
ISO 9001:2008
4. i
ACKNOWLEDGEMENT
First of all I would like to thank my parent & friends, for providing mental
support and help in doing this work.
I would like “ARULMURUGAN POLYTECHNIC COLLEGE”, THENNILAI
to have me a chance to do the project and helped to gain experience in both education
and life.
The credit of project “Wind Based Measurement And Uncertainity Analysis With Kalman
Filtering” goes to our Principal Mr.P.V.KANDASAAMY,M.Tech.,MBA., who
encouraged in every step of the project.
We dedicate our project to Mr.A.SIVAKUMAR M.E., the HEAD OF THE
DEPARTMENT of Electrical and Electronics Engineering”.
Last but not least we would like to express our gratitude to
Mr.M.RATHINA MOORTHY .B.E.., for the valuable guidance to take up and
complete the project.
We also express our gratitude to our motivators,
Mr. S.RAGUPATHI B.E.,
Mrs. P.SUGUNA B.E.,
Mr. S.GOWRI SHANKAR B.E.,(M.E).,
Ms. M.RENUGA.B.E
Mr. R.RAMESH ITI.,
The same way the project would not be concluded without enthusiasm and co-
operation of our fellowship. So we keep this project as a memoir of every one cherish
it in our memory.
9. iv
ABSTRACT
Strong growth figures prove that wind is now a mainstream option for new
power generation. All the successful megawatt-class wind technology developments to date
are results of evolutionary design efforts based on the premise that control can significantly
improve energy capture and reduce dynamic loads. The main challenge is wind stochasticity
that impacts both power quality and drive train fatigue life for a wind generating system. In
the proposed paradigm, control is exercised through a self-tuning regulator (STR) that
incorporates a recursive least-squares algorithm to predict the process parameters and update
the states.
In above rated regimes, the control strategy incorporating a pitch regulatory system
aims to regulate turbine power and maintain stable, closed-loop behavior in the presence of
turbulent wind inflow. Computer simulations reveal that achieving the two objectives of
maximizing energy extraction and load reduction by the STR becomes more attractive
relative to the classical PID controller design. In our project The Power Plant Windmill
systems has been controlled and monitored. Here the voltage and the Current which are
monitored through PC for getting the required voltage along a microcontroller which is
connected. If there would be an occurrence of any change in the voltage or Current, the
systems have programmed to operate a motor. The motor is used to operate the windmill if
the changes happen with the control of the microcontroller. Everything monitored with the
help of PC.
11. 2
1.INTRODUCTION
In above rated regimes, the control strategy incorporating a pitch regulatory system
aims to regulate turbine power and maintain stable, closed-loop behavior in the presence of
turbulent wind inflow. Computer simulations reveal that achieving the two objectives of
maximizing energy extraction and load reduction by the STR becomes more attractive
relative to the classical PID controller design.
In this work, a wind speed measurement model basedon Neural Network Data Fusion
of the time-of-flight (ToF)information is presented. The fusion is obtained throughthreshold
detection (TH) and phase difference (PD) techniquesFor this purpose, a data fusion method is
presented based on theself-organized learning to the variables being fused andassessment the
uncertainty ToF measurement is development.Simulation results are presented to several
measured values usingthe TH and PD techniques
This procedure does not discuss how the uncertainty of a particular measurement
result may be used for different purposes, such as drawing conclusions about the
compatibility of the measurement result with other similar re-sults, establish the tolerance
limits in a given manufacturing process, or decide if a certain course of action may be safely
taken. The use of uncertainty results to those ends is not with-in the scope of this procedure.
.
15. 6
3.BLOCK DIAGRAM DESCRIPTION
3.1MICRO CONTROLLER
A micro-controller, in simple words, is a miniature computer with a central
processing unit and some peripherals integrated into a single integrated circuit package.
The central processing unit can execute some instructions resulting in some
outcomes. These instructions define the architecture of the controller’s central processor in a
macro scale. This gives rise to the a major classifications in processor architecture as
• Reduced Instruction Set Computer (RISC) or
• Complex Instruction Set Computer (CISC)
To learn about controllers, processors and architectures in a general and abstract
manner is tedious, time consuming and at-times dry. So here we are considering a simple
microcontroller – the PIC 16F877a as an example to begin with.
PIC is a family of modified Harvard architecture microcontrollers made by Microchip
Technology, derived from the PIC1650 originally developed by General Instrument's
Microelectronics Division. The name PIC initially referred to "Peripheral Interface
Controller'.
PICs are popular with both industrial developers and hobbyists alike due to their low
cost, wide availability, large user base, extensive collection of application notes, availability
of low cost or free development tools, and serial programming (and re-programming with
flash memory) capability.
16. 7
3.1.1 PORTS OF PIC16F877A
A port is the microcontrollers’ interface into the real world. All the data manipulation
and operations that are done within the microcontroller ultimately manifests as output signals
through the ports.
To make the concept clear, let us consider an air conditioning system built around a
microcontroller. The temperature sensors measure the room temperature and give it as input
to the microcontroller through the ports. The data coming in through the ports will be stored
in some GPR by the microcontroller. The data in this GPR will be compared against a set
temperature. If the external temperature reported by the sensor is higher that the threshold,
the microcontroller switches on the air conditioning mechanism. This is done by switching on
the corresponding port pin.
Physically, ports are some of the pins that are seen in the IC package. There are 6 ports
for PIC 16f877a. They are named as PORTA, PORTB, PORTC, PORTD and PORTE. Ports
B, C and D are 8 bit wide (8 pins each), while PORTA is 5bitand PORTE is 3 bit wide. The
pin allocation of the ports is given in the IC pin diagram in page 3 of the data sheet and is
reproduced below. The individual port pins are named 0 through n. for egg 1st pin of PORTA
will be RA0.
As it can be seen from the pin diagram, the port pins are bi-directional and and most
of them are multiplexed in function. I.e the pins act as regular general purpose I/O as required
for the air conditioning example, or as the I/O s of some of the internal modules of the
microcontroller. For example, port pins RC7 and RC6 (pin number 25 and 26) are regular
I/Os as well as the interface to the UART module that handles the RS-232 protocol, which is
commonly used to interface the PIC to a regular computer.
17.
18. 9
3.1.3 DESCRIPTION
The RS-232 based UART module requires only two data lines to effectively transmit
and receive data from a regular computer to the PIC or even a printer or PDA with a serial
port. This module is integrated into the PIC package and can be configured using firmware
instructions. Exact way of doing this will be discussed later.
Each port has a corresponding SFR in the RAM register block. Therefore, when we
are referring to switching a port pin on as in the air conditioner, it is actually writing data into
the corresponding port register. Similarly, receiving data from the registers is actually,
reading the data stored in the corresponding data register.
Along with the data holding port registers, there is a set of configuration registers
associated with the ports. These are the TRIS registers that configure the ports to be in input
or output mode. These also reside in the RAM register banks as SFRs. Writing a 1 into the
corresponding TRIS bit configure the port pin as an input pin, and the data coming in thought
the port pin will be latched into the corresponding PORT bit in the immediately next
execution cycle.
The code snippet below is to read a byte from PORTB and write it to file
location 0×120. Note that the TRIS registers are in bank1 where is the PORT registers are in
bank 0 and file register 0×120 is in bank 2. This bank selection concept is to be kept in mind
whenever we are dealing with RAM registers of the PIC. The list bank location listing is in
page 17of the data sheet.
19.
20. 11
3.1.5 PERFORMANCE
The architectural decisions are directed at the maximization of speed-to-cost ratio.
The PIC architecture was among the first scalar CPU designs, and is still among the simplest
and cheapest. The Harvard architecture—in which instructions and data come from separate
sources—simplify timing and microcircuit design greatly, and this benefits clock speed,
price, and power consumption. The PIC instruction set is suited to implementation of fast
lookup tables in the program space. Such lookups take one instruction and two instruction
cycles. Many functions can be modeled in this way. Optimization is facilitated by the
relatively large program space of the PIC (e.g. 4096 × 14-bit words on the 16F690) and by
the design of the instruction set, which allows for embedded constants. For example, a branch
instruction's target may be indexed by W, and execute a "RETLW" which does as it is named
- return with literal in W.
Interrupt latency is constant at three instruction cycles. External interrupts have to be
synchronized with the four clock instruction cycle; otherwise there can be a one instruction
cycle jitter. Internal interrupts are already synchronized. The constant interrupt latency allows
PICs to achieve interrupt driven low jitter timing sequences. An example of this is a video
sync pulse generator. This is no longer true in the newest PIC models, because they have a
synchronous interrupt latency of three or four cycles.
3.1.6 ADVANTAGES
Small instruction set to learn
RISC architecture
Built in oscillator with selectable speeds
Easy entry level, in circuit programming plus in circuit debugging PICK it units
available for less than $50
Inexpensive microcontrollers
Wide range of interfaces including I²C, SPI, USB, USART, A/D, programmable
comparators, PWM, LIN, CAN, PSP, and Ethernet
21. 12
3.1.7 LIMITATIONS
One accumulator
Register-bank switching is required to access the entire RAM of many devices
Operations and registers are not orthogonal; some instructions can address RAM
and/or immediate constants, while others can only use the accumulator
The following stack limitations have been addressed in the PIC18 series, but still
apply to earlier cores:
The hardware call stack is not addressable, so preemptive task switching cannot
be implemented
Software-implemented stacks are not efficient, so it is difficult to generate
reentrant code and support local variables
With paged program memory, there are two page sizes to worry about: one for CALL and
GOTO and another for computed GOTO (typically used for table lookups). For example, on
PIC16, CALL and GOTO have 11 bits of addressing, so the page size is 2048 instruction
words. For computed GOTOs, where you add to PCL, the page size is 256 instruction words.
In both cases, the upper address bits are provided by the PCLATH register. This register must
be changed every time control transfers between pages. PCLATH must also be preserved by
any interrupt handler.
22. 13
3.2WIND MILL
Wind is the natural motion of the air roughly parallel to the Earth's surface. It is
caused by the unequal heating and cooling of the Earth and atmosphere by the sun, which
produces differences in air pressure. As the atmosphere shifts air masses to equalize these
differences wind is developed, tending to flow from areas of high pressure to areas of low
pressure. Additional factors also come into play that can influence the wind speed and
direction, such as Earth's rotation (Carioles Effect), the condensation of water vapor, the
formation of clouds, friction over land and water, and others.
Wind occurs at all scales. Global winds (trade winds), upper level winds (jet streams),
synoptic winds (resulting from the pressure differences of surface air masses), local
(mesoscale) winds (such as gust fronts), and winds that develop because of geographical
features (like sea breezes). Winds also occur on a much smaller scale, for example dust devils
or tornadoes.
Wind observations are taken at a fixed location using two parameters: wind speed.
Wind speed is a measurement of the speed of movement of the air, and is typically reported
in miles per hour (mph) or kilometers per hour (kph). Reports for maritime and aeronautical
operations may use those or knots (nautical miles per hour).
.Wind speed and wind direction can be measured with a variety of tools. The most
common, included with complete home weather stations, is the anemometer, which typically
consists of a rotating vane to measure direction and a shaft with cups attached that spins with
the wind to measure its speed. The Beaufort scale can also be used to assess wind speed, and
it's commonly used in marine forecasts and weather observations.
23.
24. 15
3.2.1 INSTALLING WIND SPEED SENSOR
The goal of installing a wind speed meter (anemometer) is to position it in a location
where the wind flows freely and is not influenced by nearby objects. The World
Meteorological Organization has set the international standard height for wind measurement
devices at 10 meters (33 feet) above ground, with no obstructions at or above this level.
Attaining this height can not only be difficult but expensive as well. For most home weather
stations installations, striking a compromise is likely the best alternative.
So what are the alternatives? Part of the answer to that is how accurate one can want
ones measurements to be? Wind observations taken at 7 meters (23 feet) are accurate enough
for the National Weather Service to accept. For a rooftop installation, the minimum height to
avoid anomalous winds caused by the roof itself is 3 meters (10 feet) above the most exposed
part. Accuracy of the wind speed indicator is not just a matter of height. Local obstructions
like nearby mature trees, houses and buildings all have the potential of impacting
anemometer readings. Unfortunately this is the reality of taking wind measurements and the
choice of how to deal with it is ultimately yours.
Other requirements for the proper installation of an anemometer include mounting the
mast absolutely vertical and orienting the wind direction indicator to true north for accurate
wind direction readings. The mast can easily be leveled using a carpenter's bubble level, but
orientation to true north is a bit more problematic. The best way to locate magnetic north is
by using a magnetic compass and correct to true north by the magnetic declination for that
selected area. Visit the National Geophysical Data Center (NGDC) page that will calculate it
for ones location. Do not use a GPS to make the determination, the magnetic compass is a
more accurate tool to determine true north. If its need to brush up on magnetic declination.
3.2.2 GENERAL DESCRIPTION
The 5050WSis the standard sensor used on the 5081Weather Station for
measuring wind speed. This three-cup anemometer is made of durable Lexan plastic that
resists icing. Its low moment of inertia responses rapidly to gust and lulls while Teflon
bearings make it ideal for use in harsh environments.
25. 16
3.2.3 SPECIFICATIONS
Accuracy: ± 2. % of full scale
Starting speed: 4 mph
Cup diameter: 2 inches (51 mm)
Turning radius: 3.75 in
Bearings: Teflon
Distance constant: 10 ft.
Transducer: AC generator
Electrical output: 0 to 3.6 Vac, 2 pulse/revolution (ppr), 60 Hz at 1800 rpm
3.2.4 INSTALLATION
3.2.4.1 UNPACKING
The 5081MX Mast/Crossarm assembly is shipped with the wind sensors pre-wired.
While unpacking the crossarm, locate the wind sensors first and then take care not to damage
them during the unpacking. Check that all packing materials have been removed from the
wind sensors, especially inside the mounting collar.
3.2.4.2 SITE SELECTION
Large obstacles such as buildings and trees create large mixing eddies, causing
fluctuations in the localized wind direction. The sensor should be located at a distance of at
least ten times the height of an obstruction away from that obstruction.
3.2.4.3 INSTALLATION
The anemometer is mounted to the sensor mounting arm and fastened with three set
screws. Refer to the 5081 Manual for cross arm assembly. The sensor must be installed level
fro proper operation.
26. 17
3.2.4.4.CONNECTION TO THE DATA TRANSMITTER
The standard input port is a 6-pin non-rotated MS connector. On the 5096-81 this port
is labeled Wind. Check alignment key and pin placement before installing the connector. To
install the connector, align the keys, press the connector in, then turn the threaded locking
collar. It is important that the connector be completely seated. Continue turning the collar
until the connector bottoms out.
3.2.4.5 WIRING
`Refer to Wiring Diagram AC107369. Note that both cables from the wind sensors are
attached to the 6-pin MS connector. If it becomes necessary to remove the connector, clearly
mark the cables to ensure proper re-assembly. The wires are spliced to the RED and BROWN
signal wires which are attached to terminals inside the body of the sensor.
3.2.4.6 THEORY OF OPERATION
The 5050WS is an AC generator, two fixed coils and a rotating magnet, which
produces two sine waves per revolution. At approximately 103 mph (1800 rpm) the
anemometer will produce an output signal frequency of 60 Hertz. The 5096 Data Transmitter
counts the pulses produced and reports when a some number of pulses has occurred. The
number of pulses is equal to the wind run; the ALERT standard for the wind run report is 3
km which is equal to 3924 pulses..
27.
28. 19
3.3 DC MOTOR
A DC motor is an electric motor that runs on direct current (DC) electricity. The
brushed DC motor generates torque directly from DC power supplied to the motor by using
internal commutation, stationary permanent magnets, and rotating electrical magnets. It
works on the principle of Lorentz force , which states that any current carrying conductor
placed within an external magnetic field experiences a torque or force known as Lorentz
force. Advantages of a brushed DC motor include low initial cost, high reliability, and
simple control of motor speed. Disadvantages are high maintenance and low life-span for
high intensity uses.
Maintenance involves regularly replacing the brushes and springs which carry the
electric current, as well as cleaning or replacing the commutator. These components are
necessary for transferring electrical power from outside the motor to the spinning wire
windings of the rotor inside the motor. Synchronous DC motors, such as the brushless DC
motor and the stepper motor, require external commutation to generate torque. They lock up
if driven directly by DC power.
However, BLDC motors are more similar to a synchronous ac motor. Brushless DC
motors use a rotating permanent magnet in the rotor, and stationary electrical magnets on the
motor housing. A motor controller converts DC to AC. This design is simpler than that of
brushed motors because it eliminates the complication of transferring power from outside the
motor to the spinning rotor. Advantages of brushless motors include long life span, little or
no maintenance, and high efficiency. Disadvantages include high initial cost, and more
complicated motor speed controllers. Other types of DC motors require no commutation.
• Homopolar motor-A homopolar motor has a magnetic field along the axis of rotation
and an electric current that at some point is not parallel to the magnetic field. The
name homopolar refers to the absence of polarity change.
• Homopolar motors necessarily have a single-turn coil, which limits them to very low
voltages. This has restricted the practical application of this type of motor.
33. 24
5.CIRCUIT DIAGRAM DESCRIPTION
5.1 POWER SUPPLY
A 230v, 50Hz Single phase AC power supply is given to a step down transformer to
get 12v supply. This voltage is converted to DC voltage using a Bridge Rectifier. The
converted pulsating DC voltage is filtered by a 2200uf capacitor and then given to 7805
voltage regulator to obtain constant 5v supply. This 5v supply is given to all the components
in the circuit. A RC time constant circuit is added to discharge all the capacitors quickly. To
ensure the power supply a LED is connected for indication purpose
5.1.1CIRCUIT DIAGRAM OF POWER SUPPLY UNIT
FIG 5.1.1 POWER SUPPLY
230 V/
AC
+
1000 MF / 25V
1 3
2 4
GND
1 3
VIN VOUT
0
7805
0
12V - 0 (6V)
/ 500 MA
1K
- +
1N 4007
BRIDGE
1
4
3
2
1N4007
+ 5 Vcc
2
TRANSFORMER
104
LED
34. 25
5.2LCD DISPLAY
5.2.1 INTRODUCTION
LCD stands for liquid crystal; this is an output device with a limited viewing
angle. The choice of LCD as an output device was Because of its cost of use and is
better with alphabets when compared with a 7-segment LED display. We have so
many kinds of LCD today and our application requires a LCD with 2 lines and 16
characters per line, this gets data from the microcontroller and displays the same. It
has 8 data lines, 3 control line, a supply voltage Vcc (+5v and a GND. This makes the
whole device user friendly by showing the balance left in the card. This also shoes the
card that is currently being used.
In recent years the LCD is finding widespread use replacing LED’s. This is
due to the following reasons:
The declining prices of LCD’s.
1. The ability to display numbers, characters and graphics. This is in contrast to
LED’s, which are limited to numbers and few characters.
2. Incorporation of a refreshing controller into the LCD, there by relieving the
CPU of the task of refreshing the LCD .in contrast, the Led must be refreshed
by the CPU to keep displaying the data.
3. Ease of programming for characters and graphics.
36. 27
5.2.2 LCD PIN DESCRIPTIONS
5.2.2.1 VCC, VSS and VEE
While VCC and VSS provide +5v and ground respectively, VEE is used for
controlling LCD contrast.
5.2.2.2 RS, REGISTER SELECT
There are two very important registers inside the LCD. The RS pin used for
their selection as follows. If RS=0, the instruction command code register is selected,
allowing the user to send a command such as clear display, cursor at home ,etc. .IF
RS=1 the data register is selected, allowing the user to send data to be displayed on
the LCD.
5.2.2.3 R/W READ/WRITE
R/W input allows the user to write information to the LCD or read information
from it. R/W=1 when reading; R/W=0 when writing.
5.2.2.4 E, ENABLE
The enable pin is used by the LCD to latch information present to its data pins.
When data is supplied to data pins, a high to low pulse must be applied to this pin in
order for the LCD to latch in the data present at the data pins. This pulse must be a
minimum of 450ns wide.
5.2.2.5 D0-D7
The 8-bit data pins, D0-D7, are used to send information to LCD or read the
contents of the LCD’s internal registers.
To display letters and numbers, we send ASCII codes for the letters A-Z, a-z,
and numbers 0-9 to these pins while making RS=1.There are also instruction
commands codes that can be send to the LCD to clear the display or force the cursor
to the home position or blink the cursor.
37.
38.
39. 30
The LCD requires either 8 or 11 I/O lines to communicate with. For the sake of
this tutorial, we are going to use an 8-bit data bus--so we'll be using 11 of the 8051's
I/O pins to interface with the LCD.The EN line is used to tell the LCD that you are
ready for it to execute an instruction that you've prepared on the data bus and on the
other control lines. Note that the EN line must be raised/lowered before/after each
instruction sent to the LCD regardless of whether that instruction is read or write text
or instruction. In short, you must always manipulate EN when communicating with
the LCD. EN is the LCD's way of knowing that you are talking to it. If you don't
raise/lower EN, the LCD doesn't know you're talking to it on the other lines.
5.2.7 FEATURES
• Output current in excess of 1A
• Internal thermal overload protection
• No external components required
• Output transistor safe area protection
• Internal short circuit current limit
• Available in the aluminum TO-3 package
42. 33
6.PCB DESIGN
Design and fabrication of printed circuit boards
6.1.INTRODUCTION
Printed circuit boards, or PCBs, from the core of electronic equipment domestic and
industrial. Some of the areas where PCBs are intensively used are computers, process control,
telecommunications and instrumentation.
6.2 MANUFACTCURING
The manufacturing process consists of two methods. Print and etch, and print. The
single sided PCBs are usually made using the print and etch method. The domestic sided
plate through – hole (PTH) boards are by the print plate and etch method.
The production of multi layer boards uses both the methods. The inner layers are
printed and etch while the outer layers are produced by print, plate and etch after processing
the inner layers.
6.3 SOFTWARE
The software used in our project to obtain the schematic layout is MICROSIM
6.4 PANELISATION
Here the schematic transformed in to the working positive/negative films. The circuit
is repeated conveniently to accommodate economically as many circuits as possible in a
panel, which can be operated in every sequence of subsequent steps in the pcb process. This
is called penalization. For the PTH boards, the next operation is drilling.
6.5 PLATING
The heart of the PCB manufacturing process. The holes drilled in the board of the
treated both mechanically and chemically before depositing the copper by the electro less
copper plating process.
43. 34
6.6 ETCHING
Once a multiplayer board is drilled and electro less copper deposited, the image
available in the form of a film is transferred on to the out side by photo printing using a dry
film printing process. The boards are then electrolytic plated on the circuit pattern with
copper and thin. The tin plated deposit serves an etch resist when copper in the unwanted area
is removed by the conveyer’s spray etching machines with chemical etch ants. The etching
machines are attached to an automatic dosing equipment, which analysis and controls etch
ants concentrations.
6.7 SOLDERMASK
Since a PCB design may call for very close spacing between conductors, a solder
mask has to be applied on the both sides of the circuitry to avoid the bridging of conductors.
The solder mask ink is applied by screening. The ink is dried, exposed to UV, developed in a
mild alkaline solution and finally cured by both UV and thermal energy.
6.8 HOT AIR LEVELLING
After Applying the solder mask, the circuit pads are soldered using the hot air leveling
process. The bare bodies fluxed and dipped in to a molten solder both. While removing the
board from the solder bath, hot air is blown on both sides of the board through air knives in
the machines, leaving the board soldered and leveled. This is one of the common finishes
given to the boards. Thus the doubles sided plated through whole printed circuit board is
manufactured and is now ready for the components to be soldered.
45. 36
7.SOFTWARE TOOLS
7.1 KEIL C COMPILER
Keil development tools for the 16F877A microcontroller architecture support every
level of software developer from the professional applications engineer to the student just
learning about embedded software development.
The industry-standard Keil C Compiler, Macro Assembler, Debuggers, Real time
Kernels, single-board computers, and Emulators support all derivatives and help you get your
projects completed on schedule.
7.2 BENEFITS OF KEIL TOOLS
7.2.1GETTING START
When starting a new project, simply select the microcontroller you use from
the Device Database and the µVision IDE sets all compiler, assembler, linker, and
memory options for you. Hence new users can learn the tools very easily.
7.2.2 COMPLEX PROBLEMS CAN BE SOLVED:
7.2.2.1 SIMPLE CODES:
The industry-standard Real view C/C++ Compiler creates the smallest, fastest
application code and includes a complete ISO run-time library with C++ STL support.
7.2.3 EXCELLENT PROJECT MANAGEMENT:
The use of KEIL centers on “projects". A project is a list of all the source files
required to build a single application, all the tool options which specify exactly how
to build the application, and - if required-how the application should be simulated. A
project contains enough information to take a set of source files and generate exactly
the binary code required for the application It would be tedious to have to set these
options up every time the application is being built, therefore they are stored in a
project file. Loading the project file into KEIL informs KEIL which source files are
required, where they are, and how to configure the tools in the correct way.
47. 38
8.ADVANTAGES
We can use it were ever we need the constant voltage.
Even in the absence of power, we can use this voltage for home appliances.
Low cost.
Low Maintanance Cost
49. 40
9.CONCLUSION
Considerations have been made on the design of an instrument that makes use of the
proposed procedure, including the determination of the sensors lining up angle, and number
of samples to be taken for the DEKF algorithm. An example of application was shown in
order to illustrate the proposed procedure. Finally, signals were analyzed in order to obtain
the combined standard uncertainty in the wind speed measurement. The proposed
measurement procedure produces measurement results with low uncertainty. Additionally, it
can operate in an intermittent mode for energy saving since the number of sine waves
transmitted can be selected by the users
51. 42
10.BIBLIOGRAPHY
J.M. Mauricio, Y.C. Catunda and R. Tanscheit, “Maximum-likelihood
data fusion of phase-difference and threshold-detection techniques for
wind-speed measurement”, IEEE Transactions on Instrumentation and
Measurement, Vol. 58, No. 7, July 2009.
Leopoldo Angrisani, Aldo Baccigalupi, and Rosario Schiano Lo
Moriello. “A measurement method based on Kalman filtering for
ultrasonic time-of-flight estimation.” IEEE Transactions on
Instrumentation and Measurement, Vol. 55, No. 2, April 2006.
Marioli, D., Narduzzi C., Offelli, Petri D., Sardini E. and Taroni A.,
“Digital time of flight measurement for ultrasonic sensors” IEEE Tans.
Instrum. Meas., vol. 41, no. 1, Feb. 1992.
.
10.1 BOOKS
ISO, “Guide to the expression of uncertainty in measurement”,
International Organization for Standarization, Geneva, CH, 1995.
J.R. Taylor, “An introduction to error analysis: the study of
uncertainties in physical measurements”, 2nd ed. Sausalito, Calif.:
University Science,1997
10.2 WEB RESOURCES:
http://www.wind mill.org
http://www.wind power cn.com
http://www.wind Energy com
59. 49
char *s;
for (s = s1; n > 0 && *s2 != '0'; n--)
*s++ = *s2++;
for (; n > 0; n--)
*s++ = '0';
return(s1);
}
/*concatenation functions*/
/* standard template: char *strcat(char
*s1, const char *s2)
appends s2 to s1*/
char *strcat(char *s1, char *s2)
{
char *s;
for (s = s1; *s != '0'; ++s);
while(*s2 != '0')
{
*s = *s2;
++s;
++s2;
}
*s = '0';
return(s1);
}
/* standard template: char
*strncat(char *s1, char *s2,size_t n)
appends not more than n characters
from s2 to s1*/
char *strncat(char *s1, char *s2, size_t
n)
{
char *s;
for (s = s1; *s != '0'; ++s);
while(*s2 != '0' && 0<n)
{
*s = *s2;
++s;
++s2;
--n;
}
*s = '0';
return(s1);
}
/*comparison functions*/
/* standard template: signed int
memcmp(void *s1, void *s2).
Compares s1 & s2; returns -1 if s1<s2,
0 if s1=s2, 1 if s1>s2 */
signed int8 memcmp(void * s1,char
*s2,size_t n)
{
char *su1, *su2;
for(su1=s1, su2=s2; 0<n; ++su1,
++su2, --n)
60. 50
{
if(*su1!=*su2)
return ((*su1<*su2)?-1:+1);
}
return 0;
}
/* standard template: int strcmp(const
char *s1, const char *s2).
Compares s1 & s2; returns -1 if s1<s2,
0 if s1=s2, 1 if s1>s2 */
signed int8 strcmp(char *s1, char *s2)
{
for (; *s1 == *s2; s1++, s2++)
if (*s1 == '0')
return(0);
return((*s1 < *s2) ? -1: 1);
}
/* standard template: int strcoll(const
char *s1, const char *s2).
Compares s1 & s2; returns -1 if s1<s2,
0 if s1=s2, 1 if s1>s2 */
signed int8 strcoll(char *s1, char *s2)
{
for (; *s1 == *s2; s1++, s2++)
If (*s1 == '0')
Return (0);
Return ((*s1 < *s2)? -1: 1);
}
/* standard template:
in strncmp(const char *s1, const char
*s2, size_t n).
Compares max of n characters (not
following 0) from s1 to s2;
returns same as strcmp */
signed int8 strncmp(char *s1, char *s2,
size_t n)
{
for (; n > 0; s1++, s2++, n--)
if (*s1 != *s2)
return((*s1 <*s2) ? -1: 1);
else if (*s1 == '0')
return(0);
return(0);
}
/* standard template:
int strxfrm(const char *s1, const char
*s2, size_t n).
transforms maximum of n characters
from s2 and places them into s1*/
sizet strxfrm(char *s1, char *s2, size_t
n)
{
char *s;
unsigned int8 n1;
n1=n;
61. 51
for (s = s1; n > 0 && *s2 != '0'; n--)
*s++ = *s2++;
for (; n > 0; n--)
*s++ = '0';
return(n1);
}
/*Search functions*/
/* standard template: void
*memchr(const char *s, int c).
Finds first occurrence of c in n
characters of s */
char *memchr(void *s,unsigned int8
c,size_t n)
{
char uc;
char *su;
uc=c;
for(su=s;0<n;++su,--n)
if(*su==uc)
return su;
return NULL;
}
/* standard template: char *strchr(const
char *s, int c).
Finds first occurrence of c in s */
char *strchr(char *s, unsigned int8 c)
{
for (; *s != c; s++)
if (*s == '0')
return(0);
return(s);
}
/* standard template:
size_t strcspn(const char *s1, const
char *s2).
Computes length of max initial
segment of s1 that consists entirely of
characters NOT from s2*/
unsigned int8 strcspn(char *s1, char
*s2)
{
char *sc1, *sc2;
for (sc1 = s1; *sc1 != 0; sc1++)
for (sc2 = s2; *sc2 != 0; sc2++)
if (*sc1 == *sc2)
return(sc1 - s1);
return(sc1 - s1);
}
/* standard template:
char *strpbrk(const char *s1, const char
*s2).
Locates first occurence of any character
from s2 in s1;
returns s1 if s2 is empty string */
char *strpbrk(char *s1, char *s2)
62. 52
{
char *sc1, *sc2;
for (sc1 = s1; *sc1 != 0; sc1++)
for (sc2 = s2; *sc2 != 0; sc2++)
if (*sc1 == *sc2)
return(sc1);
return(0);
}
/* standard template: char
*strrchr(const char *s, int c).
Finds last occurrence of c in s */
char *strrchr(char *s, unsigned int8 c)
{
char *p;
for (p = 0; ; s++)
{
if (*s == c)
p = s;
if (*s == '0')
return(p);
}
}
/* computes length of max initial
segment of s1 consisting
entirely of characters from s2 */
unsigned int8 strspn(char *s1, char
*s2)
{
char *sc1, *sc2;
for (sc1 = s1; *sc1 != 0; sc1++)
for (sc2 = s2; ; sc2++)
if (*sc2 == '0')
return(sc1 - s1);
else if (*sc1 == *sc2)
break;
return(sc1 - s1);
}
/* standard template:
char *strstr(const char *s1, const char
*s2);
Locates first occurence of character
sequence s2 in s1;
returns 0 if s2 is empty string
Uncomment
#define FASTER_BUT_MORE_ROM
at the top of the file to use the faster
algorithm */
char *strstr(char *s1, char *s2)
{
char *s, *t;
#ifdef FASTER_BUT_MORE_ROM
if (*s2 == '0')
return(s1);
#endif
63. 53
while (*s1)
{
for(s = s1, t = s2; *t && (*s == *t);
++s, ++t);
if (*t == '0')
return s1;
++s1;
#ifdef FASTER_BUT_MORE_ROM
while(*s1 != '0' && *s1 != *s2)
++s1;
#endif
}
return 0;
}
/* standard template: char *strtok(char
*s1, const char *s2).
Finds next token in s1 delimited by a
character from separator
string s2 (which can be different from
call to call). First call
starts at beginning of s1 searching for
first character NOT
contained in s2; returns 0 if none is
found.
If one is found, it is the start of first
token (return value).
Function then searches from there for a
character contained in s2.
If none is found, current token extends
to end of s1, and subsequent
searches for a token will return 0. If
one is found, it is
overwritten by '0', which terminates
current token. Function saves
pointer to following character from
which next search will start.
Each subsequent call, with 0 as first
argument, starts searching
from saved pointer */
char *strtok(char *s1, char *s2)
{
char *beg, *end;
static char *save;
02EB: BCF 03.6
02EC: CLRF 20
02ED: CLRF 21
beg = (s1)? s1: save;
beg += strspn(beg, s2);
if (*beg == '0')
{
*save = ' ';
return(0);
}
end = strpbrk(beg, s2);
if (*end != '0')
64. 54
{
*end = '0';
end++;
}
save = end;
return(beg);
}
/*Miscellaneous functions*/
/* standard template
maps error number in errnum to an
error message string
Returns: Pointer to string
*/
#ifdef _ERRNO
char * strerror(unsigned int8 errnum)
{
char s[15];
switch( errnum)
{
case 0:
strcpy(s,"no errors");
return s;
case EDOM :
strcpy(s,"domain error");
return s;
case ERANGE:
strcpy(s,"range error");
return s;
}
}
#ENDIF
/* standard template: size_t strlen(const
char *s).
Computes length of s1 (preceding
terminating 0) */
unsigned int8 strlen(char *s)
{
char *sc;
for (sc = s; *sc != 0; sc++);
return(sc - s);
}
/* standard template: size_t
stricmp(const char *s1, const char *s2).
Compares s1 to s2 ignoring case (upper
vs. lower) */
signed int8 stricmp(char *s1, char *s2)
{
for(;
*s1==*s2||(isalpha(*s1)&&isalpha(*s2)
&&(*s1==*s2+32||*s2==*s1+32));
s1++, s2++)
if (*s1 == '0')
return(0);
return((*s1 < *s2) ? -1: 1);