Finally have a new quadcopter design:
- Frame; 260mm with LEDs
- Motors/ESCs/props; 2205 @2300kv with 20apm ESC
- Transmitter/receiver Quanum i8 8ch AFHDS
estimated cost: $215.00
If you notice, there is no Flight Controller; the last one was a Teensy 3.1 with BaseFlight; well this time it will be Linux as Flight Controller OS with micro-controller decoding PPM/PWM and generating the PWM out for the ESC.
Which board? Udoo Neo will be the first one, the second board will be a Orange PI. The goal is to use Linux with PREMPT enabled. Did some initail testing with OrangePI with 4.6-rc4 and was able to generate a 50Hz square wave while running stress-ng, with no issues!
Using the Neo first because has a A9/M4 the Orange PI will need an external micro-controller.
So, how to port BaseFlight to Linux?
- Basics
- I2C: will use /sys/class/i2c
- SPI: Not supported yet; will get into that little latter
- PWM: (M4 Neo, OrangePI micro-controller)
- PPM/PWM deocde: (M4, OrangePI micro-controller)
- Software/Framework
- Boost ASIO
- asio offers as async/event loop
- High performance timers
- Support for serial events
- Support for network events
- Add support for DIO interrupts
- Boost logging
- integrated
- BaseFlight
- has a single poll loop to process events
- Will move each of these events to asio event:
- Serial: for GPS / Baseflight configurator
- Timer: process loop for FC
- Network: External WIFI (NEW)
Why not use use Ardcopter or TauLabs? This is a first pass and will be moving to one of them on the next round. Already have ported BaseFlight to Teensy 3.1; so already familiar with the code.
Which Kernel? Right now, the Udoo Neo is 4.5 with some patches for RPMSG. OrangePI, did some testing with 4.6-rc5; but waiting for more patches to go into mainline; so, 4.7.
BaseFlight has been ported to Linux; just debugging I2C; then pull apart main.c /loop and move to boost asio. Will post the modifications in a few weeks. Right now, getting Udoo Neo RPMSG working in 4.5.
Also, add PI zero. Working on SPI communication to external processor. So, now all 3 platform will be able to run the same code.
ReplyDeleteTesting 4.4 PREEMPT for zero now. Making progress.
Its booting:
Delete[ 0.000000] Linux version 4.4.10-rt17 (tcmichals@tcmichals-Studio-540) (gcc version 5.3.0 (Buildroot 2016.05-rc2-00003-g46f9454) ) #1 PREEMPT RT Wed May 25 22:20:45 CDT 2016
[ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] Machine model: Raspberry Pi Zero Rev 1.2