Tuesday, August 21, 2012

What is a Kalman Filter?

What a week. I flew out to L.A. on Sunday afternoon to spend a week at the Kalman Filter Consultant Associates (KFCAs) course on Global Navigation Satellite System (GNSS) and Inertial Navigation System (INS) integration. I'll say that the course was a blur. We covered two graduate level text-books in one week, and the whole time I felt like I was just barely able to tread water. The good news, however, is that I feel like I have a fairly solid understanding of what a Kalman Filter is and how it can be used, any further epiphanies on the subject I will be sure to capture on this blog.

 Quick History

Kalman filters have a bit of a buzz about them.  They first gained fame with their use in the Apollo program landing lunar modules, but nowadays they are showing up in many different platforms.  One of the more common places is in AI and robotics (where I first saw them).

What is it?

A Kalman Filter is a state-space prediction and analysis algorithm. In lay-mans terms, it can predict the outputs and the reliability of those outputs for a given set of related equations.  Kalman Filters are closely related to Least-Squares estimators, in fact given a pre-set data set they will arrive at the same result.  The difference is that a Kalman Filter is recursive, needing only the previous output and the current output.

How does it work?

Kalman Filters require a model of the system they will be used on.  This model creates the predicted response of a system which is subtracted from the system's sensor outputs to yield an error state matrix.  It is essentially a system model coupled with an noise predictor, using normalized noise spectra in the multiplications.  Normal noise also known as Gaussian noise has the characteristic of shrinking its standard deviation when multiplied by another Normal noise profile.  That means regardless of the spread of the two noises, the combined profile will be more certain than either of the originals.  The pivotal piece is that your noise profiles must be gaussian or be compensated to be gaussian.

Monday, August 13, 2012

Using Orcad Layout with Circuit Works

One of the tasks I've taken on is to mesh our electrical documentation into our mechanical models.  Our mechanical modeling software is Dassault Systems' SolidWorks.  A handful of years back SolidWorks integrated in a piece of software called CircuitWorks that will create a solid model from an IDF file.  This is a pretty simple process, once you have everything set up correctly.  Here is what I discovered with how Orcad Layout exports its .MAX files to IDF files and how to configure both SolidWorks and Layout to bring things together nicely.

First, when exporting a .MAX file there are a couple important things to note:
  1. Parts will be exported by their footprint (geometry) name and their reference designator.  When CircuitWorks reads this in, it will create a part for each unique IDF part name.  So for example:  if you have two resistors, R1 and R2, with the same R1206 footprint, Circuitworks will create an R1206_R1 and an R1206_R2 part.  The way to circumvent this is to select the checkbox "Use Library Footprints" in the IDF export dialog in Layout.  Checking this box will remove the reference designator from the IDF part names.
  2. Exported parts will have 0 height unless you've specifically set the height of the component_outline obstacle.
Second, when importing into CircuitWorks note the following:
  1. CircuitWorks defaults to creating models on the XY-plane, meaning boards will show up vertically in any previews you have. (Probably not a big deal)
  2. CircuitWorks will use any models pre-existing in your part library.  This is a really nice feature since you can import a true 3D model as your part, instead of using the generated "block" part that CircuitWorks creates.  However, the critical thing to note is that in order to place and orient your imported part you must create an origin called CWX. The XY-plane of the origin should be parallel to the board and the +Z axis should point toward the top of the component.  Also, the origin must be centered where the board will contact your part.  None of this is documented very well in any SolidWorks documentation.  Showing Origins in Circuitworks is a good way to help you decide where your origin should be centered and how it should be oriented on the component.
I will be doing some more integration work between Layout and SolidWorks in the near future and will provide information on using a central component library, as well as how we are meshing Capture, Layout, and CircuitWorks component libraries.

Friday, August 10, 2012

AD5668 Documentation Snag

Another chip I'm using in my current project is the AD5668 8-channel 16-bit DAC.  The chip comes in a variety of suffixes that change the accuracy and power-up output states.  The wiring is simple for the chip, but the documentation contains an easy to overlook nuance.  I found myself stuck, looking at perfect signals, but an unresponsive DAC.

The nuance comes into play when sending certain commands to the AD5668.  The specific commands are Power-up / down channel, Set-up Internal Ref, Load Clear Code Register, and Load LDAC Register.  When using these commands it is important to notice that DB0 is different from D0. The DB bits are the bits for the entire 32-bit message.  The D0 bits only apply when the start and end bits of the message are Don't Cares.  It is never specifically mentioned in words, only in the command diagrams, which I overlooked.

Thursday, August 9, 2012

Powering an LTC1857/LTC1858/LTC1859

I ran into a problem this week with these little A2D converters. I am using the LTC1859, the 16-bit version. I worked through my Microprocessor setup just fine, all of the MC's signals were transmitting correctly, but the output of the LTC was continually zero (0x8000).

The problem turned out to be in how I was powering the chip. My circuit is the following:
LTC1859 Circuit Diagram
LTC1859 Circuit
 With VDD = +3.3V.  Upon closer inspection of the documentation for this guy, it turns out that the DVdd pin must be connected to +5V. A simple correction but an easy to overlook requirement.

I'll post the snag I found on the AD5668 16-bit D2A tomorrow.