Attribution Non-Commercial (BY-NC)

89 views

Attribution Non-Commercial (BY-NC)

- 05 Matlab Graphics
- An Innovations Approach to Fault Detection and Diagnosis in Dynamic Systems
- NAVIS DPS
- Assignment 2
- MinhoTeam2016 - Team Description Paper
- syllabus
- TRN-4010-003-02_SG-Ins_Exc_EN
- PAST 40 YEARS IIT Entrance Mathematics Problems
- Latex maths help
- Algo 2010 Fall 20
- Article 295
- Processing of GPS Data using Accuracy Enhancement Techniques for Sag Monitoring Device
- Landing on a Moving Target using an Autonomous Helicopter
- FINITE ELEMENT ROTOR
- v2n1pF
- Acoustic Tracking Using DOA Batches
- An Improvement to the QUEST Algorithm - Yang Cheng and Malcolm D. Shuster
- SigProc Fusion
- State Space Models and the Kalman Filter _ QuantStart.pdf
- Updtd Table Cont

You are on page 1of 16

Evan Flechsig

CEN 4935 Senior Software Engineering Project Dr. Janusz Zalewski U.A. Whitaker School of Engineering - Florida Gulf Coast University

April 11, 2010

Flechsig 2

1. Introduction A Kalman Filter is a theoretical device that observes measurements over time that contains noise and produces values that tend to be closer to the true values of the measurement. It does this by applying a weight to a measurement which will be high for measurements with low uncertainty and low for measurements with high uncertainty[1]. There is extensive literature on this topic. Before using a Kalman Filter, the behavior of the system that we are measuring must be described by a linear system [2][4][6]. A linear system is described by these two equations: State equation and Output equation. The State equation and Output equation are

is the time

respectively; and

Once the linear system is defined, we must define the process noise and measurement noise covariance. Being that noise are random, we must tell the filter how we expect this

noise to change, that is, what are the statistical properties of noise. Once these are defined, we can look at the filter equations. For the linear system described above, the Kalman Filter equations are as follows:

Flechsig 3

(1) (2) (3) Equation number one is the Kalman Gain equation, number two is the state estimate equation, and number three is the estimate error covariance equation. In equation number two, there are two terms:

The first term represents what the state of the system would be if we didnt have a measurement. This means that we are assuming the system is acting just as the system model defines. The second term of equation two is called the correction term, where it uses the Kalman Gain to correct the assumed state due to our measurement. In equation number one, its generating a value for the Kalman Gain. If the measurement noise is large, K will have a small value and will not give much weight to the measurement in the estimation of the state. If the measurement noise is small, K will be large and the measurement will be giving large weight when estimating the state. [4]

2. Sine Wave Noise Example The first example is running a Kalman Filter in LabVIEW that removes Gaussian noise from a signal that replicates a sine wave. The block diagram for this virtual instrument can be seen in Figure 2.1. Matrix A, B, and C define the state-space model and can be found in the red square labeled 1. In this example, the matrices are as follows:

Flechsig 4

How to obtain the A, B, and C matrices will be explained more in the next example. D is left as all zeros because the inputs and the outputs have no relation. Next the auto covariance matrices of the process noise (Q) and the measurement noise (R) must be defined for the Kalman Gain seen in the purple box labeled 3. They are used to determine how the process and measurement noise change from one time interval to the next and are defined using the three knobs on the front panel. We now have the inputs required to generate a Kalman Gain seen in the green box labeled 5. This is passed to a multiple state estimator seen in the blue box labeled 4 which is set to accept a system with noise along with the state-space model. Near the bottom middle of the block diagram in a yellow box labeled 2, there are three Gaussian noise generators along with two sine generators. The three noise generators take the integer 400 as an input, which is the number of samples of the Gaussian noise pattern. The noise generators also need to have a standard deviation defined. The first, second, and third noise generator use , , and

respectively for their standard deviation. The two sine waves both take 5 as their amplitude. To differentiate between the two waves, one is given a phase of 90. Now both the estimated model and the inputs with noise go into a state-space linear simulator seen to the right of the yellow box. This then outputs out to a state trajectory graph.

