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

  • @matic Jovanovic where can I get one or two of these guys from? this is the last piece to my puzzle so i dont have to use protoboards anyway.

  • Finally got round to actually making this... 

    Thanks Patrick, you the man

    3702350048?profile=original

  •  Nice :-)

  • Hi.

    As I said before, I have finished two PCBs DronPi and DuePi, if it is of your interest you can find the information in GitHub

  • so it turns out the voltage divider was not necessary. ended up using the same satellite receiver i thought i burned up and it has been fine. I had gone on a flashing spree with my 9xr recently and screwed alot of things up. I was able to get a simple 4 channel setup going and reading properly. will setup the rest of my switches etc later. I bought two more pi zeros from adafruit and one was the camera kit. my plan noow is to use the pi's camera and have it output to the composite video output. I can then use a vtx to transmit to goggles etc..

  • @Partrick Portier I managed this without the voltage divider circuit but seem to be having some issues. my receiver seems to be detecting my transimitter as mode2. I get response from the right stick but none from the left. I am using a spektrum satellite receiver and may consider purchasing some orangerx receivers as I used those with success before. When I am in qgroundcontrol I see movemtn only on the right stick. Is this due to me not using a voltage divider?

  • @Alex  Magic Smoke is bad :-( 

    Here is a picture of a voltage divider

    Résultats de recherche d'images pour « pwm input voltage divider »

    V-in is the signal of the PPM output of the receiver

    V-out is the PPM in = GPIO04 (pin 7) of the  RPI

    The GPIO is 3.3V , so if your receiver is 3.3V, you dont need a voltage divider

    If your receiver is 5V , you need a 1/3-2/3 voltage divider. Any combination or resistance over 1 Kohm make the job , this is why we often use R1= 1Kohm & R2= 2Kohm

    This makes the total current drain on your radio circuitry 5V/1k+2k = 1,6 mA safe for the output driver

    Hope it helps

  • @Partrick Portier the voltage divider circuit for rc input can you elaborate on that. I have never had to make one and wanted to make sure i did it right. Saw some magic smoke from one satellite receiver while testing.

  • Patrick, this looks interesting, im gonna look into that, thank you.

    Alex. Yes, telemetry will be a way to go. Im gonna buy some hmtrp modules and cp2101 samples :D

    I like to make my life complicated haha.

  • matic why not use a usb telemetry dongle. it can either be connected to usb or a uart port i believe. not 100 on the port I have used it with the bbbmini through usb and serial/uart like i said memory fails me and too lazy to look it up.

This reply was deleted.