PDA

View Full Version : Autopilot INS V1


zagisrule!
Jan 04, 2005, 07:02 PM
Hey guys,

I have finally gotten word that my gyroscope IC's will be here shortly, which allows me to make progress on my project.

I have read many papers on the subject and have developed an idea for this project. Kalman filters are the best way to go, as it is a superior method of combining the gyro and accelerometer into a useful angular displacement figure. However, I have come to the conclusion that using such a filter is mathematically beyond my current level of programming and comprehension. Therefore, I think I came up with a new solution that will suit my needs well. This idea is much simpler than a Kalman filter, also easier to implement and design around. Both angular sensors I will be using have large problems associated with using either one independently in such an application as an INS. I have seen online people using accelerometers as tilt sensors, and low-pass filtering the output to remove inertial "spikes" as the sensor moves, giving it's filtered output an accurate rendition to the accelerometers position relative to the earth. The problem with this is that the filtered result is that it is low bandwidth...this would obviously be a problem serving as the primary angular sensor in a UAV such as I am planning on making. Gyroscopes also have inherent problems such as drift (meaning the output changes slowly over time). Because the commercial gyro IC's I was planning on using are rate-gyros I need to do a bit of math the integrate the output to form an actual virtual angular position. The way I figured to eliminate the drift (low frequency) would be to add a high-pass filter to the output of the gyro...therefore blocking the DC drift and allowing the output to remain unchanged as the gyro drifts. The final output of the INS would consist of the low-pass accelerometer output and the high-pass gyro output combined to form a composite of the two sensors.

I was planning on using ADXL203 accelerometers (as I can implement an analog filter/buffer very easily using op-amps with the analog output, the PWM output of other sensors would make this a more difficult to implement digital filter) and ADXRS300 gyros (because I am getting them free! :) ). I was planning on using a 18-40 pin PIC and onboard ADC to perform math and create final outputs in either PWM or serial data form for the finished INS to communicate with the flight computer (next project).

Attached is the diagram of my proposed PCB setup, with gyros for roll, pitch, and yaw, and a single dual-axis accelerometer to serve as an inclinometer for pitch and roll.

Thoughts?



-Matt

Comatose
Jan 05, 2005, 02:51 AM
I've done some playing along these same lines. (i was using an adxl311 and a adrs150) The first thing I'd say is don't do your filtering in hardware. An FIR filter (or even a moving average) done in software is well within your processor overhead, if you use a pic18 which has hardware multiply. Software filtering lets you play and tweak to your heart's content, both in the filter structure and in the terms. If you've got a copy of matlab around somewhere, it has a very nice FIR design tool, where you simply feed it the response you want and the number of terms, and it'll give you the coefficients.

Resolving G with an accelerometer in a plane is much harder than doing the same in a terrestrial robot or a swimmer, simply because planes (especially little ones, mine was about 18 ounces) bounce around a LOT. The speced drift of the analog devices gyros is something like 70 degrees per hour. The cheaty way to get around that is to use your accelerometer as a reference only. Fly on your gyros and then periodically re-zero them (every couple minutes) by trying to get the plane to be not accelerating at all (flat level and constant airspeed) then every time you achieve a stable 1g (vector magnitude) reading, record the position your gyros think you're at. Average these over some number of "good" readings, then reset your gyro. You need a three axis accelerometer to do this, but a pair of the analog devices ones at right angles to each other is easy enough to accomplish. You'll also need at least an airspeed sensor in order to be reasonably certain your 1g is due to gravity and not due to some accelerating flightpath.

The drift in the gyros isn't a dc drift, the dc value is quite stable. The speced drift is if you have an integrator running off of the output, how fast the read reading (off the integrator) diverges from the actual reading. A high pass on the gyro will only make life worse.

I'd tell you to buffer your sensors with an op amp follower, but I'm sure you know that already.

zagisrule!
Jan 05, 2005, 09:20 AM
I was contemplating using software filters on the units, but I thought that just doing it in hardware would save me some troubles when I am writing the software.

The integrator would indeed provide most of the error - but I was under the impression that temperature and such would cause the center voltage of the gyro to shift. Is this not so or only to a limited effect?

Indeed the op-amp would be necessary (or some other means of lowering output impedance) for the PIC ADC to be able to read the sensors quickly.


-Matt

AndyKunz
Jan 05, 2005, 12:24 PM
I found the digital output much nicer to use than the analog one when doing pitch controls for subs.

I use either a CCP or RB0 to measure pulse width.

And he's right - do your filtering in software! Besides lowering parts count, it's easier to improve it as your programming skills increase.

Andy

zagisrule!
Jan 05, 2005, 01:42 PM
Well, it is not to late for me to just measure pulse width and skip the analog accelerometers. I will use the ADXL202 as the accelerometer which not only frees up ADC for other stuff, and also gets rid of two buffer op-amps.

I am going to look into implementing software filters, should not be too difficult.


-Matt