wind based measurement and uncertainity using kalman filtering

70
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

Upload: prasanna-nataraj

Post on 06-May-2015

356 views

Category:

Education


2 download

DESCRIPTION

my project document

TRANSCRIPT

Page 1: wind based measurement and uncertainity using kalman filtering

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

Page 2: wind based measurement and uncertainity using kalman filtering

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

Page 3: wind based measurement and uncertainity using kalman filtering

ACKNOWLEDGEMENT

Page 4: wind based measurement and uncertainity using kalman filtering

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.

Page 5: wind based measurement and uncertainity using kalman filtering

CONTENTS

Page 6: wind based measurement and uncertainity using kalman filtering

ii

CONTENTS

CHAPTER

TITTLE

PAGE

NO

1. INTRODUCTION

01

2.

BLOCK DIAGRAM

03

3.

BLOCK DIAGRAM DESCRIPTION

05

4.

CIRCUIT DIAGRAM

21

5.

CIRCUIT DIAGRAM DESCRIPTION

23

6.

PCB DESIGN

32

7.

SOFTWARE TOOLS

35

8.

ADVANTAGES

37

9.

CONCLUSION

39

10.

BIBLOGRAPHY

41

11.

PROJECT ESTIMATION

43

12.

PHOTOCOPY OF KIT

45

13.

APPENDIX

47

Page 7: wind based measurement and uncertainity using kalman filtering

iii

LIST OF FIGURE

FIGURE

NO.

TITTLE

PAGE

NO

2.1 BLOCK DIAGRAM

04

3.1.2.1

PIN DIAGRAM

08

3.1.4.1

ARCHITECHTURE

10

3.2.1

WIND MILL LAYOUT

14

3.2.1.1

WIND SENSOR

18

3.3.1

DC MOTOR

20

4.1

CIRCUIT DIAGRAM

22

5.1..1

POWER SUPPLY

24

5.2.1

LCD CIRCUIT DIAGRAM

26

5.2.3.1

16*2 LCD DISPLAY

28

5.2.6.1.1.

INTERFACE

29

5.3.1

RELAY

31

12.1

PHOTOCOPY OF KIT

46

Page 8: wind based measurement and uncertainity using kalman filtering

ABSTRACT

Page 9: wind based measurement and uncertainity using kalman filtering

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.

Page 10: wind based measurement and uncertainity using kalman filtering

INTRODUCTION

Page 11: wind based measurement and uncertainity using kalman filtering

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.

.

Page 12: wind based measurement and uncertainity using kalman filtering

BLOCK DIAGRAM

Page 13: wind based measurement and uncertainity using kalman filtering
Page 14: wind based measurement and uncertainity using kalman filtering

BLOCK DIAGRAM DESCRIPTION

Page 15: wind based measurement and uncertainity using kalman filtering

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.

Page 16: wind based measurement and uncertainity using kalman filtering

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.

Page 17: wind based measurement and uncertainity using kalman filtering
Page 18: wind based measurement and uncertainity using kalman filtering

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.

Page 19: wind based measurement and uncertainity using kalman filtering
Page 20: wind based measurement and uncertainity using kalman filtering

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

Page 21: wind based measurement and uncertainity using kalman filtering

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.

Page 22: wind based measurement and uncertainity using kalman filtering

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.

Page 23: wind based measurement and uncertainity using kalman filtering
Page 24: wind based measurement and uncertainity using kalman filtering

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.

Page 25: wind based measurement and uncertainity using kalman filtering

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.

Page 26: wind based measurement and uncertainity using kalman filtering

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..

Page 27: wind based measurement and uncertainity using kalman filtering
Page 28: wind based measurement and uncertainity using kalman filtering

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.

Page 29: wind based measurement and uncertainity using kalman filtering
Page 30: wind based measurement and uncertainity using kalman filtering

CIRCUIT DIAGRAM

Page 31: wind based measurement and uncertainity using kalman filtering

22

4.CIRCUIT DIAGRAM

