DerCoderLukas
Posts: 15
Joined: Tue May 26, 2020 3:16 pm

Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 3:35 pm

I have been working on my own quadrocopter for a few months and wanted to fly it for the first time some days ago. But I quickly realized that it was not as easy as I thought. On the first time the entire quadrocopter flipped over, half destroyed itself. On further attempts, it ended pretty much the same way, which is why I have already spent a few hours trying to find solutions in forums. So I have already corrected some things that I list here:

1. ESC calibration
2. Weight distribution
3. Gear removing (removing high center of gravity)

But the problem of instability remains. I have already heard that gyros are essential for a quadrocopter. However, I have not yet assembled these and I actually do not intend to. Are there other ways to keep the quadcopter stable in the air or to start it without flipping over?

Thank you for your help, I depend on it.

PS: I program the entire quadrocopter myself and do not use any other boards or controllers except the programmed raspberry pi.
I am also sure that all the motors turn in the right direction and the propellers are installed correctly.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26408
Joined: Sat Jul 30, 2011 7:41 pm

Re: Unstable raspberry pi quadcopter

Tue May 26, 2020 4:36 pm

Gyros are needed in quadcopters for a reason...
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

DerCoderLukas
Posts: 15
Joined: Tue May 26, 2020 3:16 pm

Re: Unstable raspberry pi quadcopter

Tue May 26, 2020 4:39 pm

Is there no way to start a quadcopter without gyros?

ElEscalador
Posts: 839
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Unstable raspberry pi quadcopter

Tue May 26, 2020 4:42 pm

In the past, quadcoptors were nearly abandoned as too difficult to control to ever be practical. It was only thanks to gyros and modern, fast processing that we are able to make toys out of them. I'm not sure how you could possibly get anything approaching stability without an IMU (including a gyro) for feedback into PID control loops.
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics

User avatar
B.Goode
Posts: 10110
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Unstable raspberry pi quadcopter

Tue May 26, 2020 4:43 pm

DerCoderLukas wrote:
Tue May 26, 2020 4:39 pm
Is there no way to start a quadcopter without gyros?


Maybe YOU will be the person with enough determination to prove that it can be done...

DerCoderLukas
Posts: 15
Joined: Tue May 26, 2020 3:16 pm

Re: Unstable raspberry pi quadcopter

Tue May 26, 2020 4:58 pm

Thanks for the great answers. But that sounds rather frustrating, because I'm pretty sure that taking off and being stable in the air won't be that easy with gyros. I think about the project, as hard as it is for me to give up. So my replacement plan is to build an rc plane instead of a drone. I don't know if you are familiar with the complexity of such a project, but do you think that it is easier to implement than to build a drone. Are gyros also indispensable for airplanes?

deepo
Posts: 572
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Unstable raspberry pi quadcopter

Tue May 26, 2020 5:03 pm

DerCoderLukas wrote:
Tue May 26, 2020 4:58 pm
Thanks for the great answers. But that sounds rather frustrating, because I'm pretty sure that taking off and being stable in the air won't be that easy with gyros. I think about the project, as hard as it is for me to give up. So my replacement plan is to build an rc plane instead of a drone. I don't know if you are familiar with the complexity of such a project, but do you think that it is easier to implement than to build a drone. Are gyros also indispensable for airplanes?
No, because most airplanes are designed to be stable by themselves.
But gyros are used in airplanes for e.g. auto pilots and yaw dampers and so on.
If you can control and correct the quad fast enough, then maybe you yourself can replace the gyro.
But I don't know, I only have experience as a glider pilot.

/Mogens

Heater
Posts: 15808
Joined: Tue Jul 17, 2012 3:02 pm

Re: Unstable raspberry pi quadcopter

Tue May 26, 2020 5:04 pm

You have not thought this through.

I typical four armed quad copter is very unstable. If one fan is thrusting less than an opposite one it will flip pretty quickly. If a little breeze catches it it will flip pretty quickly.

You could perhaps compensate for this by controlling the motors manually. But that is very hard to do. You need fast reactions and accurate adjustments. Think of it like balancing a pencil upright on it's point on the end of a meter stick. It's the same problem as stopping rockets spiraling out of control.

Then you likely have wireless link between you and your machine so that makes the control problem a thousand times harder.

What to do?

Thousands have trodden this path over decades. I'd start by reading about how they did it. What problems they had and how they fixed them.

You will no doubt find that gyros and some smart control software are required.
Memory in C++ is a leaky abstraction .

DerCoderLukas
Posts: 15
Joined: Tue May 26, 2020 3:16 pm

Re: Unstable raspberry pi quadcopter

Tue May 26, 2020 5:11 pm

I have great respect for this, precisely because stability is such a difficult issue for quadrocopters. It could take months or years until I found a solution that keeps the quadrocopter reasonably stable. I would not have expected this at the start of construction. I think that I am better off with an airplane, because the error rate after my first research is not quite as high and you do not have as great a failure potential as with a quadrocopter.

