Sensor Questions

[quote=“tridge”][color=#0000FF]Pixhawk updates[/color]
The most important of these is dual sensor support. The Pixhawk has two gyros and two accelerometers, and (if you have an external GPS/compass combo) dual compass as well. In the 2.76 release only one of each of these sensors could be used. With the 2.77 release the health of each sensor is monitored and if one sensor fails the second sensor can take over. In addition to failover support the code logs both sets of sensor values both to MAVLink and to the logs on the microSD card, which is very useful for diagnostics. We are also working on dual GPS support which we hope to get into the next release. I have test flown the dual-GPS code a few times, but I didn’t consider it complete enough for the 2.77 release, so I have left it out for now.[/quote]
Support for multiple sensors is a very welcome improvement, thank you!

  • Is it possible to extend this support for all sensors? For example, I would like to add an external altimeter and airspeed sensor.
  • Is it possible to add sensor fusion instead of failover support only? Merging data from multiple sensors can improve the readings significantly.

Beautiful to see how this project grows,
cheers, Sinan

Tridge, thanks for another great release!

I am curious if there documentation around that describes how you identify a failed sensor? For example, if you had two very different compass values how would you decide which one was correct, and which one was suspect? And do you handle that differently for each sensor?

Thanks again for your hard work and this amazing capability.
Trevor

[quote=“PapaHotel”]Is it possible to extend this support for all sensors? For example, I would like to add an external altimeter and airspeed sensor.
[/quote]
We certainly do support airspeed sensors, but don’t yet support dual airspeed sensors.
For altimeters it would be great to have another altitude reference, especially for landing. I’ve done some experiments with sonar, but I’m not sure it will be a great solution as the results are quite noisy.
Do you have a specific sort of altimeter in mind?

Quite likely. I think sensor fusion will probably be good for dual-GPS. It may also help to average two sets of gyros. The EKF already does fusion between baro, GPS and accelerometers for velocity. It isn’t clear yet if it would help for gyro - quite possibly not due to the low filter bandwidth on gyro that we use.
Cheers, Tridge

We do several types of tests to detect failure:
[ul]for digital sensors we detect if the sensor responds. So for example we can detect when an I2C compass stops responding and switch to the backup
for some sensors we can test consistency. For example we look for consistency between GPS and compass heading (taking into account ground speed and wind).
we check known bits in responses from sensors - for example we ask for status registers on some sensors and check the values match the datasheet values
we also test the range of values for some sensors, for example we check for bad accelerometers via a range test[/ul]
Cheers, Tridge

@Tridge,

I am building an external sensor for airspeed and altitude. In this case, there will be two barometric sensors for the altitude. It could be wise to compare the data for these sensors for failover support like you already do for some other sensors. Thereby, the quality of the altitude readings can be improved by combining the data from these sensors.

I am going to experiment with the APM code in order to add quick&dirty support for my sensor. But, it’s probably better to address this at the HAL level for all sensors. I can imagine that this kind of multiple sensor support will be valuable for many more scenarios. Do you think that it’s possible to add this functionality without making things too complicated?

Cheers, Sinan

FYI, this is how the airspeed/altitude sensor (we call it RaptorSense) looks like…


The top one weighs less than 2 gram including the integrated carbon Pitot tube. The second one is built for connection through silicone tubes and it weighs less than 1 gram. Servo connector is just as reference.

what is the interface to your airspeed sensor and altitude sensor? I2C? analog? What chips does it use?
Cheers, Tridge

[quote=“tridge”][quote=“PapaHotel”]
I am building an external sensor for airspeed and altitude.
[/quote]
what is the interface to your airspeed sensor and altitude sensor? I2C? analog? What chips does it use?
Cheers, Tridge[/quote]
Hi Tridge,
It has an onboard ATmega328 @8Mhz for the processing of data from two LPS331 sensors and protocol support.
At this moment, I am using it as a pure total energy vario for gliders. Depending on the selected protocol, it can send the raw sensor data and/or the preprocessed altitude, velocity, total energy, … values.
Current firmware communicates through the serial port but the planning is to connect to the ‘old’ APM through the SPI port. Once switched to Pixhawk, I can return to the serial port implementation.
Cheers, Sinan