FIG.4.1 CIRCUIT DIAGRAM

1 K

COMM

12

22PF

1

WINDMILL

+5 Vcc

0

P1

CONNECTOR DB9

594837261

15

RB6

6

LED

+

1

+5 VCC

10 K45

RELAY 6 V /5 A

35

412

16

+5 VCC

+5 Vcc

BT1

BATTERY

12

1N4007

12

13

+5 VCC

2

2.2 MF

O/P

1 K

+

2.2 MF

BC 187

U3

MOC7811

3

1 4

2

+5 Vcc

+5 Vcc4

SPEEDSENSOR

1 K

1 K

1 K

16 /2 LCD

16 m hz

11 3

MAX 232

12

14710

11

1516

138 9

13

45

26

R1OUT

T1OUTT2OUTT2IN

T1IN

GN

DV

CC

R1INR2IN R2OUT

C1+C1-

C2+C2-

V+V-

+ 2.2 MF

0

14

+

2.2 MF

10 K

PIC16F877A

234567

3334353637383940

30292827

26

31

1

16

25

12

10

13

14

11

32

89

15

1718

2019

2122

2324

RA0/AN0RA1/AN1RA2/AN2/VREF-/CVREFRA3/AN3/VREF+RA4/T0CKI/C1OUTRA5/AN4/SS/C2OUT

RB0/INTRB1RB2

RB3/PGMRB4RB5

RB6/PGCRB7/PGD

RD7/PSP7RD6/PSP6RD5/PSP5RD4/PSP4

RC7/RX/DT

GND

MCLR/VPP

RC1/T1OSI/CCP2

RC6/TX/CK

GND

RE2/CS/AN7

OSC1/CLK I

OSC2/CLKO

VDD

VDD

RE0/RD/AN5RE1/WR/AN6

RC0/T1OSO/T1CKI

RC2/CCP1RC3/SCK/SCL

RD1/PSP1RD0/PSP0

RD2/PSP2RD3/PSP3

RC4/SDI/SDARC5/SDO

2

Page 32: wind based measurement and uncertainity using kalman filtering

CIRCUIT DIAGRAM DESCRIPTION

Page 33: wind based measurement and uncertainity using kalman filtering

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 4GND

1 3VIN VOUT

0

7805

0

12V - 0 (6V)/ 500 MA

1K

- +

1N 4007BRIDGE

1

4

3

2

1N4007

+ 5 Vcc

2

TRANSFORMER

104

LED

Page 34: wind based measurement and uncertainity using kalman filtering

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.

Page 35: wind based measurement and uncertainity using kalman filtering

26

5.2.1LCD CIRCUIT DIAGRAM

FIG 5.2.1 LCD CIRCUIT DIAGRAM

10

DB0

EN VSS

10K7

0

12

9

40

VEE

0

DB2

20

DB7

11.0592

AT 89C52

31

19

18

9

12131415

12345678

3938373635343332

2122232425262728

171629301110

EA/VP

X1

X2

RESET

INT0INT1T0T1

P1.0P1.1P1.2P1.3P1.4P1.5P1.6P1.7

P0.0P0.1P0.2P0.3P0.4P0.5P0.6P0.7

P2.0P2.1P2.2P2.3P2.4P2.5P2.6P2.7

RDWR

PSENALE/P

TXDRXD

121mf

DB3

DB6

+5V

RS

14

DB4

154

LOR/W

38

VCC

0

11DB5

6

LCD JHD 162A

DB1

HI

2

13

POT

Page 36: wind based measurement and uncertainity using kalman filtering

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.

Page 37: wind based measurement and uncertainity using kalman filtering
Page 38: wind based measurement and uncertainity using kalman filtering
Page 39: wind based measurement and uncertainity using kalman filtering

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

Page 40: wind based measurement and uncertainity using kalman filtering
Page 41: wind based measurement and uncertainity using kalman filtering

PCB DESIGN

Page 42: wind based measurement and uncertainity using kalman filtering

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.

