Saturday, April 30, 2016

New quadcopter under development (Linux/Neo/OrangePI)

Finally have a new quadcopter design:

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?  
  1. Basics
    1. I2C: will use /sys/class/i2c
    2. SPI: Not supported yet; will get into that little latter
    3. PWM: (M4 Neo, OrangePI micro-controller)
    4. PPM/PWM deocde: (M4, OrangePI micro-controller)
    5. Software/Framework
      1. Boost ASIO
        1. asio offers as async/event loop
          1. High performance timers
          2. Support for serial events
          3. Support for network events
          4. Add support for DIO interrupts
      2. Boost logging
        1. integrated
      3. BaseFlight
        1. has a single poll loop to process events
          1. Will move each of these events to asio event:
            1. Serial: for GPS / Baseflight configurator
            2. Timer: process loop for FC
            3. 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.  


  1. Also, add PI zero. Working on SPI communication to external processor. So, now all 3 platform will be able to run the same code.

    Testing 4.4 PREEMPT for zero now. Making progress.

    1. Its booting:

      [ 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