I thought I’d mention some of the scheduling results we’re getting with ChibiOS.
Testing on a PH2.1 cube with 3 IMUs (two running at 8kHz), two baros and two compasses, we get:
APM: PERF: 0/4000 max=2829 min=2124 avg=2500 sd=89
APM: PERF: 0/4000 max=2829 min=2170 avg=2500 sd=89
APM: PERF: 0/4000 max=2833 min=2170 avg=2500 sd=88
APM: PERF: 0/4000 max=2830 min=2170 avg=2499 sd=88
APM: PERF: 0/4000 max=2835 min=2171 avg=2500 sd=90
APM: PERF: 0/4000 max=2831 min=2188 avg=2499 sd=87
APM: PERF: 0/4000 max=2830 min=2170 avg=2500 sd=88
APM: PERF: 0/4000 max=2831 min=2123 avg=2499 sd=89
APM: PERF: 0/4000 max=2829 min=2190 avg=2500 sd=90
APM: PERF: 0/4000 max=2829 min=2171 avg=2499 sd=91
APM: PERF: 0/4000 max=2830 min=2121 avg=2500 sd=90
APM: PERF: 0/4000 max=2829 min=2166 avg=2499 sd=87
APM: PERF: 0/4000 max=2834 min=2167 avg=2500 sd=92
that shows a scheduling accuracy worst case deviation of just over 300usec, with zero scheduling misses. Given it is doing 7k SPI transactions per second that is remarkable.
the total cpu load shown by SYS_STATUS.load is about 20%.
For comparison, on the current px4-v3 PX4/NuttX build with the same board, we get this:
APM: PERF: 39/4000 max=3851 min=2177 avg=2510 sd=128
APM: PERF: 38/4000 max=4080 min=2165 avg=2510 sd=126
APM: PERF: 36/4000 max=3591 min=2209 avg=2508 sd=116
APM: PERF: 40/4000 max=3702 min=2176 avg=2509 sd=123
APM: PERF: 40/4000 max=3880 min=2119 avg=2509 sd=124
APM: PERF: 41/4000 max=3800 min=2135 avg=2509 sd=122
APM: PERF: 39/4000 max=3839 min=2113 avg=2508 sd=123
and a SYS_STATUS.load of around 38%. The worst case scheduling deviation is over 1500usec, so 5x worse than with ChibiOS and nearly double the average CPU load. This is despite us having put a lot of effort into improving the NuttX results over the past year.
I think this is an extremely promising port.