My Altimeter with Kalman Filter

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

OldEurope

Member
Joined
Nov 7, 2008
Messages
13
Reaction score
0
Another development from me is my Altimax Altimeter.
A year ago I started working on a new altimeter system, which I finished 6 months ago. The reason for developing an own altimeter was the lack of easy to use altimeters in Germany.

I wanted an easy system which can be used by everyone, also without having a laptop on launch days. The normal altimeters are quite difficult to use, many settings are nice to have, but can lead to failures due to wrong settings.
Also, it should have 2 igniter ports as well as 2 Servo Ports, for those who use mechanical parachute ejection.

So I started from scratch, grounded my first design twice before starting a new attempt. I built a system driven by a ATMega644 with 16 MHz. I has only a barometric sensor on board, but a special digital filter called a Kalman Filter.
It has 2 pyro ports capable of driving 17 A, 2 servo ports with separate power converter, a serial connection as well as an I2C port for the terminal and later developments. A beeper sounds the igniter status, 2 leds show also the status. It runs on 7.4 V Lipo accus as well as 9V blocks, and needs only one power source.
A bootloader allows for easy firmware update from the net.
It calclates the heigt very exactly with the use of the air temperature on the launch site, for this ony can enter the temperature or change it later on to show the height more exact. The accuracy is within 3 meters.

I placed a SubD-15 HD connector to it, so I can switch rockets in a minute, just take out 2 screws, pull the altimeter off and put it in a new rocket.
This turned out to be a very nice feature, which no altimeter in the market has.

Besides this, the best feature is the small LCD terminal I made for it, one can connect it to the altimeter and it lets you change all settings, test the servo outputs, test the igniters and show you the last 6 flights.
It is only 90x70 mm small and replaces the laptop almost completely.

For the computer fans I made a nice software which lets you change settings as well as show you the flight data, besides the barometric data it shows also the filtered data out of the Kalman Filter.

The performance is very nice, it detects Apogee very exact, much better than some available altimeters on the market. The good performance is done by the Kalman filter, which makes apogee detection very exact.
This filter is very effective, it calculates the acceleration and speed out of the barometric pressure. It calculates an allowed error for the pressure, which allows to filter out wrong data. We can even switch off the sensor 2 seconds after launch, and it finds the apogee still quite well, its like magic.
Also with the help of the filter, we look for the point where speed is Zero, that is the point where the right time is for ejecting a parachute. This works much better then the normal way of waiting for rising air pressure.

I built 50 Altimeters so far, and with the help of some club members we did extensive testing, we had over 100 flights until this summer, without a single incident so far. All apogees where detected very nicely, which is also shown in the flight data.

The Altimax (that is the name) is quite large, 80x40 mm, but I have a smaller one (69x23 mm) which fits a 24 mm motor tube and has all features of the big one except the servo ports. The Mini is not ready yet, I have some samples only.

This is how it looks like:
altimax1.jpg


On the left you see the connector. This is the counterpart of the connector which is placed in the rocket and is very robust:
stecker2.jpg



This the LCD terminal, and my Hand ;-)
terminal1.jpg


My PC Software is now completed, but still in German, but that will change soon:
software.jpg

It allows download of the flight data, the altimax is capable of saving data of 6 flights in a fifo manner.

The altimax is not a commercial project, I built it myself and produced a small series for the german rocketeers.

Louis
 
Interesting! I really like the hand held programming setup. The software image looks intriguing as well.:D U$D?

EDIT: Oops, sorry I missed your last comment. At any rate, you could potentially have a market for these here in the U.S.
 
i flew today for the first time the altimax in my Hyperloc300

and WOW

2 flight

2 perfect apogee ejection and main ejection at 150mters from ground..

very happy !!!!

tomorrow i wll post the graphics
 
Hi Alessio!
You see, it is not "Swiss Made", but just like "Swiss Made" ;-) German precision :D

I forgot to write, that many flyers helped in testing the altimax, sent me the flight data for analyzing. Also Prof. Andreas Müller (The man behind so many Nomograms ;-) from Switzerland helped sending my brain into the right direction while developing the digital filter for the altimeter.

Louis
 
Another development from me is my Altimax Altimeter.
A year ago I started working on a new altimeter system, which I finished 6 months ago. The reason for developing an own altimeter was the lack of easy to use altimeters in Germany.

