User avatar
Marlon G.
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany

Quadcopter+Raspberry Pi = PiCopter

Sat Mar 02, 2013 9:13 pm

Hi.
I am building a Quadcopter based on a Raspberry Pi. Today I made the successful Test-flight, that means there were no technical Problems.

Some Facts about my PiCopter:
-No Arduinos or so for flight control
-Everything runs on the RPi
-no realtime Kernel only standard Raspbian
-Software written in C++
-Radio Controll based on RFM12 and Arduinos (only connects RFM12)so that you can send Command Signals from a Laptop to the RPi
-By now i am using an PlayStation Controller for flying (not the best Solution)

I am using the MPU6050 and special Motor controllers that work with the I²C Protocoll. So i do not have to generate a PWM Signal.

Main Problem: I can not fly it realy good ;-)
Well here is a video http://youtu.be/lNwukrn3tvc


I will post the Code later, by now its not very nice and i have to change some things to make it readable and expandable.

So long, Marlon


Update:
Second Flight-Video (much better)
Last edited by Marlon G. on Mon Mar 04, 2013 3:16 pm, edited 1 time in total.

User avatar
joan
Posts: 14021
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Quadcopter+Raspberry Pi = PiCopter

Sat Mar 02, 2013 9:22 pm

Good job.

How heavy is the unit and what sort of battery are you using?

User avatar
Marlon G.
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany

Re: Quadcopter+Raspberry Pi = PiCopter

Sat Mar 02, 2013 9:27 pm

I think it weights about 1000g with batery.

I am using 2700mAh 3s LithiumPolymer batteries

User avatar
joan
Posts: 14021
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Quadcopter+Raspberry Pi = PiCopter

Sat Mar 02, 2013 9:29 pm

Thanks. It looks like a really interesting project.

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Mar 03, 2013 12:44 am

Lovely :)
How much did it cost?

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

User avatar
Marlon G.
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Mar 03, 2013 5:27 pm

simplesi wrote:Lovely :)
How much did it cost?

Simon
too much ;-)



Today a friend and I made a very good flight. I will upload a Video later.



Edit: Too much means "more then i first thought" but less then a comparable Copter:
https://www.mikrocontroller.com/index.p ... 71a0b2d365
I am using the same Motors and the same Motor-controllers (as i know the only Controllers with I²C).

User avatar
Fluo
Posts: 12
Joined: Fri May 18, 2012 1:44 pm
Location: Poland

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Mar 03, 2013 7:07 pm

stupid question have you got a gyroscope and accelerometer? If yes the quadrocopter requires some works with config of gyro
A man who won't lie to a woman has very little consideration for her feelings.

User avatar
tonyhughes
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Mar 03, 2013 7:09 pm

Very cool. Great test flight for a new build and no realtime controller.

User avatar
Marlon G.
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Mar 03, 2013 7:56 pm

Fluo wrote:stupid question have you got a gyroscope and accelerometer? If yes the quadrocopter requires some works with config of gyro
off course it have a gyro and acc.

They are working fine, maybe a little bit of fine tuning.
But thats not the Problem.

The Problem is a nervous and untrained Pilot who tries not to hit the trees

The Flight today was much better and very stable. I will post the video later.

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Mar 03, 2013 9:01 pm

I'm thinking that the RPi is simply being used as a WiFi remote receiver to a standard Quadcopter?

I think we'd all thought that you managed to get the RPi to do all the real-time motor balancing :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

User avatar
Marlon G.
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Mar 03, 2013 9:09 pm

So here is the Video from today:
VIDEO #2
It is much better, but it was not the best flight from today, unfortunately it is the only video we made.

A little bit about the Hardware:
- 4x Robbe Roxxy 2827/34 Brushless Motor
- 4x BL-Ctrl V1.2 (http://mikrokopter.de/ucwiki/en/BL-Ctrl_V1.2)
- Raspberry Pi ;-)
- Arduino+RFM12 for Radio transmission over ttyUSB0
-MPU6050 Motion Sensor (Gyro+Acc)
-3-Axis Digital Compass HMC5883L (not in use)
-ublox5 GPS (not in use)
-WiFi Dongle to ssh into the RPi (I tried to use it for Radio control but that do not work very good)

