Quadcopter+Raspberry Pi = PiCopter


109 posts   Page 2 of 5   1, 2, 3, 4, 5
by davidstory » Sun Apr 14, 2013 9:22 pm
Hi Marlon,
I was going to try to use wifi for radio control, but read that it didn't work well for you. Can you give more details why it didn't work? (range, delay, interference, etc..)
User avatar
Posts: 15
Joined: Sat Feb 09, 2013 5:32 am
Location: San Diego, CA
by Marlon G. » Sun Apr 14, 2013 9:23 pm
joan wrote:
Bigcat123 wrote:...
How on earth did you get Brushless motors to work?!

I think BL-Ctrl V1.2 is the equivalent of an ESC.


exactly
User avatar
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany
by Marlon G. » Sun Apr 14, 2013 9:29 pm
davidstory wrote:Hi Marlon,
I was going to try to use wifi for radio control, but read that it didn't work well for you. Can you give more details why it didn't work? (range, delay, interference, etc..)


Main Problem was that when the connection breaks, it needs much time to rebuild the connection(Handshake and so on). But you dont have much time, so the Copter crashes.
But with better Antennas I think it would be possible to use wifi.
Maybe ssh was a Problem too...
User avatar
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany
by davidstory » Mon Apr 15, 2013 3:28 pm
How about implementing a "hovering" mode when the connection is lost?
User avatar
Posts: 15
Joined: Sat Feb 09, 2013 5:32 am
Location: San Diego, CA
by Marlon G. » Mon Apr 15, 2013 8:04 pm
davidstory wrote:How about implementing a "hovering" mode when the connection is lost?


That would be possible, but you have to use at least a GPS to hold the position.
User avatar
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany
by davidstory » Tue Apr 16, 2013 3:29 am
I have a Gyroscope, Accelerometer, and Magnetometer connected to a Raspberry Pi and communicating over an I2C connection. I coded up Mayhony's Quaternion implementation of a DCM filter. The RPi can read all three sensors and pass through the filter, resulting in a stable Yaw, Pitch, and Roll in 3 milliseconds. Holding the breadboard in my hand I can spin it around and watch the values change accordingly.

I also have an I2C servo/driver board to control the Electronic Speed Controllers.
Next, I need to come up with a protocol to control the copter over wifi, any suggestions?

I have not purchased a quadcopter frame, ESC's, motors, propellers, or battery yet.
User avatar
Posts: 15
Joined: Sat Feb 09, 2013 5:32 am
Location: San Diego, CA
by Marlon G. » Tue Apr 16, 2013 10:18 am
davidstory wrote:I have a Gyroscope, Accelerometer, and Magnetometer connected to a Raspberry Pi and communicating over an I2C connection. I coded up Mayhony's Quaternion implementation of a DCM filter. The RPi can read all three sensors and pass through the filter, resulting in a stable Yaw, Pitch, and Roll in 3 milliseconds. Holding the breadboard in my hand I can spin it around and watch the values change accordingly.

I also have an I2C servo/driver board to control the Electronic Speed Controllers.
Next, I need to come up with a protocol to control the copter over wifi, any suggestions?

I have not purchased a quadcopter frame, ESC's, motors, propellers, or battery yet.


I just send a string like "x=0.23 y=0.123 ..." so you can read the communication with every Programm.

But i had Problem with the Mahony Filter. The Copter started to oscilate after a few seconds. Maybe i had just wrong parameters.

I will try to get the Code ready for posting at this weekend.
User avatar
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany
by davidstory » Tue Apr 16, 2013 4:49 pm
I'm writing this one using the Go programming language (http://golang.org), and have posted the source on Github (https://github.com/idavidstory/goPiCopter).
User avatar
Posts: 15
Joined: Sat Feb 09, 2013 5:32 am
Location: San Diego, CA
by Marlon G. » Tue Apr 16, 2013 11:06 pm
davidstory wrote:I'm writing this one using the Go programming language (http://golang.org), and have posted the source on Github (https://github.com/idavidstory/goPiCopter).


Looks like a good choice for a programming language. I first tried it in python (my favorite language, just import evrything you need and it works ;-) , but the I²C implementation was too slow. Now i am using C++.
User avatar
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany
by davidstory » Fri Apr 26, 2013 11:39 pm
How do you read the signal from the Remote Control receiver?
I assume its producing a PWM signal, and I'll need a chip that converts that to something I can read on the RPi.
User avatar
Posts: 15
Joined: Sat Feb 09, 2013 5:32 am
Location: San Diego, CA
by Marlon G. » Sat Apr 27, 2013 11:13 pm
davidstory wrote:How do you read the signal from the Remote Control receiver?
I assume its producing a PWM signal, and I'll need a chip that converts that to something I can read on the RPi.

I do not use a Remote Control Reciver like other Quadcopter. Im using a RFM12 radio module:
http://svn.clifford.at/metaparts/trunk/ ... 010412.pdf