Flechsig 5

Figure 2.2 shows the outputted trajectory graph that is generated by both sine waves and their corrected estimates after filtering the noise. It is difficult to see the corrections from the filter; however you can see the corrections in Figure 2.3 that shows a section to a larger scale. The darker blue is the model with noise while the lighter blue is the model after filtering.

Flechsig 6

3. Constant Acceleration Example As mentioned before, the Kalman Gain estimator requires a definition the state-space model for the system. To do this, the system behavior must be known. For example, if a vehicles acceleration was being measure and the position needed to be computed, two equations are required: one to calculate velocity and the other to calculate position. The expression to derive velocity is as follows: (1) The variable is the time index, is how often the position is measured, is the command

acceleration, and

is the velocity noise. That is, the velocity one time-step from now (

seconds from now) will be equal to the current velocity plus the command acceleration multiplied by . The equation for position is as follows: (2) The variable is the time index, is how often the position is measured, is the command

acceleration, and

is the position noise. Once both the position and velocity are defined, the

state vector which includes position and velocity can also be defined as follows:

Flechsig 7

The matrix

outputs and the states. When both input and output equations have been defined, the matrices describing the system are inputted on the front panel of the virtual instrument in LabVIEW. The filter should consider the measurement every half second, so is equal to .5. Therefore, once substituting T,

we can calculate matrix A and matrix B. Matrix G is used to describe the relationship between the process noise vector and the model states and remains the same from the previous example. Matrix D is kept as all zeros because there is no transmission between the input and the output in this case. After these conclusions, we have the following values:

Flechsig 8

The three knobs seen in the red box labeled 1 in Figure 3.4 are used to define the process noise (State 1 & 2 Noise Variance) and the measurement noise (Output Noise variance). They are knobs because they can be changed during the simulation. The matrices are defined in the blue box labeled 2. The output of the linear simulation is seen in the green box labeled 3.

The input that is being simulated is constant acceleration, meaning, a constant input. To simulate this input, Ive defined an array of 1s in used this as an input for the Linear Simulation module. This can be seen in the block diagram shown in Figure 3.5 in the red box labeled 1.These acceleration readings are also injected with Gaussian noise using a logical AND operator seen in the blue box labeled 2. The Linear Simulation module takes the estimated model and these inputs, and graphs them on a State Trajectory Graph as seen in Figure 9.4. The lines curve us, which is consistent with the position of an object with constant acceleration over time.

Flechsig 9

A close up of the trajectory graph can be seen in Figure 3.6. The dark blue and Red lines represent two different instances of the constant acceleration. The light blue and the gray lines represent the filers estimate of the dark blue and reds behavior respectively.

Flechsig 10

The difference may be difficult to see, so there is a blown version of the graph as Figure 3.7. This cut is from 2.6(s) to 4.6(s)

4. Conclusion The Kalman Filter is a very strong tool to use when filtering out noise in a signal. Once youve defined how the system is supposed to work, being able to define whether or not the next measurement should have high or low weight is very valuable. Its application is not limited to simple signals either. It can be expanded to use in CMOS sensors used for capturing light and generating pictures or even sensing changes on a blog[5]. Future work for this project would include application of the filter behind an actual sensor. The Kalman Filter was initially developed for aeronautical flight, so perhaps this could be used to filter out noise from the altimeter in a satellite. It could also be used to filter out noise from a temperature or moister sensor that is taking readings in remote locations. It would be

Flechsig 11

helpful to have these values filtered because unexpected noise is likely when dealing with remote sensors in environments that arent controlled.

Flechsig 12

Appendix. Instructions for Using a Kalman Filter in LabVIEW. 0. Before starting, you need to know how to describe your linear system. For an explanation, see Kalman Filter in LabVIEW section 9.0 and 9.2.[3] 1. Launch LabVIEW (these instructions are based on LabVIEW 8.5). 2. Open the VI which is an example that should be in the installation directory for LabVIEW. Be default, it is C:\Program Files\National

