the impact of 5V peripheral voltage on the digital airspeed sensor

327 views
Skip to first unread message

Andrew Tridgell

unread,
Feb 11, 2014, 6:27:29 AM2/11/14
to drones-...@googlegroups.com, lom...@inf.ethz.ch
Having a new lab power supply makes for some fun experiments ...

I setup two of the new MS digital airspeed sensors on two pixhawks
today, with both sensors connected to the same tubing via a Y
connector. So I could blow into one tube and give the same pressure
differential to both sensors.

I was pleased to find that the two sensors agreed very closely with each
other, which is a nice confirmation of their accuracy. They did have
quite different zero pressure offsets, but their delta response to
pressure was the same.

I then wondered how the readings might change if I changed the supply
voltage. We've assumed up to now that these digital airspeed sensors
would be less affected by the analog power supply voltage than the older
analog ones.

So I the powered two pixhawks from the two sides of the lab power supply
and looked at the impact on measured airspeed of altering the voltage on
the two boards.

If you keep the voltage between about 4.8V and 5.2V then the results are
fine, but once you get further away from 5V then there is a significant
impact on the offset. Changing voltage doesn't affect the scaling of the
result, so the results are valid at any constant voltage, but if your
board voltage changes during flight and goes more than 0.2V from 5V then
you will see a significant change in the offset, and thus the measured
airspeed.

For example, if you calibrate the offset at 5V then change the voltage
to 5.6V then the board will measure around 8 to 10m/s. The impact
reduces repidly with airspeed of course (its a sqrt), but that is enough
to badly affect landing.

The same thing happens if you drop the voltage below 4.8V. Down at 4.0V
the impact is similar (but in the other direction, showing a lower
airspeed).

What this means is that if we failover between different power supplies
in flight that our airspeed readings can be significantly affected.

I don't know if it would be practical to build a compensation table or
not, as I don't have enough data to see how consistent it is.

Cheers, Tridge

Andrew Tridgell

unread,
Feb 11, 2014, 3:54:26 PM2/11/14
to drones-...@googlegroups.com, lom...@inf.ethz.ch
I've now got a bit more accurate way of plotting the sensitivity to
voltage. I setup the MS4525 sensor with a tube looping back between its
two ports so it measures a constant zero pressure difference. Then I did
a scatter plot of the raw pressure offset as I changed the supply
voltage:

http://uav.tridgell.net/MS4525/MS4525-offset.png

the 3 graphs are for 3 different MS4525 sensors, and they show that
the slope of the response curve is very close to being the same for all
of them.

It seems to be linear in the range 4.5V to 5.5V then flattens out for
0.5V.

I think we can try adding a simple piecewise linear compensation
function in the driver that will fix this up nicely.

Cheers, Tridge

Andrew Tridgell

unread,
Feb 11, 2014, 8:25:43 PM2/11/14
to drones-...@googlegroups.com, lom...@inf.ethz.ch
Hi Lorenz,

I've pushed a set of patches to diydrones/PX4Firmware which adds
correction of the pressure difference based on the sensing of the 5V
rail on FMUv2.

https://github.com/diydrones/PX4Firmware/commit/9bfcd3dfd9d12c3e74dd9083c3d56dc98f292416
https://github.com/diydrones/PX4Firmware/commit/65e7aaa2f9e03de0e71298c82daa401772ef6766
https://github.com/diydrones/PX4Firmware/commit/788ba7c9d36861dcca9bd44b50ddc9b4e845957e

I also added the power supply valid pins as consumers of this ORB topic
are likely to want those as well. They are filled in by the adc driver,
which is a bit strange for GPIO values, but I couldn't see a better
place to do it.

With this change in place I get much less variance in measured airspeed
with voltage.

Cheers, Tridge

Andrew Tridgell

unread,
Feb 11, 2014, 9:52:35 PM2/11/14
to drones-...@googlegroups.com, lom...@inf.ethz.ch
Hi Lorenz,

I've now also pushed a patch to correct the temperature reading from the
MS4525 for voltage changes:

https://github.com/diydrones/PX4Firmware/commit/f234a918b3292c86aedd339f3242eaa6483bc4a2

