Looking for some help really about how to interact with the GPIO that the Raspberry Pi has.
Looking to make a controlable Helicopter with a raspberry pi at it's sorce. Problem is that I have very little experiance with Electronics and zero in programming. However I am good at flying helicopters
Where would the best way to start using reading about GPIO ? Programming will slowing come about more i practice and learn it. However no idea if I would need additional board for the servos.
ultimate goal is to make a Quad-copter (they are generally more forgiving) with R-Pi in the middle being controled by a laptop in FPV
- gordon@drogon.net
- Posts: 2023
- Joined: Tue Feb 07, 2012 2:14 pm
- Location: Devon, UK
- Contact: Website Twitter
Re: Pi-Copter
Bikko said:
Looking for some help really about how to interact with the GPIO that the Raspberry Pi has.
Looking to make a controlable Helicopter with a raspberry pi at it's sorce. Problem is that I have very little experiance with Electronics and zero in programming. However I am good at flying helicopters
Where would the best way to start using reading about GPIO ? Programming will slowing come about more i practice and learn it. However no idea if I would need additional board for the servos.
ultimate goal is to make a Quad-copter (they are generally more forgiving) with R-Pi in the middle being controled by a laptop in FPV
You may wish to start by looking at the arduCopter and arduCopterMega projects..
6 months or so ago, I looked at this with a lot of interest, however the project I was working on never got off the ground (as it were!) but I did learn a lot about quad/hex/etc copters and their control and so on.
So while the RPi is more than capable of doing the calculations involved, (a 16MHz, 8-bit micro can do them in software) I fear it's lacking in the IO required to do the control. So, 1 PWM output per motor for a start – so 4, one for each motor. Then there's the sensors – to do it properly requires 10 sensors – barometric pressure, then a 3D compass, 3D gyro and 3D accellerometer. Some of these have analogue inputs and some use a digital bus. The arduCopter "solved" some of this by having an IMU shield – that talked back to the host via the SPI bus, so if the SPI is working on the RPi, then it may be possible to just use the arduCopter IMU shield directly… (still lacking in PWM outputs though)
However.. You will not successfully control anything in real-time with the supplied multi-user, multi-tasking Linux kernel. Imagine you're hovering and the control loop tweaks the speed of one rotor to compensate for a bit of drift (as it needs to do constantly as these things are inherently unstable) and then something else decides to run on the RPi – a cron job, some data comms, logging, etc. and the control process gets stalled for 0.1 seconds – it will flip over in that time. You really do need absolute control over the hardware driving the controlls with precise timing otherwise it will be as unstable as a6 month old baby taking their first steps... (and you'll be taking it home in a bin-liner)
Far better might be to use it as a telemetry controller/ground station – however everyone else is currently using a laptop for that as they come with built-in screens and keyboards.
Gordon
Looking for some help really about how to interact with the GPIO that the Raspberry Pi has.
Looking to make a controlable Helicopter with a raspberry pi at it's sorce. Problem is that I have very little experiance with Electronics and zero in programming. However I am good at flying helicopters
Where would the best way to start using reading about GPIO ? Programming will slowing come about more i practice and learn it. However no idea if I would need additional board for the servos.
ultimate goal is to make a Quad-copter (they are generally more forgiving) with R-Pi in the middle being controled by a laptop in FPV
You may wish to start by looking at the arduCopter and arduCopterMega projects..
6 months or so ago, I looked at this with a lot of interest, however the project I was working on never got off the ground (as it were!) but I did learn a lot about quad/hex/etc copters and their control and so on.
So while the RPi is more than capable of doing the calculations involved, (a 16MHz, 8-bit micro can do them in software) I fear it's lacking in the IO required to do the control. So, 1 PWM output per motor for a start – so 4, one for each motor. Then there's the sensors – to do it properly requires 10 sensors – barometric pressure, then a 3D compass, 3D gyro and 3D accellerometer. Some of these have analogue inputs and some use a digital bus. The arduCopter "solved" some of this by having an IMU shield – that talked back to the host via the SPI bus, so if the SPI is working on the RPi, then it may be possible to just use the arduCopter IMU shield directly… (still lacking in PWM outputs though)
However.. You will not successfully control anything in real-time with the supplied multi-user, multi-tasking Linux kernel. Imagine you're hovering and the control loop tweaks the speed of one rotor to compensate for a bit of drift (as it needs to do constantly as these things are inherently unstable) and then something else decides to run on the RPi – a cron job, some data comms, logging, etc. and the control process gets stalled for 0.1 seconds – it will flip over in that time. You really do need absolute control over the hardware driving the controlls with precise timing otherwise it will be as unstable as a6 month old baby taking their first steps... (and you'll be taking it home in a bin-liner)
Far better might be to use it as a telemetry controller/ground station – however everyone else is currently using a laptop for that as they come with built-in screens and keyboards.
Gordon
--
Gordons projects: https://projects.drogon.net/
Gordons projects: https://projects.drogon.net/
Re: Pi-Copter
Iv'e been meaning on a project like these but somehow can't get myself to spend $400 for a good complete quadcopter frame. I have experienced with electronics and programming (AVR, Cortex-M3, OpenCV) so I'm covered on that.
It's just that the entry point for some good quadcopter hardware is too much for me to cover.
It's just that the entry point for some good quadcopter hardware is too much for me to cover.
- gordon@drogon.net
- Posts: 2023
- Joined: Tue Feb 07, 2012 2:14 pm
- Location: Devon, UK
- Contact: Website Twitter
Re: Pi-Copter
hzrnbgy said:
Iv'e been meaning on a project like these but somehow can't get myself to spend $400 for a good complete quadcopter frame. I have experienced with electronics and programming (AVR, Cortex-M3, OpenCV) so I'm covered on that.
It's just that the entry point for some good quadcopter hardware is too much for me to cover.
I know - we started with just the electronics with a view to buying the frame, etc. at a later date when we had some code - so I did the code, then the people funding the project pulled out )-: However its left me with another Arduino mega with the full IMU shield to play with!
I think I want to put together some demos of RPi (well a generic Linux box until I get one!) trying to do some real-time control vs. a dedicated system like an Arduino - As my background is in programming robotics & control, I think it's great that people want to use the RPi for control applications, but I fear that a lot of people are going to be dissapointed when their stepper motor projects stall )-:
Gordon
Iv'e been meaning on a project like these but somehow can't get myself to spend $400 for a good complete quadcopter frame. I have experienced with electronics and programming (AVR, Cortex-M3, OpenCV) so I'm covered on that.
It's just that the entry point for some good quadcopter hardware is too much for me to cover.
I know - we started with just the electronics with a view to buying the frame, etc. at a later date when we had some code - so I did the code, then the people funding the project pulled out )-: However its left me with another Arduino mega with the full IMU shield to play with!
I think I want to put together some demos of RPi (well a generic Linux box until I get one!) trying to do some real-time control vs. a dedicated system like an Arduino - As my background is in programming robotics & control, I think it's great that people want to use the RPi for control applications, but I fear that a lot of people are going to be dissapointed when their stepper motor projects stall )-:
Gordon
--
Gordons projects: https://projects.drogon.net/
Gordons projects: https://projects.drogon.net/
Re: Pi-Copter
I wouldn't want an RPi in my quadcopter. Linux doesn't really provide me enough control of the hardware as oppose to having bare-metal code in an AVR or ARM cortex controller. And for $35/$25, I'd rather have those cheap STM32F4 or LPC xpresso boards with enough peripherals to do realtime control of a quadcopter.
-
- Posts: 1562
- Joined: Sun Mar 04, 2012 12:49 am
Re: Pi-Copter
I'm intending to build a balancing robot around the Pi and am looking at writing a bare metal control solution. I intend to use existing I2C drivers for the Pi to test the hardware/concept and then upgrade to a slicker bare metal solution.
Ostendo ignarus addo scientia.
-
- Posts: 1562
- Joined: Sun Mar 04, 2012 12:49 am
Re: Pi-Copter
10mm sq aluminium tube, 4 mm aluminium plate, tin snips a drill and pop rivets = a good beginners frame. Just saved you $350hzrnbgy wrote:Iv'e been meaning on a project like these but somehow can't get myself to spend $400 for a good complete quadcopter frame. I have experienced with electronics and programming (AVR, Cortex-M3, OpenCV) so I'm covered on that.
It's just that the entry point for some good quadcopter hardware is too much for me to cover.

