2012-12-21 06:23 AM
Hi all,
I want to build an altimeter using stm32f1xx device. I ordered an LPS331 sensor to build my product but... After having bought the sensor I realized that LPS331 sensor can be used as altiemeter only if I do some median fillter :( I asked ST support if they have such filter but they, probavly have it but do not want to give it for me so if there somebody who implemented or know how to implement such filter (median filter) on STM32 ? You find below the response of ST support.... ***************************************************************** *****************************************************************Dear User,Please find here below latest information concerning the request R12470059
The altitude precision depends on the number of averaged measurement over a certain time. LPS331AP hold steady will have an altitude within 70cm if performing a running average over a <2seconds window. For a running average over 6seconds, the altitude precision should become much better probably in the 20-30s range (not evaluated in details)
Running average is a simple yet effective S/W filter which can be used with little side effect. Other filter that might be useful is the running median filter which would remove pressure peaks from the averaging.
If measuring over longer period of time, probably the ODR can be reduced accordingly to keep the average power consumption constant. This is application dependent.
2012-12-21 07:23 AM
LPS331 sensor can be used as altiemeter only if I do some median fillter :(
Not true. ST response says that simple moving averaging over a time interval can be used. Which algorithm is best depends on your accuracy requirement and how fast the sensor altitude is changing. If the application is mountain climbing, the averaging time can be long. If the application is a acrobatic aircraft, you probably need a more complicated algorithm that includes airspeed and pitch angle. A Google search on median filtering should provide good insight. Cheers, Hal