Hardware that should be add:
-barometric Sensor
-5x Ultrasonic Rangesensor
- maybe new Radio system with Xbee Pro

The Software is mostly written by my own and so most Parameter (like PID) are not compareable to other Quadrotors.

The Software reads the Sensordata with 300hz-500hz and controls the Motors with 50hz.
Most of the time the Software waits for Sensordata because I²C is "slow". The actual computation takes barely no time (everything with floating point Numbers).

Marlon

User avatar
Marlon G.
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Mar 03, 2013 9:18 pm

simplesi wrote:I'm thinking that the RPi is simply being used as a WiFi remote receiver to a standard Quadcopter?

I think we'd all thought that you managed to get the RPi to do all the real-time motor balancing :)

Simon
No!
There is no standard Quadcopter Board. The RPi controls everything.

The Radio System works on 433MHZ.

And you do not need hard realtime. You only have to update the Motors with at least 10hz (I tried it with 5hz at the teststand and it worked)

And since the Controlprogram is the only thing that is running on the RPi thats no Problem

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Quadcopter+Raspberry Pi = PiCopter

Mon Mar 04, 2013 8:18 am

WOW THEN :-)

So RPi is doing all the motor control based on gyro/motion info - brilliant :)

:)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

User avatar
noudio
Posts: 8
Joined: Sun Mar 03, 2013 7:41 am
Location: Nijmegen, the Netherlands

Re: Quadcopter+Raspberry Pi = PiCopter

Tue Mar 05, 2013 6:14 am

Cool! Very cool!
Does the program just normally run as any other program, or did you do special things on the Pi to ensure your program remains responsive?. For example special kernel privileges/nice/using interrupts...?
Noudio

rudiratlos
Posts: 131
Joined: Tue May 01, 2012 8:47 am

Re: Quadcopter+Raspberry Pi = PiCopter

Tue Mar 05, 2013 8:36 am

Hi,

yesterday, I have released Revision 2 of the piggy-back board. The functionality and the condensed physical dimensions (see pictures on page 5) could be very helpful for your quadcopter project.
On the board, a RFM22B Tranceiver chip can be mounted. Shouldn't be so problematic to adpat the RFM13 code. Also the IMU part could be mounted directly on the breadboard section (page 6) or just conected to the I2C connector port. Pls. see page 23 of the
kit assembly and sw setup guide: http://shop.basis.biz/shop/images/manuf ... n_Rev2.pdf

User avatar
Marlon G.
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany

Re: Quadcopter+Raspberry Pi = PiCopter

Tue Mar 05, 2013 7:04 pm