Instruments\LabVIEW 8.5\examples\Control Design\Getting Started\State-Space Synthesis\CDEx Kalman Filter.vi. Open this VI. It

may take some time to load because some dependencies also have to be loaded.

Flechsig 13

3. Once loaded, you should see a window similar to the one shown in Figure 1. This is the front panel to the virtual instrument and is where you enter values for your variables. Enter the matrices A, B, C, D and G into their respective boxes located near the top left of the VI.

Figure 1 Front Panel of the default Kalman Filter example. 4. Once these matrices are defined properly, open up the Block Diagram by going to Window > Show Block Diagram.

Flechsig 14

5. You should then see a block diagram shown in Figure 2. Once here, youll need to change the read inputs of the system which are the sine wave generators located in the red box labeled 1. This means that the Kalman device is filtering out noise from two of sine waves. If you mouse over the yellow wire coming out of the sine wave generators, youll see in the Context Help window1 that its outputting a 1-D array of doubles. The waves are supposed to deliver the data to the linear simulator, which produces the system outputs (both the actual disturbed by noise and filtered).

Figure 2 - Default Kalman Filter Block Diagram 6. The three blocks above the sine wave generators shown in Figure 2 are the Gaussian noise generators. They will not be necessary for real work input because the data sets already theoretically have noise in them. For the purposes of this demonstration, well be inputting an array of 1s to represent constant acceleration. Right click in a white space

1

The Context Help window can be brought up by clicking on the yellow question mark that appears in the right upper corner of the Block Diagram or Front Panel.

Flechsig 15

where you want to array to be on the block diagram and select Programming > Array > Array constant. Then, fill the newly generated box with a double variable and make the array all 1s. Delete the two sine wave generators and wire your array to both of the AND operators shown on the right side of the blue box labeled 2 in Figure 3. Then change the number of samples in the Gaussian noise generator from 400 to the length of your double array. This reconfiguration of the block diagram is shown in Figure 3.

Figure 3 Block diagram after modifications 7. Once you have your input, return to the front panel of the VI and click the Run-Once button under the View item in the tool bar. This will begin the simulation of your

system. Being that the body of this VI is within a while loop, the filter is going to run continuously for many instances of the input and output the results on the graph. If your data include the noise, your graph will not change as the noise will remain the same for the same set of data points. In this example, I keep the Gaussian noise (represented in the blue box labeled 2 in Figure 3), which is random and is generated for every iteration of the while loop.

Flechsig 16

Figure 4 shows the output, which is the position of the system with respect to time. The shape of the curve confirms the theory, because the position is a quadratic function of time (see equation 1 on page 6)

References

[1]

G. Welch and G. Bishop, An Introduction to the Kalman Filter. North Carolina: University of North Carolina at Chapel Hill, 2006.

[2]

D. Hatfield, Fault Detection Using the Kalman Filter. Florida Gulf Coast University. 2008.

[3]

E. Flechsig, Kalman Filter in LabVIEW. Florida Gulf Coast University. April 6, 2010

[4] [5]

D. Simon, Kalman Filtering. Embedded Systems Programming. June 2001. P. Bogan, J. Johnston, U. Karadkar, R. Furuta, F. Shipman Application of Kalman Filters to Identify Unexpected Change in Blogs. Texas A&M University.2008. D. Simon, Optimal State Estimation Kalman, H, and Non linear Approaches. Wiley-Interscience. June 23, 2006

[6]