Heater
Posts: 15808
Joined: Tue Jul 17, 2012 3:02 pm

Re: Unstable raspberry pi quadcopter

Tue May 26, 2020 5:11 pm

Typically an RC plane is pretty stable. Given the right constant thrust from the motor it will fly kind of straight and level. Think throwing a nicely made paper aeroplane.
Memory in C++ is a leaky abstraction .

DerCoderLukas
Posts: 15
Joined: Tue May 26, 2020 3:16 pm

Re: Unstable raspberry pi quadcopter

Tue May 26, 2020 5:14 pm

Are there areas in the behavior of an aircraft that could cause problems that I don't currently see?

Heater
Posts: 15808
Joined: Tue Jul 17, 2012 3:02 pm

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 5:27 pm

No doubt.

The history of flight is littered with consequences of behaviors nobody could foresee.

But hey, teenagers have been building RC planes since 50 years ago. As always it pays to do some homework and see what those who came before achieved.

At this point one wonders what part a Raspberry Pi would play in all this?
Memory in C++ is a leaky abstraction .

DerCoderLukas
Posts: 15
Joined: Tue May 26, 2020 3:16 pm

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 5:33 pm

I mean, of course, things will happen unexpectedly that no one could predict, but do you basically recognize a problem that could occur that many had before (such as the instability of a quadrocopter now)? But it is basically possible to control an airplane only with a raspberry pi, right?

ElEscalador
Posts: 839
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Re: Unstable raspberry pi quadcopter

Tue May 26, 2020 5:38 pm

DerCoderLukas wrote:
Tue May 26, 2020 5:14 pm
Are there areas in the behavior of an aircraft that could cause problems that I don't currently see?
Now you deviate from the realm of this group into aeronautics, but it is all about the design. Different wing types = different flying qualities. center of gravity and where the CG falls along the wing chord are typically very important stability considerations...there are many planes that are stable and many that aren't (but those don't usually go into production). I have to wonder if you plan to build your own or buy one and automate it? Designing and building an airplane is its own challenge, automating one into drone is a separate challenge. Trying to do both at once for the first project I feel leaves you wondering forever if the problem was with the software/controls or with the aircraft design. I quite studied a book forever ago called the simple science of flight - I'd recommend that as a starting place.
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics

DerCoderLukas
Posts: 15
Joined: Tue May 26, 2020 3:16 pm

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 5:45 pm

Due to the fact that I don't see a chance to continue the project of a quadrocopter, since the stability is a point that I had not previously calculated, I have to "leave behind" this area. I don't really want to build an airplane myself, but as you said, motorize an airplane kit. Here you can find a link to the kit, which I intend to use: https://store.flitetest.com/flite-test- ... 43/p673707. It seems to me big and stable enough to wear a raspberry and use it as a flight controller.

Heater
Posts: 15808
Joined: Tue Jul 17, 2012 3:02 pm

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 5:58 pm

DerCoderLukas wrote:
Tue May 26, 2020 5:33 pm
But it is basically possible to control an airplane only with a raspberry pi, right?
I'm pretty sure you could even control a Boeing 777 with a Raspberry Pi. After all the 777 Primary flight computers only used Motorol 680xx, AMD29K and Intel 486 running at 50MHz or so.

But you have to think this through again. What exactly do you mean by "control".

A Pi can easily control servos and ESCs on a model plane. But to what purpose?

If it is to keep the thing flying straight and level you are back to needing a way to tell which way up you are and which way you are heading. Accelerometers, gyros and compass are back in the picture again.

If it it just to work like a good old fashioned radio control system, but using WiFi or whatever, I would advice against it.
Memory in C++ is a leaky abstraction .

emma1997
Posts: 764
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 5:59 pm

You are about the 300th person to think of this here. Pi is not the best platform and this forum is not the best one to learn the subject. There are many reasons but a few:

Depending on size of aircraft Pi can draw more power than the motors. A lot more for a small RC plane.

Pi does not easily do the fine timing required for flight control. The OS interrupts programming to make this very difficult if not impossible. We need a non-Linux dedicated realtime computer.

PID is not adequate and libraries to do the Kalman or Complementary filters are not available for Raspbian. A lot of the work is already done for Arduino, STM32, and other ARM processors but would require major effort to port.

You are underestimating the amount of work required. Judging from your comments I think it will take many years for you to succeed from scratch. I suggest you try other websites like RCGroups.com where there's entire sections devoted to just this subject. Search MWii and APM (Arducopter) controllers there and Ebay.

I've personally designed and constructed several 1 & 2 meter quads and achieved local record for flight duration and at about 1/10th the cost of competition. See photo.

Also for airplane my FFFFFF (aka 6F, aka Four Foot Free Flight Foamie Flier) solar powered with US if not world range record at the time. So I'm quite knowledgeable and experienced but would never attempt what you are trying to do from scratch.