it reduces the temperature variation over the full voltage range from
about 1C down to about 0.1C.

The patch also fixes a bug that caused the temperature reading to always
be a whole number (we were doing the temperature calculation using
integer maths instead of floating point).

We don't use this temperature reading from the MS4525 anywhere in APM
yet, but I expect we will use it in future as it should give a much
better measure of air temperature than the on-board baro.

Cheers, Tridge

Philip Rowse

unread,
Feb 12, 2014, 4:48:41 AM2/12/14
to drones-...@googlegroups.com
Hi Tridge, I think Lorenz is pushing a 3.3v version of the pressure sensor, with an LDO on board, that should give solid results from 3.5v up to 6v or so. That will be a better solution in the longer term.

john...@gmail.com

unread,
Feb 12, 2014, 5:19:17 AM2/12/14
to drones-...@googlegroups.com, lom...@inf.ethz.ch, and...@tridgell.net
Nice to see that the variation is more or less linear in the operational 4.5 - 5.5v range.

A last check would be to see if there is any settle time needed for the voltage offset to be linear, since systems with suboptimal power tend to have fluctuating voltage during operation.

- JAB

MEIER Lorenz

unread,
Feb 12, 2014, 6:53:03 AM2/12/14
to <drones-discuss@googlegroups.com> <drones-discuss@googlegroups.com>, Andrew Tridgell
Hi,

Systems with fluctuations on the autopilot voltage large enough to induce significant offsets should not be flown.

I can see value in detecting that and boldly telling the user, I don’t see value in trying to do more than preventing crashes (so no offset compensation of that case).

People need to stop flying junk over other people’s heads, and if we think they do, we have to think what we can contribute to stop them doing that.

Cheers,
Lorenz

--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

MEIER Lorenz

unread,
Feb 12, 2014, 7:07:07 AM2/12/14
to <drones-discuss@googlegroups.com> <drones-discuss@googlegroups.com>
Hi Tridge,

This is really cool. The data sheet didn’t hint anything into that direction and the improvements are indeed substantial. I’m expecting a range of users doing calibration off USB power and this ensures they get the same results off the brick supply.

Will pick them today, thanks!

-Lorenz

john...@gmail.com

unread,
Feb 12, 2014, 7:13:02 AM2/12/14
to drones-...@googlegroups.com, Andrew Tridgell
You are preaching to the choir.. :)

But this is still DIY used by mostly inexperienced people (a oxymoron I know, but that's how it goes..). So there must be some headroom for operational voltages, and let's make sure the linear compensation does more good then harm even in bad system. If nothing else to minimize the "my quad flies worse after update x" complaints.

- JAB

Meier Lorenz

unread,
Feb 12, 2014, 8:00:03 AM2/12/14
to <drones-discuss@googlegroups.com> <drones-discuss@googlegroups.com>, Andrew Tridgell
We would need to sync extremely tight if the supply shows ripple if we want to avoid to make things worse. That would require to know *exactly when* the sensor samples, which it doesn’t provide us. So its essentially impossible.

Sorry, but I’m more believing in sampling the supply (which will turn up the ripple if sampled long enough and with different intervals) and falling back to an uncompensated mode if its not “good”.

I *completely* disagree with your statement about inexperienced people. If people behave dump you have to be even more resilient, and your setup must make it impossible to make mistakes (= simple). Applied on this problem this doesn’t mean to try to cope with unstable supplies, but to *force* them to use only the *original, known* supply. Simply don’t boot / arm the system if its not provided.

Again, a bad supply is not just “noise” or “suboptimal”. Its a fundamental, basic requirement to have a stable supply for the autopilot. There is no workaround for this, no fix in software. This is one of the things to just get right and make sure everybody gets right.

-Lorenz



On 12 Feb 2014, at 13:13, <john...@gmail.com<mailto:john...@gmail.com>> <john...@gmail.com<mailto:john...@gmail.com>> wrote:

You are preaching to the choir.. :)