I wanted an easy system which can be used by everyone, also without having a laptop on launch days. The normal altimeters are quite difficult to use, many settings are nice to have, but can lead to failures due to wrong settings.
Also, it should have 2 igniter ports as well as 2 Servo Ports, for those who use mechanical parachute ejection.

So I started from scratch, grounded my first design twice before starting a new attempt. I built a system driven by a ATMega644 with 16 MHz. I has only a barometric sensor on board, but a special digital filter called a Kalman Filter.
It has 2 pyro ports capable of driving 17 A, 2 servo ports with separate power converter, a serial connection as well as an I2C port for the terminal and later developments. A beeper sounds the igniter status, 2 leds show also the status. It runs on 7.4 V Lipo accus as well as 9V blocks, and needs only one power source.
A bootloader allows for easy firmware update from the net.
It calclates the heigt very exactly with the use of the air temperature on the launch site, for this ony can enter the temperature or change it later on to show the height more exact. The accuracy is within 3 meters.

I placed a SubD-15 HD connector to it, so I can switch rockets in a minute, just take out 2 screws, pull the altimeter off and put it in a new rocket.
This turned out to be a very nice feature, which no altimeter in the market has.

Besides this, the best feature is the small LCD terminal I made for it, one can connect it to the altimeter and it lets you change all settings, test the servo outputs, test the igniters and show you the last 6 flights.
It is only 90x70 mm small and replaces the laptop almost completely.

For the computer fans I made a nice software which lets you change settings as well as show you the flight data, besides the barometric data it shows also the filtered data out of the Kalman Filter.

The performance is very nice, it detects Apogee very exact, much better than some available altimeters on the market. The good performance is done by the Kalman filter, which makes apogee detection very exact.
This filter is very effective, it calculates the acceleration and speed out of the barometric pressure. It calculates an allowed error for the pressure, which allows to filter out wrong data. We can even switch off the sensor 2 seconds after launch, and it finds the apogee still quite well, its like magic.
Also with the help of the filter, we look for the point where speed is Zero, that is the point where the right time is for ejecting a parachute. This works much better then the normal way of waiting for rising air pressure.

I built 50 Altimeters so far, and with the help of some club members we did extensive testing, we had over 100 flights until this summer, without a single incident so far. All apogees where detected very nicely, which is also shown in the flight data.

The Altimax (that is the name) is quite large, 80x40 mm, but I have a smaller one (69x23 mm) which fits a 24 mm motor tube and has all features of the big one except the servo ports. The Mini is not ready yet, I have some samples only.

This is how it looks like:
altimax1.jpg


On the left you see the connector. This is the counterpart of the connector which is placed in the rocket and is very robust:
stecker2.jpg



This the LCD terminal, and my Hand ;-)
terminal1.jpg


My PC Software is now completed, but still in German, but that will change soon:
software.jpg

It allows download of the flight data, the altimax is capable of saving data of 6 flights in a fifo manner.

The altimax is not a commercial project, I built it myself and produced a small series for the german rocketeers.

Louis
If the circuit and the MC's program are not copyrighted, I would appreciate if you post them here. They may be very helpful as I am designing my own altimeter...
 
Hi,

sorry, but I will not post that info here, as I am still thinking of making a commercial version of it. That software took me a lot of work and testing, I hope you will understand that.

It would also be a problem when users start to change the software and load it into their hardware, the LCOs will not be able to see if they have a tested device in the rocket or a changed one.

Louis
 