But i would use an arduino for that.
User avatar
Posts: 30
Joined: Sat Oct 20, 2012 10:51 pm
Location: Germany
by blahbot90 » Mon Apr 29, 2013 3:31 am
Would you consider posting a pin out diagram/schematic? I'm very curious as to how you're routing everything. I'm new to the whole raspberry pi thing, but not to quadcopter development ;)
Posts: 1
Joined: Mon Apr 29, 2013 3:28 am
by davidstory » Mon Apr 29, 2013 6:18 am
Connecting everything to the I2C bus using the four pins (pwr, gnd, scl, sda).
The RaspberryPi is the master, the Gyroscope, Accelerometer, Magnetometer, and PWM Driver are the slaves. The PWM Driver is used to send signals to the 4 Electronic Speed Controllers.
User avatar
Posts: 15
Joined: Sat Feb 09, 2013 5:32 am
Location: San Diego, CA
by 1FordPrefect » Sat May 11, 2013 5:14 am
I am actually trying to design and develop quad copter that will function just like Parrot A. R. Drone 2, Wifi controlled real time FPV utilizing IOS/Android tablet or phone, my angle would be to use a 3G/4G dongle, which would increase distance from 165FT (Parott A. R. Drone) to 1KM.

I have a frame, I have motors and ESC's, propellers, need 2 cameras, one vertical and the other horizontal, just like A. R. Drone, but I would like to use 2 x 1080P HD camera's. If I use Raspberry Pi (master)and I would also use a OpenPilot Revolution Kickstarter (slave) board or some other platform, of course have to have GPS, Ultrasonic Range Finder, and other sensors necessary for stable autonomous flight.

I am using the QAV400 frame, very nice frame, fpvmanuals 30 amp ESC with SimonK firmware, Tiger MT2212-11 KV100.

http://www.getfpv.com/multi-rotor-frame ... frame.html

I will be using the quad to take pictures, so stability, reliability is my priority.
Last edited by 1FordPrefect on Sun May 12, 2013 12:48 am, edited 2 times in total.
User avatar
Posts: 12
Joined: Sat May 11, 2013 4:10 am
by davidstory » Sat May 11, 2013 5:40 pm
Wow, that's a wicked frame. Looks like a fun build. Keep us up to date, feel free to ask questions.
User avatar
Posts: 15
Joined: Sat Feb 09, 2013 5:32 am
Location: San Diego, CA
by 1FordPrefect » Sun May 12, 2013 3:34 am
David,

I am thinking that by using Raspberry Pi for the quad copter it will have more then enough processing power to do just about anything, you can take care of everything, WiFi or 3G/4G modem, so all communications like receive, transmit, telemetry, ground station functions, software updates, firmware updates, total flight control, fault tolerance, like fail safe, hover, land, go home, etc., utilize the Raspberry Pi for FPV HD 1080P camera, maybe dual camera's one for horizontal and one for vertical use with a mount gimbal that can turn left, turn right, etc., Raspberry Pi 1080P HD camera will be available soon.

That would also allow you to truly utilize Raspberry Pi as a master command center, all the high level commands as well as middle level commands, would be processed via Raspberry Pi...OpenPilot flight control board and accessories would take care of the actual motor control, the actual flight, and any other functions related to actual flight control, the low level commands. The use of a flight control board would eliminate the need to write Linux device drivers for various hardware accessories. I am thinking that even having an extra battery, a smaller battery to use for Raspberry Pi backup, in case you are low on battery power, you will have enough power to land copter or perhaps deploy a parachute of some kind.

I am in the process of learning about OpenPilot Hardware and Software, also Raspberry Pi, and the accessories for Raspberry Pi.

I have an idea what I want to do and somewhat how to do it.

You bet I will ask question when I get stuck on something, I just hope people will answer. Bottom line I will keep this open software, which should benefit all RC hobbyists.

Image

Image

Image
Last edited by 1FordPrefect on Sun May 26, 2013 3:46 am, edited 1 time in total.
User avatar
Posts: 12
Joined: Sat May 11, 2013 4:10 am
by FlyRPi » Mon May 20, 2013 3:04 pm
I have been thinking about building a Pi quad as well, and I am going to take it step by step since I have very little electronic/programming experience. So far, I have a Pi, a 1000Kv brushless motor, a 30A ESC, and adaFruit's 16-Channel 12-bit PWM/Servo Driver. Once I solder adaFruit's cobbler and PWM/Servo Driver, I'm initially going to try to run a program to receive commands through the Rii mini keyboard through the RF 2.4GHZ signal. If that works, next steps will be to run 4 motors, and mount them on the <a href"http://hobbyking.com/hobbyking/store/__22781__Turnigy_Talon_Quadcopter_V2_0_Carbon_Fiber_Frame_550mm.html">Talon 2.0 frame</a>.</br></br>I'll post an update here once I get the motors running.
Posts: 2
Joined: Mon May 20, 2013 2:26 pm
by davidstory » Mon May 20, 2013 6:14 pm
Hey FlyRpi, that is a nice approach. Keep us up to date with your progress.
User avatar
Posts: 15
Joined: Sat Feb 09, 2013 5:32 am
Location: San Diego, CA
by 1FordPrefect » Tue May 21, 2013 12:25 am
I am talking to this guy, he used a DJI Naza and he created his own app to control the QC via smart phone, that is not the problem, the problem is selecting the right flight control board that can communicate via Wi-Fi or 3G/4G dongle and FPV.