noudio wrote:Cool! Very cool!
Does the program just normally run as any other program, or did you do special things on the Pi to ensure your program remains responsive?. For example special kernel privileges/nice/using interrupts...?
The program runs like every other program, and by now there are no special privileges or so. I thought about using a special scheduling group (https://github.com/raspberrypi/linux/bl ... -group.txt) but by now i never had problems without. So it will run in normal mode until i get problems (I want to try using a camera and OpenCV for navigation without GPS, http://en.wikipedia.org/wiki/OpenCV).
But the next goal is to use GPS.

@rudiratlos
Your board looks nice but I don't want to rebuild my design around your board.

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: Quadcopter+Raspberry Pi = PiCopter

Thu Mar 14, 2013 3:41 am

Looks like you have decent hardware on that quad-rotor. From the battery size, motors(k/v rating) and the weight you are getting about 7 to 8 minutes flight time. This depends upon the prop size you are using on the quad. The RasPi is quite a bit heavier than a hobbyist Flight control board. Of course the RasPi should be able to handle other jobs that cannot be done by most FCB's.

It still amazes me that the RasPi is working so well without a real time OS. You may have to give the flight control software priority if you hand several other tasks to the RasPi. It will be interesting to see at what point you have to resort to that! I am betting that using it as an onboard video would possibly be that point. It will depend on how much of that task is on the GPU versus the ARM.

Interesting project!
Good Job!
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

chod
Posts: 2
Joined: Mon Mar 25, 2013 10:39 pm

Re: Quadcopter+Raspberry Pi = PiCopter

Mon Mar 25, 2013 10:42 pm

interesting stuff, is the code available? interested in trying to understand whats involved in the code

User avatar
Marlon G.
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany

Re: Quadcopter+Raspberry Pi = PiCopter

Tue Mar 26, 2013 1:39 pm

chod wrote:interesting stuff, is the code available? interested in trying to understand whats involved in the code
Not by now. I want to change some Things before i make it available.

Wismac
Posts: 1
Joined: Fri Apr 12, 2013 10:53 pm

Re: Quadcopter+Raspberry Pi = PiCopter

Fri Apr 12, 2013 10:54 pm

Looking forward to your source code. I'm excited to get a quad-copter project started with one of my Pi's

Thanks! Safe flying!

filmschoolgeek
Posts: 1
Joined: Sun Apr 14, 2013 7:18 am

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Apr 14, 2013 7:48 am

Hi,

I'm a specializing in Camera movement and stability at Uni next semester, i want to build a steadycam unit based on the Freefly MoVI using brushless motors and thought about using a Raspberry PI instead of the normal controllers that most copters use.

How do you connect the motors to your Pi? what software are you using to run them? you might have already stated this in the posts above but i am a layman when it comes to these things.

hope you can help

User avatar
davidstory
Posts: 15
Joined: Sat Feb 09, 2013 5:32 am
Location: San Diego, CA

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Apr 14, 2013 4:40 pm

Most motors are controlled by Electronic Speed Controllers (ESC), you'll need one for each motor. The ESC is controlled with a Pulse Wave Modulation (PWM), the Raspberry Pi has one, you need four. I think you can use adaFruit's 16-Channel 12-bit PWM/Servo Driver - I2C interface - PCA9685 $15 USD. This way you can control each motor with simple I2C commands.

User avatar
Marlon G.
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Apr 14, 2013 4:43 pm

I use ESCs with onboard I²C Interface.

https://www.mikrocontroller.com/index.p ... cts_id=209

User avatar
Bigcat123
Posts: 230
Joined: Thu Aug 23, 2012 2:41 pm

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Apr 14, 2013 8:14 pm

Marlon G. wrote:So here is the Video from today:
VIDEO #2
It is much better, but it was not the best flight from today, unfortunately it is the only video we made.

A little bit about the Hardware:
- 4x Robbe Roxxy 2827/34 Brushless Motor
- 4x BL-Ctrl V1.2 (http://mikrokopter.de/ucwiki/en/BL-Ctrl_V1.2)
- Raspberry Pi ;-)
- Arduino+RFM12 for Radio transmission over ttyUSB0
-MPU6050 Motion Sensor (Gyro+Acc)
-3-Axis Digital Compass HMC5883L (not in use)
-ublox5 GPS (not in use)
-WiFi Dongle to ssh into the RPi (I tried to use it for Radio control but that do not work very good)

Hardware that should be add:
-barometric Sensor
-5x Ultrasonic Rangesensor
- maybe new Radio system with Xbee Pro

The Software is mostly written by my own and so most Parameter (like PID) are not compareable to other Quadrotors.

The Software reads the Sensordata with 300hz-500hz and controls the Motors with 50hz.
Most of the time the Software waits for Sensordata because I²C is "slow". The actual computation takes barely no time (everything with floating point Numbers).

Marlon
How on earth did you get Brushless motors to work?!
Just a beginner sharing his experiences on his way to geek nirvana...

User avatar
joan
Posts: 14021
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Quadcopter+Raspberry Pi = PiCopter

Sun Apr 14, 2013 8:18 pm

Bigcat123 wrote:...
How on earth did you get Brushless motors to work?!
I think BL-Ctrl V1.2 is the equivalent of an ESC.

Return to “Automation, sensing and robotics”