BTW Heater is right about plane being easier to control vs quad but I assure you it is no where near as simple as the imagined picture in our minds.

A model with extreme dihedral comes close to 'self-stable' but when wind and other factors are considered not that easy either. Not to mention the extreme loss of efficiency with high dihedral requiring huge batteries, which need even more dihedral, which need bigger craft, which need bigger batteries, etc etc etc...
Attachments
hovering.JPG
hovering.JPG (91.85 KiB) Viewed 655 times
Last edited by emma1997 on Tue May 26, 2020 6:10 pm, edited 1 time in total.

Heater
Posts: 15808
Joined: Tue Jul 17, 2012 3:02 pm

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 6:10 pm

What emma said.

Cool, that must be the skinniest quad copter I have ever seen!
Memory in C++ is a leaky abstraction .

DerCoderLukas
Posts: 15
Joined: Tue May 26, 2020 3:16 pm

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 6:13 pm

Well, that explains why a Raspberry is not suitable for such a job. Would you say that a microcontroller like the Ardiuno would be better able to control an airplane? Or would you discard the wish of my own programming and advise me to use things like Navio or other pre-made boards?

emma1997
Posts: 764
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 6:19 pm

Heater wrote:
Tue May 26, 2020 6:10 pm
Cool, that must be the skinniest quad copter I have ever seen!
Yes, about quarter the weight of my buddies which was one of the reasons I prevailed in flight duration trials. Another advantage was my choice of battery type. They, like a few here too, thought Lipo was best energy density. In fact Lipo do not compare there with lowly, and far less cool, 18605 18650 Lion. It was quite a balancing act to stay up for hours on a pack that fit in my coat pocket.

Everybody was quite surprised at my victory and made every attempt to copy the design next year but to no avail as I had other tricks up my sleeve by then. The FAA made all of these illegal w/o a private plane license (which I do have but my buddies lack) so I probably still hold that local record. Unlikely to get bumped because nobody dares fly any RC planes or copters like that around here anymore.
Last edited by emma1997 on Tue May 26, 2020 6:40 pm, edited 1 time in total.

emma1997
Posts: 764
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 6:26 pm

DerCoderLukas wrote:
Tue May 26, 2020 6:13 pm
Well, that explains why a Raspberry is not suitable for such a job. Would you say that a microcontroller like the Ardiuno would be better able to control an airplane? Or would you discard the wish of my own programming and advise me to use things like Navio or other pre-made boards?
Definitely Arduino over Pi but kinda old tech so better is STM32 and other ARM chips which is modern day version. I suggest you do what I did. Start with cheap RC models (Walmart?) and after getting up to speed try your own modifications or even completely new designs.

Playing with store bought models is fun but no comparison to the satisfaction of DIY. My advice is follow my advice from the previous posts.

Heater
Posts: 15808
Joined: Tue Jul 17, 2012 3:02 pm

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 6:29 pm

DerCoderLukas wrote:
Tue May 26, 2020 6:13 pm
Or would you discard the wish of my own programming and advise me to use things like Navio or other pre-made boards?
The question then is: What actually do you want to do? What is the intended outcome of all this?

If you just want to fly a plane or copter most likely the quickest cheapest thing to do is just buy one. Or buy some kit that is known to work.

If you want to hone your programming skills and learn about control systems then of course trying your own experiments is the way to go. Just be aware it might be a long road...
Memory in C++ is a leaky abstraction .

deepo
Posts: 572
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 6:29 pm

DerCoderLukas wrote:
Tue May 26, 2020 6:13 pm
Well, that explains why a Raspberry is not suitable for such a job. Would you say that a microcontroller like the Ardiuno would be better able to control an airplane? Or would you discard the wish of my own programming and advise me to use things like Navio or other pre-made boards?
Come on Lukas, you were asked what type of control you imagine to have over the aircraft.
Does it involve autonomous flight with GPS or something simpler?
Raspberry Pi can be used, but you would probably have to do it all by yourself.
There are many flight controllers on the market, where all your problems have been solved. Why are they on on your radar?

As to your choice of airplane I'd get something that's stable by itself, i.e. an airplane with a tail.

/Mogens

DerCoderLukas
Posts: 15
Joined: Tue May 26, 2020 3:16 pm

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 6:39 pm

Yeah I don't want to use a full ready flight controller. But I don't think that a raspberry would be a good choice for a controller because of the os bound and os delay. Do you think it makes more sense to use a microcontroller like an arduino or would it has the same result?

emma1997
Posts: 764
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Unstable raspberry pi quadcopter without gyroscopes. :-(

Tue May 26, 2020 6:47 pm

The CPU part is only around 2% of the circuit required so you can't just wire a Pi, Uno, or Blue Pill up to some motors. I suggest, instead of asking the same question (answers don't change), you do the research I recommended in my first post here. However you go it's huge fun. Good luck.

Return to “General discussion”