LINUX convert since 2003
Re: Pi-Copter
I'm building my own frame now with aluminum bits. There is an easier way though...bazza14 wrote:10mm sq aluminium tube, 4 mm aluminium plate, tin snips a drill and pop rivets = a good beginners frame. Just saved you $350hzrnbgy wrote:Iv'e been meaning on a project like these but somehow can't get myself to spend $400 for a good complete quadcopter frame. I have experienced with electronics and programming (AVR, Cortex-M3, OpenCV) so I'm covered on that.
It's just that the entry point for some good quadcopter hardware is too much for me to cover.
http://hobbyking.com/hobbyking/store/__ ... talon%20v2
Anyway I'm curious if the PIcopter idea is viable. We're using arducopter at the moment and looking to attach some pretty serious gear and data collection to our copters. Right now we'd need separate Arduino for each type of sensor. Not horrific but It would be amazing to be able to have one RaspberryPiCopter that you could just plug stuff into.
Re: Pi-Copter
Yes apparently you can. See:Raychaser wrote:Anyway I'm curious if the PIcopter idea is viable. We're using arducopter at the moment and looking to attach some pretty serious gear and data collection to our copters. Right now we'd need separate Arduino for each type of sensor. Not horrific but It would be amazing to be able to have one RaspberryPiCopter that you could just plug stuff into.
http://www.raspberrypi.org/phpBB3/viewt ... 37&t=35746
Basically it's a raspi running all the flight control. He has an arduino in there but apparently that is doing something on the radio - the Pi does all the low-level control. Running Linux too - not some real-time operating system.
Someone else posted another thread for a pi-based one too, but I can't find it right now. However, I think somebody mentioned instability can occur when attempting to write log files and fly at the same time, so you may have to watch out for that if you're trying to record lots of data.