- 05 Matlab GraphicsUploaded byOmed Ghareb
- An Innovations Approach to Fault Detection and Diagnosis in Dynamic SystemsUploaded byAryeh Marks
- NAVIS DPSUploaded bydmzoly
- Assignment 2Uploaded byBen Reich
- MinhoTeam2016 - Team Description PaperUploaded byPedro Osório
- syllabusUploaded byViren Singh
- TRN-4010-003-02_SG-Ins_Exc_ENUploaded byAnonymous KMWzXegk
- PAST 40 YEARS IIT Entrance Mathematics ProblemsUploaded byApex Institute
- Latex maths helpUploaded byletter_ashish4444
- Article 295Uploaded bycontact_egypt2
- Processing of GPS Data using Accuracy Enhancement Techniques for Sag Monitoring DeviceUploaded byEditor IJRITCC
- Landing on a Moving Target using an Autonomous HelicopterUploaded bysyedasimhussain
- Algo 2010 Fall 20Uploaded byAi Chung
- FINITE ELEMENT ROTORUploaded byjames
- v2n1pFUploaded byBasim Ali
- Acoustic Tracking Using DOA BatchesUploaded byuranub
- An Improvement to the QUEST Algorithm - Yang Cheng and Malcolm D. ShusterUploaded byalvaroroman92
- SigProc FusionUploaded byRahul Mohan
- State Space Models and the Kalman Filter _ QuantStart.pdfUploaded bycicciomessere
- Updtd Table ContUploaded byIonut Stanciu
- ISC PROGRAM ON JAVA BY SUBHASHISUploaded bysubhashissohail
- Syllabus IITJEE 2012Uploaded byshitajit
- Editorial 2Uploaded byEnes Şavlı
- Electronic Differential Control With Vehicle State Observer Based on Extended Kalman FilterUploaded byQuan Nguyen Duc
- Rr410101 Computer Aided Analysis DesignUploaded bySrinivasa Rao G
- 07 Rr320203 Modelling of Power System ComponentsUploaded byandhracolleges
- Syllabus for the entrance test for PGPBA.docxUploaded bySushrut Kulkarni
- Activity1 PadillaUploaded byMelric Lamparas
- Physics SyllabusUploaded bySanjeev Kumar
- Jee SyllabusUploaded byYash Khandelwal

- Prims vs KruskalUploaded byBhaiya Ji
- L11 Hermite Bicubic Surface PatchUploaded byAnonymous dGnj3bZ
- Cipher ProgramsUploaded byAhmed Ahmed
- microsoft-machine-learning-algorithm-cheat-sheet-v2.pdfUploaded byamitag007
- Theory Practice Cryptography Network Security all 13Uploaded byAstrohanuman
- ps5sol (1)Uploaded byalice1996121
- Fundamental Data Structures.pdfUploaded byRajeshRajan
- quantum computingUploaded byGuy Dauda
- Fast Mapping Method based on Matrix Approach For Elliptic Curve CryptographyUploaded byInternational Journal of Information and Network Security (IJINS)
- Case Study 21Uploaded byBrandon Sharmakel
- backtracking (1)Uploaded byRishi Upadhyay
- Emgt5220 c9 TlUploaded bymike j
- R05 Time Value of Money IFT Notes.pdfUploaded byAbbas
- MCMC-UseRUploaded byAlex Din
- TEST PearsonsUploaded byazertytyty000
- 10.1.1.104.8082Uploaded bysuser
- Module-3Uploaded byvishek kumar
- chapter 9 study guideUploaded byapi-299844682
- Intro ScryptographyUploaded byThien Khiem Nguyen
- MUltimedia compression techniques question paperUploaded byPurush Jayaraman
- System Identification for ControlUploaded bymacbeth78
- Inverted FileUploaded bykidoseno85
- Computer-Controlled Systems 3rd Ed-97--Astrom - Solutions-p124.pdfUploaded bySydmar Serpa
- Holt WintersUploaded byarnabpramanik
- (Zitzler 's Thesis)Multiobjective OptimizationUploaded bybm24
- Artificial Neural Networks for BeginnersUploaded byVarthini Raja
- Lab Manual of LcsUploaded byEngr Muhammad Talha Islam
- franson-021815Uploaded byBvkas Tmalcna
- STEGANOGRAPHY- An Art of Hiding Digital InformationUploaded byDivya Singhvi
- 10.1109@TSSA.2017.8272896Uploaded byCarlos Bcar