Digital pressure sensor Driver

Discussions and support about ChibiOS/EX, the External Peripherals Abstraction Layer.
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: Digital pressure sensor Driver

Post by RoccoMarco »

:mrgreen: We will update readme as soon as EX reach a equilibrium point! Thanks for the notice.
Ciao,
RM
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: Digital pressure sensor Driver

Post by barthess »

Hi there.
1) I see problem in thermometer and barometer API.
I do not know barometers and thermometers with settable
sensitivity. They have resolution instead.
2) All sensors return just MSG_OK/MSG_RESET. What
about returning error mask/number? Or additional API
call like getLastError(sensor *ptr)?
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: Digital pressure sensor Driver

Post by RoccoMarco »

Hi barthess,
thanks for this precious feedback. I am working on a restyle of the current implementations. We are far from the definitive version and the idea is to improve driver until we have something suitable for most common uses.

Note that bias and sensitivity are two abstract concept related to a linear correction according to formula

Sens * Data + Bias = Cooked

Whereas Data is a 1xn vector, Sens is a nxn matrix and Bias is a 1xn vector. Since cross sensitivity values are almost 0 in our model we are considering Sensitivity like a nx1 vector.

By the way:
Senza titolo-1.jpg


The second point... My bad! I have to improve the whole error management. Thanks for notice me.
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: Digital pressure sensor Driver

Post by barthess »

Hm... ok, let it be abstract characteristic. But BMP085 for example has
settable (via API?) resolution and hardwired sensitivity. Also
RoccoMarco wrote:Sens * Data + Bias = Cooked

formula is incorrect for pressure calculation. Any way, I have
no ideas about common abstract interface for all kind of
MEMS sensors. I have try hard to create such interface
and best achieved conception you can found here https://github.com/barthess/u2/tree/mas ... rc/sensors
I still think it is ugly but have no better ideas.
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: Digital pressure sensor Driver

Post by RoccoMarco »

Thanks a lot barthess,
i will take a look to compensation methods for barometers. Do you have further reading to suggest me?
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: Digital pressure sensor Driver

Post by barthess »

RoccoMarco wrote:i will take a look to compensation methods for barometers.

All that compensation magic goes from IC's datasheet.
RoccoMarco wrote:Do you have further reading to suggest me?

No. That is all I have. All future way is full of your trials and errors in
context of current projects. There is no spoon silver bullet.
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: Digital pressure sensor Driver

Post by RoccoMarco »

Thanks. We will improve it.
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Re: Digital pressure sensor Driver

Post by tfAteba »

Hi all,

For me I think it is very difficult to make a generic driver to fit to all existing sensors. Some time it will be necessary to customize or modify an existing driver for some people.

But It is interresting to propose a driver that cover a larger number of sensor.

regards,

Theo.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Digital pressure sensor Driver

Post by Giovanni »

It does not have to cover all features, it has to cover common features. Specific features can be covered with configuration or custom functions. Configuration is the preferred way of course.

Giovanni
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Re: Digital pressure sensor Driver

Post by tfAteba »

That sounds good for me :mrgreen:

Theo
Post Reply