Dude! Have you been watching the Volkswagen commercials that are running in the US? (They advertise that women shouldn't have babies just so they can have German engineering) Is this just your personal attempt to attract American women through German engineering?;)
 
Very nice. Were some supersonic flights included in the test program? I see in the download screenshot a table with "Mach delay." Is the Mach delay required or is the Kalman filter capable of ignoring Mach effects?
 
Hi,

sorry, but I will not post that info here, as I am still thinking of making a commercial version of it. That software took me a lot of work and testing, I hope you will understand that.

It would also be a problem when users start to change the software and load it into their hardware, the LCOs will not be able to see if they have a tested device in the rocket or a changed one.

Louis
No problem, I was just asking. Forget about it
 
Very nice. Were some supersonic flights included in the test program? I see in the download screenshot a table with "Mach delay." Is the Mach delay required or is the Kalman filter capable of ignoring Mach effects?

No, we did not make supersonic flights yet, this is some kind of problem in Germany, as we do not get allowance to get high enough.
The mach-delay was implemented before I added the kalman filter.
My simulations show, that the filter is capable of doing it, even extreme distortions are filtered out. (I have made a pc-simulation software which runs exactly the same algorithm as the hardware, with that software I can simulate almost every flight condition).
But a real life test has to be done, My plans are for next summer in Switzerland.

My main goal was to get an easy to use altimeter, which does one thing: Safely bring back my rockets. As some users here use Servos for ejecting parachutes, I added the 2 servo outputs. Supersonic flights are very seldom in Germany, and even in Europe, we just do not have the space for such flights. But I hope we will get one or more flights soon. Until then, it is untested in supersonic flights.

Btw, I just had a look on your altimeter, do you have the size somewhere? I could not find them. Very cool design! You should add a connector to it to make it changeable, that would make it perfect. I am also working on a small one, which is 69x23 mm small, this is an image of the first prototype, a bit larger then the actual model.
altimini_1.jpg

but also has no accel sensor and 2 outputs. The pcbs are under way.

My sensor is sampled with 250 hz, the data is saved with 25 sps, recorded are 6 flights for 200 secs each, which can be changed by software or lcd terminal, max. is 1 flight with 1200 secs (20 minutes).

Is this just your personal attempt to attract American women through German engineering?
You got it! :cool:

Louis
 
Btw, I just had a look on your altimeter, do you have the size somewhere? I could not find them. Very cool design! You should add a connector to it to make it changeable, that would make it perfect. I am also working on a small one, which is 69x23 mm small, this is an image of the first prototype, a bit larger then the actual model.

The Parrot is 16mm x 56 mm. I think of the 6-position screw terminal as a connector, since it could interface with a pin header with 0.1" pin spacing. Is that the connection you had in mind?

Your LCD readout is a nice feature. Is the cylindrical part in the picture a beeper, with the sensor on the reverse side? Which pressure sensor are you using?
 
The most interesting part to me is the acceleration curve. The Kalman filter normally uses a strong model of the underlying physical processes. Do you need any kind of prior knowledge about the thrust curve, or do you use a generalized function?

Whatever you're doing, it looks great :)

Kudos,
-LarryC
 
@Colin: I will come back on your offer ;-)

The Parrot is 16mm x 56 mm. I think of the 6-position screw terminal as a connector, since it could interface with a pin header with 0.1" pin spacing. Is that the connection you had in mind?

Your LCD readout is a nice feature. Is the cylindrical part in the picture a beeper, with the sensor on the reverse side? Which pressure sensor are you using?

Wow, that is small!

With a pinheader, you need to screw everything on right?
I use these parts here from a german distibutor:
PS25WS.jpg


The cylinder is the beeper, the sensor is the part with the AB on it, it is a sensor from SMI, a SM5812. It seems that those guys stopped production, so I will need to use another one in the next series.

For the kalman filter, I used a generalized function, I do not need any data of the used motor. The curve is messy after apogee ejection, but after that point, it is not necessary to have an exact value. Important is the part where it accelerates.
I had very good results with that, many flights are absolutely perfect in Apogee, with very small motors with low heights the apogee is a bit late, but never more then 1 second. (I tested flights of 30 m height also :)

Louis
 
The Parrot is 16mm x 56 mm.

Hello again, can you tell me which pressure sensor you use for the parrot?

Btw, the lcd runs via an I2C bus, it only has an I2C-I/O chip inside, the software on the altimeter sends its signals to this chip to run the LCD. It is a PCA9554 I2C-IO interface..

The accelaration curve on the graphic has a peak, which results in an unstable rocket flight, the rocket was unstable at startup and then stabilized as the fuel was out (a H165 redline motor, very fast burning). It wagged its tail as it went up.
That was one of the weird tests I did to prove the stability of the filter.
As you also see, this did not interfere the apogee detection, but the acceleration change was measured, without a G-Sensor.

Louis
 
"So I started from scratch, grounded my first design twice before starting a new attempt. I built a system driven by a ATMega644 with 16 MHz. I has only a barometric sensor on board, but a special digital filter called a Kalman Filter. "

A Kalman filter is only really powerful if you have numerous uncertain inputs and wish to find the most likely output given an estimate of the uncertainty of each measurement. Since you only have one barometer onboard, your Kalman filter really is just a moving average filter...

