Building an autopilot from scratch using a RaspBerryPi Zero : Mini Zee

Here is another 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.

1 Like

Here is a picture of my routing; Imu on top , Baro bottom, they share the same SPI bus, with different CS (Chip Select), VCC, Ground and X=Not Connected.
Hope it can help :wink:

3 Likes

First of all congratulations for the project, very inspiring, it’s the first one I meet.

I’m starting in the area of drone projects, and I have an idea of making an autopilot for mine, I found your topic interesting and would like to exchange some ideas with you, for example, does the drone follow a preconfigured route? Can he have a reasonable speed?

I am grateful now.

Thank You.

The speed is related to the type of quadcopter, In the model showned here , the speed can be quite good (up to 100 Kmh) in manual (stabilized or acro mode).

I suggest you go through the wiki , you will find answer to most of your questions: http://ardupilot.org/copter/docs/auto-mode.html

And for building, you might consider building a BBBMINI https://github.com/mirkix/BBBMINI this is easier to build and you benefit from a better support.

Ok, I’m very grateful, it will be of great help, and I already read about BBBMINI, it really supplies all expectations.

Once again, congratulations on the project!

Could you tell me where you bought the drone structure? I live in Brazil, there are no stores with this material.

@Joao_D_Junior ,
most of my stuff is from China, either Banggood , Aliexpress or HobbyKing

@ppoirier , and others…

Hi!
I got inspired by this post a long time ago, and finally I started to build my own version of your project. I understand that the Pi0 isn’t the best option for running Ardupilot, I’m using the Pi0 because to learn both Raspberry and the Ardupilot code.

I’m running Raspian Stretch with kernel 4.14.81-rt47+ (RT patch from the official raspian kernel git) and Arducopter 3.6.3 compiled for PXFMINI with the mods for PCA9685 as you have described. I see that the code has changed a bit since you made your controller.

I have got everything working except the PCA9685. Without the PCA9685 I can start arducopter on the PI, and connect to my GCS. When I connect the PCA9685 it’s not possible to establish an connection with the GCS. It looks like arducopter starts without any errors.

Is the problem the change in the code regarding how ardupilot handles the PCA9685 over i2c?

Best regards
Alex

@JAR4x4 cool, as noted here:

Have you modified these lines ?

@ppoirier , thanks for your quick reply!

Yes, I have modified that line, just changing true to false, and 3 to 0

running sudo i2cdetect -y 1 shows the address of the PCA9685. I have also tried to run raspbian without the RT patch = same problem

Did you connect the PWM enable (GPIO27) pin 13 to the PCA OE ?

Yes, I have tried both with and without PWM enable connected

I’m going to check now if the PCA is actually working with the Adafruit python library

Yep, I was about to suggest that and checking with a bus analyser if you have one. Otherwise the code might be broken, I dont think anyone is building pxfmini these days… It’s a ChiBios world with F4 & F7 FC now…

Hehe, I know… But I want Linux onboard for the learning… :wink: I don’t have a bus analyzer, but i wil hook my scope up to PWM0 and see what happens when i run the python example. I will post back with my results.

I think Erle still is selling the Pxfmini? Maybe they run a custom erle ardupilot flavour?

I think Erle is running an oudated version of ardupilot, … looking at Erle Forum I dont see much activity either…
Anyway, this is still a good primer project for anyone interested in linux integration , as long as the code is not broken :slight_smile: and be aware that the PPM routine using the DMA Soft Int has not aged well, it had a tendency to crash on since 3.5

Ok, I have seen that, but I will try to compile the erle fork now, and see if that helps.

I hooked my PCA to my scope and ran the Adafruit test code, looks like the PCA works =)

Yes, I have seen that there has been some issues regarding PPM. No problem for me in this project, I’m going to use mavlink for controls over a wifibroadcast setup I’m also working on =)

Might try adding a bus define ? … something like:
#define HAL_RCOUT_RCOutput_PCA9685_I2C_BUS 1
here:

Thanks for the tip, but I’m not that into the code yet… I found that the PCA address is defined here:

This is the same address that pi@raspberrypi:~ $ sudo i2cdetect -y 1 displays…

Has anyone tested that this code works?:

@ppoirier is there any chance you still have the arducopter binary you compiled for your project still?

I tried to compile from the Erle fork, but it seems the waf code is broken in their fork :frowning:

Well. I might try building it , where did you get your RT kernel ?
What cross compiler are you using for the RPI Zero ?