Sunday, September 17, 2017

Cleanflight repo updated with OrangePI Zero Flight Controller

Updated https://github.com/tcmichals/cleanflight repo with current code for the OrangePI flight controller.
  • Replaced the cleanflight scheduler with libevent
    • all timers are based on libevent timers
    • in process of adding events for:
      • serial port
      • sockets
      • remote transmitters
    • Instead of using hard timers for the above events, timer is more of a timeout/guard.  The event, will be posted to wake up the task instead of a timer/poll event.  
    • For logging this will be moved into another thread using a message   So, sdcard write will not delay main processing loop, 
 Adding exti (external gpio interrupts).  Creating separate read file descriptors for each IO then push each one to libevent.  This way, when IO triggers libevent will dispatch the proper handler.   See if 4Khz is possible.

using top:
143   134 root     S     5804   1%   0% ./obj/main/cleanflight_LINUX.elf

Also added a command allowing to get basic info:

Task list             rate/hz  max/us  avg/us maxload avgload     total/ms
00 - (         SYSTEM)     10       2       1    0.5%    0.5%         0
01 - (            PID)     50     151     125    1.2%    1.1%        96
   - (           GYRO)    101
02 - (          ACCEL)    101     140     120    1.9%    1.7%        95
03 - (       ATTITUDE)    101       5       2    0.5%    0.5%         1
04 - (             RX)     50      18      10    0.5%    0.5%         4
05 - (         SERIAL)    101      12       2    0.6%    0.5%         1
06 - (       DISPATCH)
07 - (BATTERY_VOLTAGE)
08 - (BATTERY_CURRENT)     50       1       0    0.5%    0.0%         0
09 - ( BATTERY_ALERTS)      4       4       1    0.5%    0.5%         0
10 - (            GPS)
11 - (        COMPASS)
12 - (           BARO)
13 - (       ALTITUDE)
14 - (      TELEMETRY)    101       1       1    0.5%    0.5%         0
15 - (        RCSPLIT)
RX Check Function                   0       0                         0
Total (excluding SERIAL)                         6.1%    5.3%
LinuxFlight>


 I have to look into why some of the numbers a little high for PID and ACCEL.  Also add memory locking and add high FIFO scheduling.  But, looking good.


No comments:

Post a Comment