sure evaluation of measuring values? stady state, peak, slope

PLCcoder

Member
The set up is:
Teensy41
Adafruit bmp388 over I2C

openSUSE Leap 15.3
Arduino 1.8.19
teensyduino 1.59

The plan was after powering on some pressure samples (5, 250, ...) are made and from there the gained altitude is measured.
At first the noise of the bmp388 forced me to use the SimpleKalmanFilter library.
I have sampled several times 5000 values (03:20 [mm:ss]) and had a look at the charts.
Sometimes it is a PT1, one had an over shoot and another one a over shoot and slope afterwards:
1714464697821.png


By only looking on
- a difference
- a gradient (m=dy/dx, from sample to sample with micros=9700)
- >= 0 or <= 0
it will be triggered by the first appearance, which is useless.
(i.e. first: 190 however after 1524 0 is kept)

From my point of view adding a dead band or a hysteresis does not solve it either.

How to identify the steady state, peaks (highest altitude) or slopes?
How to cope with the flickering between a low value and a solid 0, which lasts longer than any other change during the value decay?

Any ideas are very welcome!
 
Found this lib to determing peaks in sensor data

Disclaimer - never used it.

They do reference this stackflow question/response: https://stackoverflow.com/questions/22583391/peak-signal-detection-in-realtime-timeseries-data

As for steady state or slopes you would need to evaluate a moving window and determine a line fit etc.

You could check this out as well
and

there are others out there - just do a google search. But think that will give you an idea
 
Kalman filter isn't appropriate here I think, simple low pass would sufficient to remove the vast majority of the noise, then see what signal quality you have and work from there?
What is the application?
 
Kalman filter isn't appropriate here I think, simple low pass would sufficient to remove the vast majority of the noise, then see what signal quality you have and work from there?
What is the application?
From blue (pressure) raw bmp388 values to the orange (pressureK, kalman filter) trend, looks quite good for my opinion, i stay with it.
Measuring the rise/decent rate and altitude of a simpel water rocket and log it to a micro smart card, maybe ejection of a parachute at a later state (first time to use a MOSFET/solid state relay).
 
I'd agree with @MarkT here. A kalman filter is probably overkill and I suspect is the cause of your issue. Kalman filters are remarkable when configured correctly but produce useless junk if configured incorrectly.

In this situation I suspect either a low pass filter or a simple average would work fine.
For a filter you can probably google a page that will generate the code for you if you can't find a suitable library.*
A rolling average of the last n samples is even simpler to implement and would probably do what you need here.


* I always used to use http://web.archive.org/web/20180418132956/http://www-users.cs.york.ac.uk/~fisher/mkfilter/trad.html to generate filter code, it would give you the c code for a filter of the type you want. But the site is now dead and it looks like the archived version doesn't work correctly. The full site is archived here https://github.com/university-of-york/cs-www-users-fisher
 
Back
Top