Go to Post If it's not on fire, it's a software problem. - Matt Leese [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-09-2008, 22:29
nickmagus's Avatar
nickmagus nickmagus is offline
Registered User
AKA: Nick Clayton
FRC #0008 (Paly Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Palo Alto, Califorinia
Posts: 56
nickmagus is an unknown quantity at this point
Send a message via AIM to nickmagus
Kalman Filters

hey along with several other elements of control theory I have been researching Kalman Filters. I believe they could be useful on a first robot however i have not yet found an explanation that contains only mathamatics at my level (BC Calculus). So while i understand some of the material i dont understand quite enough to implement one. does anyone know enough about kalman filters to help me out.
  #2   Spotlight this post!  
Unread 03-09-2008, 22:31
R.C.'s Avatar
R.C. R.C. is offline
2017... Oooh Kill em, Swerve!
AKA: Owner, WestCoast Products
FRC #1323 (MadTown Robotics)
Team Role: Engineer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Madera, CA
Posts: 2,173
R.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond repute
Re: Kalman Filters

I'm in Ap Calculus and I wish I could help you, could you explain this "Kalman Filters" more.
__________________
R.C.
Owner, WestCoast Products || Twitter
MadTown Robotics Team 1323
  #3   Spotlight this post!  
Unread 03-09-2008, 22:39
=Martin=Taylor= =Martin=Taylor= is offline
run the trap!!!
FRC #0100 (The Wild Hat Society)
Team Role: Human Player
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Bezerkeley, California
Posts: 1,255
=Martin=Taylor= has a reputation beyond repute=Martin=Taylor= has a reputation beyond repute=Martin=Taylor= has a reputation beyond repute=Martin=Taylor= has a reputation beyond repute=Martin=Taylor= has a reputation beyond repute=Martin=Taylor= has a reputation beyond repute=Martin=Taylor= has a reputation beyond repute=Martin=Taylor= has a reputation beyond repute=Martin=Taylor= has a reputation beyond repute=Martin=Taylor= has a reputation beyond repute=Martin=Taylor= has a reputation beyond repute
Re: Kalman Filters

Quote:
Originally Posted by nickmagus View Post
hey along with several other elements of control theory I have been researching Kalman Filters. I believe they could be useful on a first robot however i have not yet found an explanation that contains only mathamatics at my level (BC Calculus). So while i understand some of the material i dont understand quite enough to implement one. does anyone know enough about kalman filters to help me out.
This thread has some helpful posts. Particularly that paper at the end.

Didn't understand most of it Than again, I'm pretty bad at both programming and math.
__________________
"Cooperation; because life is a team sport"
-Philip J. Fry
  #4   Spotlight this post!  
Unread 03-09-2008, 22:39
nickmagus's Avatar
nickmagus nickmagus is offline
Registered User
AKA: Nick Clayton
FRC #0008 (Paly Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Palo Alto, Califorinia
Posts: 56
nickmagus is an unknown quantity at this point
Send a message via AIM to nickmagus
Re: Kalman Filters

ya so am I. heres the top of the wikipedia article on kalman filters.

"The Kalman filter is an efficient recursive filter that estimates the state of a dynamic system from a series of incomplete and noisy measurements. Together with the linear-quadratic regulator (LQR) the Kalman filter solves the linear-quadratic-Gaussian control problem (LQG). The Kalman filter, the linear-quadratic regulator and the linear-quadratic-Gaussian controller are solutions to what probably are the most fundamental problems in control theory."
  #5   Spotlight this post!  
Unread 03-09-2008, 23:00
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
Re: Kalman Filters

...see if this is helpful...
Kalman Filtering
__________________

Don't PANIC!
S. P. A. M.
  #6   Spotlight this post!  
Unread 03-09-2008, 23:52
jee7s jee7s is offline
Texan FIRSTer, ex-frc2789, ex-frc41
AKA: Jeffrey Erickson
FRC #6357
 
Join Date: Nov 2007
Rookie Year: 1997
Location: Dripping Springs, TX
Posts: 313
jee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond repute
Re: Kalman Filters

The Kalman filter probably isn't something you'd really be ready to handle in HS.

I'm getting a Doctorate in controls, so let me see if I can put the KF in more understandable terms...

Basically, the Kalman filter finds an optimal estimator in a noisy environment, but there's a lot you'd have to know before you get to that.

First off, controls (meaning the mathematical treatment of it) takes a lot of math. I mean Differential Equations, Laplace Transforms, matrices, state space, etc. These concepts don't come up until at least a second year in college, typically. Usually students encounter controls as a fourth year engineering student, and the Kalman filter is beyond that. Personally, I didn't come across the KF until I was a second year in Grad. School.

In advanced controls, the focus isn't on the input and output...it's about what's going on inside. We call this the "State" of the system. The state can't always be measured (think about how many sensors it would take to know the acceleration, speed, and position of a wheel mounted on a motor). But, there's a little trick...if you know how the system you're working with behaves (in this case a wheel mounted to a motor), you can "estimate" the state by knowing only a small part of it.

In the case of a wheel mounted to a motor, the state is the angular speed, angular position, and current through the motor. These could all be measured, but that isn't always possible.

But, using an Estimator or Observer (the same thing) mentioned above, if you know the position, you can find an approximation of the full state. However, noise can be a problem, and the Kalman filter overcomes this by taking features of the noise, combined with features of the system to find an optimal estimator. To create one, you need to know the noise of the input, the noise of the state (noise in the system), and how the two are related to each other and within each other. I won't go any further, because at this point we get into all sorts of matrix math and probability theory that I don't want to get into at midnite.

It could be implemented for FRC, but it may not be necessary. As I have heard it put: don't use a sledge where you need a finishing hammer..it doesn't look good.

If you want to pursue KF, then I'd suggest learning about lower level controllers, like PID and Lead/Lag (WHY they work, not just how to use them), and build up to it.

Don't take this as discouragement. I hope you find plenty of fascinating control topics to study.

-Jeff Erickson, FRC 41 Mentor

P.S. if you want a book reference, check out Digital Control System Analysis and Design by Phillips and Nagle.

Last edited by jee7s : 04-09-2008 at 00:16.
  #7   Spotlight this post!  
Unread 04-09-2008, 22:38
nickmagus's Avatar
nickmagus nickmagus is offline
Registered User
AKA: Nick Clayton
FRC #0008 (Paly Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Palo Alto, Califorinia
Posts: 56
nickmagus is an unknown quantity at this point
Send a message via AIM to nickmagus
Re: Kalman Filters

hey thanks for the help and the book recommendation i got a couple of copies (cheep thanks to amazon) no chance you wanna explain a little of the math thats mostly what i was having trouble with.
  #8   Spotlight this post!  
Unread 04-09-2008, 23:09
EricH's Avatar
EricH EricH is offline
New year, new team
FRC #1197 (Torbots)
Team Role: Engineer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: SoCal
Posts: 19,726
EricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond repute
Re: Kalman Filters

Quote:
Originally Posted by nickmagus View Post
hey thanks for the help and the book recommendation i got a couple of copies (cheep thanks to amazon) no chance you wanna explain a little of the math thats mostly what i was having trouble with.
I'm a second-year college student, and I haven't had differential equations yet. If you don't have Calculus 2 (advanced integrals (including exponential and logarithmic) and series) under your belt, you probably aren't ready for what's known as "Difficult" Equations. That's next semester for me. (After Calc 3 this semester...) So if Calc BC is equivalent to Calc 2, you have a half-chance of undersanding the math. If not, you'll have to learn on the side.
__________________
Past teams:
2003-2007: FRC0330 BeachBots
2008: FRC1135 Shmoebotics
2012: FRC4046 Schroedinger's Dragons

"Rockets are tricky..."--Elon Musk

  #9   Spotlight this post!  
Unread 04-09-2008, 23:57
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
Re: Kalman Filters

Truth is, you probably won't see Kalman filters even in college - only in grad school.

jee7s already gave you a pretty good basic explanation on what a Kalman filter does, so let me tell you about your options. It's great that you're interested in an advanced topic, and I don't mean to disencourage you, but if you're taking Calculus now, there's a LONG way ahead, and you're probably better off going to college to receive a formal training.

Here's the most likely course route, after Calculus:

Linear Algebra (basic course, I wish someone told me back then how important it would be)
Differential Equations
An Applied Math course (Laplace and Fourier transforms)
Signals and Systems
Classical Control
Linear System Theory
(So-called) Modern Control - state space approach
Intro to Stochastic Processes
Optimal Control (finally you're gonna hear about the Kalman filter)

The last four courses are probably graduate level, depending on where you go to school. As you can see, you're looking at four to six years of college education. It won't be easy, but as a FIRST student you already have a competitive advantage over your future peers: to be curious as hell (and I say that from experience - not too long ago I was in your position).

Let us know if you have further questions.
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383
  #10   Spotlight this post!  
Unread 05-09-2008, 09:28
nickmagus's Avatar
nickmagus nickmagus is offline
Registered User
AKA: Nick Clayton
FRC #0008 (Paly Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Palo Alto, Califorinia
Posts: 56
nickmagus is an unknown quantity at this point
Send a message via AIM to nickmagus
Re: Kalman Filters

thanks for the help everyone.
  #11   Spotlight this post!  
Unread 05-09-2008, 10:08
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Kalman Filters

The first I heard of Kalman Filters was in articles related to the Darpa challenge ... it was my impression it was a means to process signal inputs AND combine inputs from multiple sensors (like wheel encoders plus gyro plus accelerometer) into some sort of matrix which would evaluate the most correct decision data.

From reading this thread I now understand that the Kalman Filter is a means to extract a good signal (opinion/estimate) from a noisy one - usually from ONE sensor.

Since it seems that the Kalman Filter is a very advanced topic, in First we can use simpler filtering techniques such as moving averages, throwing out "obviously bad" minimum and maximum sensor readings, and more advanced filters such as FIR and FFT. Some more discussion about filtering sensor inputs, and combining multiple sensors into decision-making software, can be found at http://www.servomagazine.com/search.php and searching for filter.

Searching for sensor fusion on the same site produces some interesting articles about combining multiple sensors to make decisions, particularly the July and August 2006 articles entitled "Autonomous Robots and Multiple Sensors".
  #12   Spotlight this post!  
Unread 05-09-2008, 17:46
Samuel H. Samuel H. is offline
Registered User
no team
 
Join Date: Dec 2005
Rookie Year: 1000
Location: World
Posts: 40
Samuel H. has a spectacular aura aboutSamuel H. has a spectacular aura about
Re: Kalman Filters

Quote:
Originally Posted by mluckham View Post
The first I heard of Kalman Filters was in articles related to the Darpa challenge ... it was my impression it was a means to process signal inputs AND combine inputs from multiple sensors (like wheel encoders plus gyro plus accelerometer) into some sort of matrix which would evaluate the most correct decision data.

From reading this thread I now understand that the Kalman Filter is a means to extract a good signal (opinion/estimate) from a noisy one - usually from ONE sensor.
Actually, because the Kalman filter is based on matrix operations, it is very flexible and can be used for varying numbers of sensors and state variables. For a comprehensive set of links see http://www.cs.unc.edu/~welch/kalman/

Last edited by Samuel H. : 06-09-2008 at 02:45.
  #13   Spotlight this post!  
Unread 05-09-2008, 18:14
Richard Wallace's Avatar
Richard Wallace Richard Wallace is offline
I live for the details.
FRC #3620 (Average Joes)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1996
Location: Southwestern Michigan
Posts: 3,628
Richard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond repute
Re: Kalman Filters

Several summers ago, a college mentor from FRC 931 built a low cost self-balancing scooter as a demonstration project while working as an intern in my lab at Emerson. His creation looked very much like one built earlier by Trevor Blackwell. Both versions employ Kalman filters to correct for drift in the tilt angle estimated by integrating a gyro's output.

While that student has gone on to pursue PhD level work since then, he had never heard of a Kalman filter before starting the project. Full comprehension of the Kalman filter's mathematical beauty requires the kind of study that previous posters in this thread have described -- and that study is rewarding for its own sake. However, you can apply what others have done without getting to that depth.

Yes, the mathematical basis for balancing an inverted pendulum really is rocket science. Be encouraged by the evidence that the math works, not intimidated by its beautiful details.
__________________
Richard Wallace

Mentor since 2011 for FRC 3620 Average Joes (St. Joseph, Michigan)
Mentor 2002-10 for FRC 931 Perpetual Chaos (St. Louis, Missouri)
since 2003

I believe in intuition and inspiration. Imagination is more important than knowledge. For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution. It is, strictly speaking, a real factor in scientific research.
(Cosmic Religion : With Other Opinions and Aphorisms (1931) by Albert Einstein, p. 97)
  #14   Spotlight this post!  
Unread 05-09-2008, 19:22
nickmagus's Avatar
nickmagus nickmagus is offline
Registered User
AKA: Nick Clayton
FRC #0008 (Paly Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Palo Alto, Califorinia
Posts: 56
nickmagus is an unknown quantity at this point
Send a message via AIM to nickmagus
Re: Kalman Filters

its true i can utilize someone else's implementation but i don't like to do that unless i at least understand their implementation myself. and typically apart from basic framework code (which is a pain) i like to implement code myself (or use code implemented by my teammates) its just hard to properly use code that you don't understand. for example i was looking at the code for an old robot fixing it up and i found the PID loop was adding the D term to the output which is exactly the opposite of what you want so i like to at least understand the basics (including the basic math) behind the code i write. Anyone can use someone else's algorithms but if they don't try to understand them they get nothing from it. so when i wrote a auto tune loop for a PID earlier this year based on zigler-nicoles it was only after reading an entire text book from a cal tech course (which was fascinating and free btw i recommend it http://www.cds.caltech.edu/~murray/a...itle=Main_Page)
  #15   Spotlight this post!  
Unread 05-09-2008, 21:31
Richard Wallace's Avatar
Richard Wallace Richard Wallace is offline
I live for the details.
FRC #3620 (Average Joes)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1996
Location: Southwestern Michigan
Posts: 3,628
Richard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond reputeRichard Wallace has a reputation beyond repute
Re: Kalman Filters

Quote:
Originally Posted by nickmagus View Post
its true i can utilize someone else's implementation but i don't like to do that unless i at least understand their implementation myself. ...
OK, so you like the beautiful details. I do too.

BTW, the former FRC 931 college mentor that I mentioned above is Brandon Heller. He is a PhD student at Stanford now. I think he also was one of the mentors for FRC 8 (your team) last year.

As Sam mentioned a couple of posts up, Kalman filters are good for much more than just figuring out which way is up (whatever your frame of reference). Your exploration of the details might lead to applications beyond balancing an inverted pendulum, and one of those might find its way onto your team's next robot. Have fun with it.
__________________
Richard Wallace

Mentor since 2011 for FRC 3620 Average Joes (St. Joseph, Michigan)
Mentor 2002-10 for FRC 931 Perpetual Chaos (St. Louis, Missouri)
since 2003

I believe in intuition and inspiration. Imagination is more important than knowledge. For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution. It is, strictly speaking, a real factor in scientific research.
(Cosmic Religion : With Other Opinions and Aphorisms (1931) by Albert Einstein, p. 97)
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Collaborate on LabView virtual Kalman robot? KHall Technical Discussion 3 09-06-2008 23:18
Kalman Filter for Heading information. Tatsu Programming 1 22-02-2007 02:20
Digital Filters? archiver 2000 2 23-06-2002 22:55


All times are GMT -5. The time now is 09:30.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi