We have just implemented a major upgrade to the ArduPilot sensor drivers for STM32 based boards (PX4v1, Pixhawk, Pixhawk2, PH2Slim, PixRacer and PixhawkMini).
The new sensor drivers are a major departure from the previous drivers which used the PX4/Firmware drivers. The new drivers are all “in-tree” drivers, bringing a common driver layer for all our supported boards, so we now use the same drivers on all the Linux boards as we do on the PX4 variants.
We would really appreciate some testing on as many different types of boards as possible. The new driver system has an auto-detection system to detect the board type and while we think it is all correct some validation against a wide variety of boards would be appreciated.
Advantages of the new system
The new device driver system has a number of major advantages over the old one
* common drivers with our Linux based boards
* significantly lower overhead (faster drivers) resulting in less CPU usage
* significantly less memory usage, leaving more room for other options
* significantly less flash usage, leaving more room for code growth
* remote access to raw SPI and I2C devices via MAVLink2 (useful for development)
* much simpler driver structure, making contributions easier (typical drivers are well under half the lines of code of the PX4 equivalent)
* support for much higher sampling rates for IMUs that support it (ICM-20608 and MPU-9250), leading to better vibration handling
How to test
We’d love people to test the new system and report success or failure. To test you should do the following:
* using your favourite GCS load the ‘latest’ firmware from firmware.ardupilot.org4
* boot it up
* test all your sensors for correct output by monitoring them with the graphs on your GCS
* if everything looks OK then go for a fly
Note that this should be considered alpha code. If you are not comfortable flying alpha code then just do ground testing. Most of the testing we need can be done without flying.
Things to particularly watch out for:
* you will probably need to re-calibrate your magnetometers, especially if you have a HMC5983 external mag
* carefully check sensor orientation has come out right
* check that all the peripherals that worked previously still work (eg. rangefinders, RPM sensors etc)
* make sure you have all pre-arm checks enabled before flying
* you shouldn’t need to re-calibrate your accelerometers, but please do check for consistency between sensors before flying
Higher Sample Rates
If you have a board that has accel and gyro sensors capable of higher sample rates (eg. PixRacer, Pixhawk 2.1 or PixhawkMini) then you will automatically get a much higher sample rate on those IMUs. They will sample the primary gyro at 8Khz and the primary accel at 4kHz. This should result in considerably better handling of some types of vibration. Back to back flight logs with the current stable release of ArduPilot compared to the ‘latest’ firmware would be appreciated to confirm this, particularly for airframes that have had a problem with vibration.
Please report success/failure in this thread on discuss.ardupilot.org