But this is still DIY used by mostly inexperienced people (a oxymoron I know, but that's how it goes..). So there must be some headroom for operational voltages, and let's make sure the linear compensation does more good then harm even in bad system. If nothing else to minimize the "my quad flies worse after update x" complaints.

- JAB

On Wednesday, February 12, 2014 12:53:03 PM UTC+1, Lorenz Meier wrote:
Hi,

Systems with fluctuations on the autopilot voltage large enough to induce significant offsets should not be flown.

I can see value in detecting that and boldly telling the user, I don’t see value in trying to do more than preventing crashes (so no offset compensation of that case).

People need to stop flying junk over other people’s heads, and if we think they do, we have to think what we can contribute to stop them doing that.

Cheers,
Lorenz

On 12 Feb 2014, at 11:19, john...@gmail.com<http://gmail.com/> wrote:

Nice to see that the variation is more or less linear in the operational 4.5 - 5.5v range.

A last check would be to see if there is any settle time needed for the voltage offset to be linear, since systems with suboptimal power tend to have fluctuating voltage during operation.

- JAB


On Tuesday, February 11, 2014 9:54:26 PM UTC+1, Andrew Tridgell wrote:
I've now got a bit more accurate way of plotting the sensitivity to
voltage. I setup the MS4525 sensor with a tube looping back between its
two ports so it measures a constant zero pressure difference. Then I did
a scatter plot of the raw pressure offset as I changed the supply
voltage:

http://uav.tridgell.net/MS4525/MS4525-offset.png

the 3 graphs are for 3 different MS4525 sensors, and they show that
the slope of the response curve is very close to being the same for all
of them.

It seems to be linear in the range 4.5V to 5.5V then flattens out for
0.5V.

I think we can try adding a simple piecewise linear compensation
function in the driver that will fix this up nicely.

Cheers, Tridge

--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com<http://googlegroups.com/>.
--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com<mailto:drones-discus...@googlegroups.com>.

Andrew Tridgell

unread,
Feb 12, 2014, 12:49:42 PM2/12/14
to Philip Rowse, drones-...@googlegroups.com, lom...@inf.ethz.ch
Hi Philip/Lorenz,

> Hi Tridge, I think Lorenz is pushing a 3.3v version of the pressure
> sensor, with an LDO on board, that should give solid results from 3.5v
> up to 6v or so. That will be a better solution in the longer term.

If the change to the 3.3V part is made then we'd need to make sure that
a part number is chosen with a different I2C address, otherwise we would
have no way of knowing if we should apply the voltage compensation code.

Cheers, Tridge

Andrew Tridgell

unread,
Feb 12, 2014, 12:52:19 PM2/12/14
to john...@gmail.com, drones-...@googlegroups.com, lom...@inf.ethz.ch
Hi John,

> A last check would be to see if there is any settle time needed for the
> voltage offset to be linear, since systems with suboptimal power tend to
> have fluctuating voltage during operation.

I don't have a good setup for testing this, but what I did do is to
change the voltage as rapidly as I could with my power supply (twisting
the knob quickly) and watched the voltage compensated differential
pressure reading. It didn't show much change, which seems to imply that
the response to voltage is quite rapid.

Cheers, Tridge

john...@gmail.com

unread,
Feb 13, 2014, 4:30:39 AM2/13/14
to drones-...@googlegroups.com, john...@gmail.com, lom...@inf.ethz.ch, and...@tridgell.net
Sounds like it will be fine. No need to get more fancy then that. I just wanted to make sure the compensation don't end up doing more harm then good. :)

Robin Dubois

unread,
Feb 23, 2015, 7:56:02 PM2/23/15
to drones-...@googlegroups.com, phi...@proficnc.com, lom...@inf.ethz.ch, and...@tridgell.net
Andrew, I'm an amateur arduino raspberry pi hacker trying to help a friend with a pressure sensor application involving the ms4525D, I notice you've used this sensor and I'm wondering if you would be kind enough to share the arduino code needed to activate and use this unit? I have one and am foaming at the mouth to get it running but just don't have the technical expertise to write sketch from scratch....

Thanks!

Robin du Bois robin....@gmail.com 
Reply all
Reply to author
Forward
0 new messages