Page 43: wind based measurement and uncertainity using kalman filtering

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.

Page 44: wind based measurement and uncertainity using kalman filtering

SOFTWARE TOOLS

Page 45: wind based measurement and uncertainity using kalman filtering

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.

Page 46: wind based measurement and uncertainity using kalman filtering

ADVANTAGES

Page 47: wind based measurement and uncertainity using kalman filtering

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

Page 48: wind based measurement and uncertainity using kalman filtering

CONCLUSION

Page 49: wind based measurement and uncertainity using kalman filtering

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

Page 50: wind based measurement and uncertainity using kalman filtering

BIBLIOGRAPHY

Page 51: wind based measurement and uncertainity using kalman filtering

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

Page 52: wind based measurement and uncertainity using kalman filtering

PROJECT ESTIMATION

Page 53: wind based measurement and uncertainity using kalman filtering

44

11.PROJECT ESTIMATION

S.NO

DESCRIPTION

QTY

COST

1.

POWER SUPPLY

1

500

2.

DC MOTOR

1

220

3.

MICROCONTROLLER

1

2000

4.

LCD DISPLAY

1

1000

5.

BATTERY

1

250

6.

DC-DC CONVERTOR

1

500

7.

PROGRAMMING

-

1500

8.

RELAY

1

30

TOTAL

RS.6000/-

Page 54: wind based measurement and uncertainity using kalman filtering

PHOTO COPY OF KIT

Page 55: wind based measurement and uncertainity using kalman filtering
Page 56: wind based measurement and uncertainity using kalman filtering

APPENDIX

Page 57: wind based measurement and uncertainity using kalman filtering

48

13.CODING FOR PIC CONTROLLER

0000: MOVLW 02

0001: MOVWF 0A

0002: GOTO 2CB

0003: NOP

#include<16f882.h>

ADC=10

#use delay(clock=16000000)

004F: MOVLW 35

0050: MOVWF 04

0051: BCF 03.7

0052: MOVF 00,W

0053: BTFSC 03.2

0054: GOTO 063

0055: MOVLW 05

0056: MOVWF 78

0057: CLRF 77

0058: DECFSZ 77,F

0059: GOTO 058

005A: DECFSZ 78,F

005B: GOTO 057

005C: MOVLW 2E

005D: MOVWF 77

005E: DECFSZ 77,F

005F: GOTO 05E

0060: GOTO 061

0061: DECFSZ 00,F

0062: GOTO 055

0063: RETLW 00

#use

rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7)

#fuses put,hs,nobrownout

#define reset PIN_b0

#define read_write PIN_b1

#define enable PIN_b2

#define relay PIN_c0

#include<lcd.h>

#include<string.h>

#ifndef _STRING

#define _STRING

#include <stddef.h>

#ifndef _STDDEF

#define _STDDEF

#if sizeof(unsigned int8 *)==1

#define ptrdiff_t unsigned int8

#else

#define ptrdiff_t unsigned int16

#endif

#define size_t unsigned int8

Page 58: wind based measurement and uncertainity using kalman filtering

48

#define wchar_t char

#define NULL 0

#define offsetof(s,f) (offsetofbit(s,f)/8)

#endif

#include <ctype.h>

#ifndef _CTYPE

#define _CTYPE

#define

islower(x) isamong(x,"abcdefghijklmnopqrstuvwxyz")

#define