A moving average filter is just a special case of a low-pass filter. One can calculate the transfer function as a function of frequency by simply plugging into a Fourier Transform. I've attached a typical "lobe-like" transfer function of a rectangular moving average filter as well as an example of what it does with a test signal with various cut-off frequencies.

Again, the Kalman filter is not really doing anything special unless you have several inputs... perhaps another barometer, a 6-axis IMU, 3-axis earth magnetometer, etc...

683036211_3b892e3f1f_m.jpg

Step Reponse with Gaussian2.jpg
 
A Kalman filter is only really powerful if you have numerous uncertain inputs and wish to find the most likely output given an estimate of the uncertainty of each measurement. Since you only have one barometer onboard, your Kalman filter really is just a moving average filter...

The dynamic system model is the second input and it makes it very different from a moving average filter.
 
The dynamic system model is the second input and it makes it very different from a moving average filter.

Well, technically, the model of the system is in the form of the state transition matrix F:

x[n] = F * x[n-1] + B * u[n] , where u[n] is a control input and is not used in this case.

The math that falls out of it results in a transfer function along the lines of:

T(z) = k1*z^-1 + k2*z^0 + k3*z^1 ...

Which happens to be a moving average.

The model uses the past data to form a projected next value given the system model. This is weighted with the next noisy measurement and the result is updated as the next state point.
 
Well, in Real-Life, it is a "bit" more complicated.

The kalman filter uses a matrix, the system function is

XMin[0] := XPlus[0] + XPlus[1] * dt + XPlus[2] * dt * dt / 2.0;
XMin[1] := XPlus[1] + XPlus[2] * dt;
XMin[2] := XPlus[2];

XPlus[0] := XMin[0] + K[0] * (pressure - XMin[0]);
XPlus[1] := XMin[1] + K[1] * (pressure - XMin[0]);
XPlus[2] := XMin[2] + K[2] * (pressure - XMin[0]);

where dt is the time step, 4 ms in my case.
xmin[0] holds the pressure, xmin[1] the speed and xmin[2] the acceleration.

As you see, it calculates the speed and acceleration out of the pressure changes. In the next iteration it uses these values to calculate the next pressure value.

This is far better than a moving average, maybe you have to check your books again ;-)

I did many simulations with this filter design, and it has the capability of filtering out heavy distortions as well as complete failures of the pressure sensor for a period of up to 2 seconds. Try that with a moving avarage filter.

Louis
 
To make it more clear, I will post two images:

The first one is a simulation of a massive peak in the pressure, you see the red line which is the pressure data from the sensor, black is what the filter gives us.
Despite this massive peak, the blue curve, the speed, is never going to 0 m/s (The Y-axis for speed is on the right, barometric data axis is the left)

rtf_kalm1.jpg


The second one shows us a flight with massive distortions, simulating a mach flight. See the red curve? And have a look at the blue curve, the speed is nevers at zero m/s, it detects apoge nearly perfect: Apogee is where speed is zero, this is what the kalman filter gives us.

rtf_kalm2.jpg



Also, you see a small peak resulting from a leackage in the e-bay, this is also filtered out quite good.

Ergo: This is not a moving average filter, it has better capabilities.

Louis
 
Well done. The state estimation model inherent in a Kalman filter is the key to its magic. If there is a more useful result to come out of applied mathematics research in the last half century, I'm not aware of it.

I'm still interested in seeing data from real Mach flights; I suspect that it won't reject the smoother distortions of real Mach effects as well as the step changes in your examples, but your examples are impressive, nonetheless.
 
Well done. The state estimation model inherent in a Kalman filter is the key to its magic. If there is a more useful result to come out of applied mathematics research in the last half century, I'm not aware of it.

I'm still interested in seeing data from real Mach flights; I suspect that it won't reject the smoother distortions of real Mach effects as well as the step changes in your examples, but your examples are impressive, nonetheless.
Adrian

Kalman filters handle supersonic flights just fine. The first reference below has an example of it. The second and fourth references are Dave's first place NARAM R&D papers from 2002 and 2004.

https://home.earthlink.net/~david.schultz/rnd/2002/index.html

https://home.earthlink.net/~david.schultz/rnd/2002/KalmanApogee.pdf

https://home.earthlink.net/~david.schultz/rnd/2004/index.html

https://home.earthlink.net/~david.schultz/rnd/2004/KalmanApogeeII.pdf

Bob
 
Back
Top