https://ygramulqc.wordpress.com/2012/07/25/quadrocopter-control-with-selfmade-smartphone-app/#comment-102

I am capable of writing my own client app code in either Java or C/C++, the issue is which flight control board to use to accomplish what I would like to accomplish FPV with two HD cameras horizontal and vertical, one mounted to a gimbel, and using Wi-Fi or 3G/4G dongle to communicate with IOS/Android device, just like Parrott A. R. Drone 2.0.

First dilemma is selecting flight control board, second dilemma is wiring all the electronics to the dirty board and for this I would prefer not to solder motors to ESC and ECS to dirty board on my QAF400, I rather have everything pluggable easier to replace parts when they fail, or when you need to replace them.
User avatar
Posts: 12
Joined: Sat May 11, 2013 4:10 am
by 1FordPrefect » Thu May 23, 2013 6:12 am
I ordered a Raspberry Pi Camera Board for FPV, so I hope to hook up camera to RP and start to work on some code...
User avatar
Posts: 12
Joined: Sat May 11, 2013 4:10 am
by davidstory » Thu May 23, 2013 3:53 pm
Just got my RPi camera yesterday... gonna play with it this weekend.
User avatar
Posts: 15
Joined: Sat Feb 09, 2013 5:32 am
Location: San Diego, CA
by FlyRPi » Thu May 23, 2013 5:10 pm
Unfortunately, all of the camera boards were sold out by the time I put in my order. Looks like I will have to wait for the next round of stock to come in. My plan is to use the Pi camera on my quad, assuming the video processing doesn't interfere with the motor and flight control.

As an update, I've finished soldering my cobbler and pwm driver. Next step is to wire up the RPi and do a test run on a servo (going to try to program this in python). If this works, I am going to to solder up the ESC and motor over the weekend, assuming I can find some extra time.
Posts: 2
Joined: Mon May 20, 2013 2:26 pm
by 1FordPrefect » Fri May 24, 2013 5:17 am
The way I will proceed with this project is first I think I will set up a Wi-Fi with Wi-Fi Protected Access II (WPA2), secure login which will last for duration of flight, you would simply search with you IOS/Android device for your QC which you would assign a SSID like “QCFordPrefect” and connect to it after entering password, you would start client app which will do all the per-flight configuration, ground station functions, and actual flying with real time FPV.

Parrot A.R. Drone 2 uses ad hoc connection between 2 devices, I do not want to do that for obvious reasons, unsecured.

Second I would install camera on RP start to develop client application for the iPhone/iPad I need to get video from the camera to the application design three buttons (left and right) and a takeoff/land button. Where takeoff/land button does exactly what it means, QC will hover 1m default (user will be able to set hight) above ground. The landing button will land the QC from what ever hight it is at to 1m and then decent slowly to the ground.

The left button, holding the left button and tilting the phone forwards and back will move QC forward and backward.

The right button, sliding the button to the bottom right or bottom left will pivot QC to the left or to the right.

Holding the right button and sliding up or down will make QC climb or decent.

That would be the beginning, would add more functions as I develop the code, adding functions like loop the loop, and flips to the left or right, etc. I have a cool idea for doing these functions and how generate them.

Actually most of this is already available on the Internet, both in Java as well as in C/C++, I will grab one of these applications and rewrite it, it was written for the Parrot A. R. Drone 2, and I am using different hardware, but my application would function in similar manner, except I would have OpenPilot ground station software since I am thinking of using the OpenPilot Revo flight control board.
User avatar
Posts: 12
Joined: Sat May 11, 2013 4:10 am
by 1FordPrefect » Fri May 24, 2013 5:38 am
[I read this at the blog I gave a link to few days ago by ygramulqc said he communicates from the Smartphone with bluetooth to a bluetooth-arduino dongle which itself control the DJI Naza like a remote control receiver (PWM Pins), those are his exact words. His English is not that good, but I understand where he is going with this or where he went with this.]

The trick here is how to interface RP with in my case OpenPilot Revo flight control board, that also comes with GPS, and other goodies. That is what most people have to take into consideration, hardware interface is half the battle, and the other half is software, so choose well my friends, I can't afford DJI Naza 2. But I know that what ever flight control board I choose I will drive it with RP. I will refine my app requirements as I go. I will finish the QA400 build soon, I need shielding and shrink wrap and few more connectors, also I will buy a variable power supply so that I can attach QC and work on it without having to charge batteries, at this point of development.

http://www.amazon.com/Sinometer-HY3005D ... roduct_top
User avatar
Posts: 12
Joined: Sat May 11, 2013 4:10 am
by delic » Sun May 26, 2013 12:20 am
Marlon I am embarking on a similar project. I have coded the MPU9150 so far. I am stuck on how to interface with the ESCs. You mention that you are using special speed controllers. Can you provide more info on this? I have been researching using a TI TLC5940 PWM driver to send the 1-2ms pulse to the ESCs.
Posts: 3
Joined: Sun May 26, 2013 12:06 am