isupper(x) isamong(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZ")

#define

isalnum(x) isamong(x,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")

#define

isalpha(x) isamong(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")

#define

Isdigit(x) isamong(x,"0123456789")

#define isspace(x) ((x)==' ')

#define

isxdigit(x) isamong(x,"0123456789ABCDEFabcdef")

#define iscntrl(x) ((x)<' ')

#define isprint(x) ((x)>=' ')

#define isgraph(x) ((x)>' ')

#define

ispunct(x) (((x)>' ')&&!isalnum(x))

#endif

{

char *sc1;

char *sc2;

sc1=s1;

sc2=s2;

if(sc2<sc1 && sc1 <sc2 +n)

for(sc1+=n,sc2+=n;0<n;--n)

*sc1=*--sc2;

Else

for(;0<n;--n)

*sc1++=*sc2++;

return s1;

}

*spaces */

#define strcopy strcpy

charstrncpy(char *s1, char *s2, size_t n)

{

Page 59: wind based measurement and uncertainity using kalman filtering

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)

Page 60: wind based measurement and uncertainity using kalman filtering

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;

Page 61: wind based measurement and uncertainity using kalman filtering

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)

Page 62: wind based measurement and uncertainity using kalman filtering

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

Page 63: wind based measurement and uncertainity using kalman filtering

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')

Page 64: wind based measurement and uncertainity using kalman filtering

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);

Page 65: wind based measurement and uncertainity using kalman filtering

55

}

/* standard template: char *strlwr(char *s).

Replaces uppercase letters by lowercase;

returns pointer to new string s */

char *strlwr(char *s)

{

char *p;

for (p = s; *p != '\0'; p++)

if (*p >= 'A' && *p <='Z')

*p += 'a' - 'A';

return(s);

}

#endif

void lcd_init();

void lcd_com(unsigned char a1);

void lcd_data(unsigned char a2);

void lcd_puts(unsigned char st);

void lcd_com(unsigned char a1)

{

unsigned char temp;

temp=a1;

*

0064: MOVF 33,W

0065: MOVWF 34

temp=temp&0xf0;

0066: MOVLW F0

0067: ANDWF 34,F

output_b(temp);

0068: BSF 03.5

0069: CLRF 06

006A: BCF 03.5

006B: MOVF 34,W

006C: MOVWF 06

output_low(reset);

006D: BSF 03.5

006E: BCF 06.0

006F: BCF 03.5

0070: BCF 06.0

output_low(read_write);

0071: BSF 03.5

0072: BCF 06.1

0073: BCF 03.5

0074: BCF 06.1

delay_ms(1);

0075: MOVLW 01

0076: MOVWF 35

0077: CALL 04F

output_high(enable);

0078: BSF 03.5

0079: BCF 06.2

Page 66: wind based measurement and uncertainity using kalman filtering

56

007A: BCF 03.5

007B: BSF 06.2

delay_ms(1);

007C: MOVLW 01

007D: MOVWF 35

007E: CALL 04F

output_low(enable);

007F: BSF 03.5

0080: BCF 06.2

0081: BCF 03.5

0082: BCF 06.2

temp=a1<<4;

0083: SWAPF 33,W

0084: MOVWF 34

0085: MOVLW F0

0086: ANDWF 34,F

temp=temp&0xf0;

0087: ANDWF 34,F

output_b(temp);

0088: BSF 03.5

0089: CLRF 06

008A: BCF 03.5

008B: MOVF 34,W

008C: MOVWF 06

output_low(reset);

008D: BSF 03.5

008E: BCF 06.0

008F: BCF 03.5

0090: BCF 06.0

output_low(read_write);

0091: BSF 03.5

0092: BCF 06.1

0093: BCF 03.5

0094: BCF 06.1

delay_ms(1);

0095: MOVLW 01

0096: MOVWF 35

0097: CALL 04F

output_high(enable);

0098: BSF 03.5

0099: BCF 06.2

009A: BCF 03.5

009B: BSF 06.2

delay_ms(1);

009C: MOVLW 01

009D: MOVWF 35

009E: CALL 04F

output_low(enable);

009F: BSF 03.5

00A0: BCF 06.2

00A1: BCF 03.5

00A2: BCF 06.2

Page 67: wind based measurement and uncertainity using kalman filtering

57

delay_ms(1);

00A3: MOVLW 01

00A4: MOVWF 35

00A5: CALL 04F

}

023D: MOVF 2F,W

023E: MOVWF 33

023F: CLRF 36

0240: MOVLW 0A

0241: MOVWF 35

0242: CALL 12B

0243: MOVF 79,W

0244: MOVWF 30

0245: MOVF 78,W

