I finally received my Raspberry Pi Zero,  just in time to get into the DIY challenge of building a smart drone with the Pi Zero and APM under 100$. I called this project: MINI-Zee

3689684951?profile=original

How this can be done?

Well first of all, thanks to Victor and the team at Erle Robotics for releasing the plans and software of their PXFmini.  This is a real inspiration for building my own board, because all the parts are available at a cheap price and are relatively easy to assemble and interconnect using through-hole breadboard, providing you are very experienced with this type of build.  Thanks to Mirko as well, for having introduced a real DIY autopilot project that allows us to experiment with a fully working and well supported BeagleBone  based  ArduPilot  Cape called the BBBMINI.


3689684972?profile=original

Bill of Material (US$ - Transport & taxes excl.):

Raspberry Pi Zero                                      5.

MPU 9250 (SPI 9 dof IMU)                         8.

MS 5611 (SPI Baro)                                   9.

PCA 9685 (16 channel PWM Servo Driver)  5. 

3.3 v. regulator                                          1.

BEC 3 amps                                             3.

Breadboard, Resistors, Connectors, Misc.   7.

                                               AutoPilot:  38.

HobbyKing Spec FPV250 V2 Quad Copter

ARF Combo Kit - Mini Sized FPV         60. 

                                                     Total:  98.

*This is Banggood price; I had an ADAFRUIT –PWM on hand, and I really recommend going with ADAFRUIT, because of all the effort  they put on making a great tutorial and drivers for this product. Note: Just like Erle , the USB WIFI, GPS and the Radio Control are excluded.

Building:


A) Hardest part: Get a  RASPBERRY PI ZERO (Where is my Zero site)
B) Hardware - See BOM
C) Board Schematics : Erle pxfmini
D) Board Software: Erle pxfmini

E) LOAD LATEST Raspbian-Jessie

Disable serial Login (Allow GPS on serial Port)
Enable , I2C, SPI , Serial
Disable Console = Auto Log on a shell


F) LOAD RT-PREEMPT
http://www.frank-durr.de/?p=203
Load Test Result: TEST: T: 0 ( 1136) P:80 I:500 C: 100000 Min: 16 Act: 31 Avg: 32 Max: 157


G) MAKE ArduCopter

Special MINI-ZEE release:
1) The MPU 9250 is mounted on the Z-Axis, so we need to change : 

CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXFMINI
, _default_rotation(ROTATION_YAW_270)  = to ROTATION_NONE

2) The PCA9585 has no external clock, and the ESC are connected to ports 1-2-3-4, so we need to change: 

static RCOutput_PCA9685 rcoutDriver(PCA9685_PRIMARY_ADDRESS, true, 3, RPI_GPIO_27);      -to-

static RCOutput_PCA9685 rcoutDriver(PCA9685_PRIMARY_ADDRESS, false, 0, RPI_GPIO_27);

H) Fly the MINI-ZEE == Add these to /etc/rc.local

#wait till network is up and DHCP assigned address

while ! ifconfig | grep 192.168.2. >> /home/pi/bootlog; do
echo “no network, waiting…” >> /home/pi/bootlog
sleep 5
done
echo “Starting ArduCopter” >> /home/pi/bootlog

sudo /home/pi/ardupilot/ArduCopter/ArduCopter.elf -A udp:192.168.gcu-address:14550  -B /dev/ttyAMA0 > /home/pi/startup_log &

exit 0

I) FIRST FLY LOG:

3689684898?profile=original

Thanks to the damping platform, the vibration level is within specs. Video is available for anyone interested..;-)

Conclusion:

This project took about 20 hours to complete. As you can see, I really enjoyed  doing some hardcore DIY to demonstrate that it is still possible to build your own flight controller from a Linux Based system.  I do not recommend to try this as a first project, but if you are interested, get a BBBMINI, this is the best introduction to DIY  and if you want to fly a Raspberry Pi Zero, it is much  easier to buy a PXFMINI.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • I mean befinitif

  • Hello Alex

    This is on the quad, and with hostapd the Mini Zee IS the Access Point, so my laptop attach to the quad.

    Yes I am actually testing with different types of antennas - clover leaf /patch / others.

    No these would not work with WIFI Broadcast, as I can see the best would be using the TPLINK on 2,4 ghz === so getting back to conflicting frequency. I know that benetiv made a clever device with a cpld so we could split the spread spectrum. I left a message on the wifibroadcast to benetiv to check if he was still active, so far no answer...

  • @patrick Are you using this on your quad or on the receiving end? Would two of those dongels work well for wifibroadcast? Also would using a different kind of antenna like a patch/yagi increase the range of the things?

  • Just an update on conflicting 2,4 Ghz between WIFI and Radio-Control.

    ,I switched WIFI to an EDIMAX AC600 running as an Access Point  on 5 GHZ  with the use of HostApd and loading this DRIVER.

    Here is a picture of the modified USB Dongle with the micro USB adapter cable soldered directly + a 5volts BEC  + a RP-SMA adapter cable to attach the 5GHZ antenna.

    So far the tests are good, I'ts flying smoothly and the video is fluid at 640x480 x 20fps up to 500 Meter.

    3702287667?profile=original

  • Yes,

    This can be implemented as a service and now that the latest Raspian releases are getting into Ubutu service model this and be an option. But considering this is an experimental branch, I prefer keeping it as simple as possible and loading with rc.local offers lot of flexibility and has the advantage of an easy ''kill'' within sudo top command

  • Hi. After getting ArduCopter.elf, you must create a script and service to run with startup raspberry, run_copter.sh and systemctl enable copter.service? Thank

    Regards

  • Well, at a second though, this was not a good example, take a at those Flight Controlers that are on my wish list :-)

     http://www.banggood.com/TAULABS-SPARKY2_0-Flight-Controller-with-ST...

    But at the price, it is getting quite close to a full blown PixRacer:

    http://www.banggood.com/Pixracer-Autopilot-Xracer-V1_0-Flight-Contr...

  • @Alex, yes hackerboards is on my morning reading list, but this morning I was out early to continue my test on camera, and it still need lots of tweeking, but we'll get there :-)

    That board is a nice weather station, but I would not fly a weather station (LOL) : The bmp180 & lsm303 are the old generation of sensors. The ms5611 and the mpu9250 are , at the moment, top of the line sensors for flight controller. Just look in the NAZE world, and all the new high performance FC are using these devices , take a look:  http://seriouslypro.com/spracingf3evo

    Seriously Pro Racing - SPRacingF3EVO Flight Controller
  • @patrick I'm back with another suggestion. I was on linuxgizmos.com, now hackerboards, and noticed this pi zero hat http://hackerboards.com/raspberry-pi-zero-sized-hat-has-four-sensor...

    It has the bmp180 which i know to be supported by ardupilot and the lsm303d gyro as welll. not sure about the lsm303d but with a few hats and a pi zero you may have a solderless solution except for soldering the pins on the pca9685 servo hat.

    LinuxGizmos.com - Embedded Linux news & devices
    Embedded Linux news & devices
  • Well, just a word of caution from an old DIYer ; Proceed by steps and do not put too much unknowns on a prototype build. Make it work first, and the you can step into the unknown, personally I have so many projects going on (10 builds actually)  that I try to keep the OS & the Code vanilla...

This reply was deleted.