0246: MOVWF 2F

l=j%10;

0247: MOVF 2E,W

0248: MOVWF 34

0249: MOVF 2D,W

024A: MOVWF 33

024B: CLRF 36

024C: MOVLW 0A

024D: MOVWF 35

024E: CALL 12B

024F: MOVF 77,W

0250: MOVWF 31

0251: MOVF 7A,W

0252: MOVWF 32

j=j/100;

0253: MOVF 2E,W

0254: MOVWF 34

0255: MOVF 2D,W

0256: MOVWF 33

0257: CLRF 36

0258: MOVLW 64

0259: MOVWF 35

025A: CALL 12B

025B: MOVF 79,W

025C: MOVWF 2E

025D: MOVF 78,W

025E: MOVWF 2D

i=i|0x30;

025F: MOVLW 30

0260: IORWF 2B,F

j=j|0x30;

0261: IORWF 2D,F

k=k|0x30;

0262: IORWF 2F,F

l=l|0x30;

0263: IORWF 31,F

lcd_com(add);

0264: MOVF 2A,W

Page 68: wind based measurement and uncertainity using kalman filtering

58

0265: MOVWF 33

0266: CALL 064

// lcd_data(i);

lcd_data(j);

0267: MOVF 2D,W

0268: MOVWF 33

0269: CALL 0E4

lcd_data('.');

026A: MOVLW 2E

026B: MOVWF 33

026C: CALL 0E4

lcd_data(k);

026D: MOVF 2F,W

026E: MOVWF 33

026F: CALL 0E4

lcd_data(l);

0270: MOVF 31,W

0271: MOVWF 33

0272: CALL 0E4

}

void conversion2(int16 count,int disp)

{

int16 i,j,k,l;

i=count/1000;

0150: MOVF 29,W

0151: MOVWF 34

0152: MOVF 28,W

0153: MOVWF 33

0154: MOVLW 03

0155: MOVWF 36

0156: MOVLW E8

0157: MOVWF 35

0158: CALL 12B

0159: MOVF 79,W

0164: MOVWF 35

0165: CALL 12B

0166: MOVF 77,W

0167: MOVWF 2D

0168: MOVF 7A,W

0169: MOVWF 2E

k=j%100;

016A: MOVF 2E,W

016B: MOVWF 34

016C: MOVF 2D,W

016D: MOVWF 33

016E: CLRF 36

016F: MOVLW 64

0170: MOVWF 35

0171: CALL 12B

0172: MOVF 77,W

0173: MOVWF 2F

0174: MOVF 7A,W

Page 69: wind based measurement and uncertainity using kalman filtering

59

0175: MOVWF 30

k=k/10;

0176: MOVF 30,W

0177: MOVWF 34

0178: MOVF 2F,W

0179: MOVWF 33

017A: CLRF 36

017B: MOVLW 0A

017C: MOVWF 35

017D: CALL 12B

017E: MOVF 79,W

017F: MOVWF 30

0180: MOVF 78,W

0181: MOVWF 2F

i=i|0x30;

019A: MOVLW 30

019B: IORWF 2B,F

j=j|0x30;

019C: IORWF 2D,F

k=k|0x30;

019D: IORWF 2F,F

l=l|0x30;

019E: IORWF 31,F

lcd_com(disp);

019F: MOVF 2A,W

01A0: MOVWF 33

01A1: CALL 064

// lcd_data(i);

lcd_data(j);

01A2: MOVF 2D,W

01A3: MOVWF 33

01A4: CALL 0E4

lcd_data(k);

01A5: MOVF 2F,W

01A6: MOVWF 33

01A7: CALL 0E4

lcd_data(l);

01A8: MOVF 31,W

01A9: MOVWF 33

01AA: CALL 0E4

}

01AB: RETLW 00

Configuration Fuses:

Word 1: 2CE2 HS NOWDT PUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG

Word 2: 3FFF NOWRT BOR

Page 70: wind based measurement and uncertainity using kalman filtering

60