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

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

Tue May 26, 2020 6:48 pm

DerCoderLukas wrote:
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.
Despite the issues with Raspbian not being a real-time deterministic operating system I'm sure that can be worked around by preventing Linux from scheduling on a core with suitable "isolcpus" parameters on it's command line and running ones control code on the isolated CPU with "taskset".

But the other issues raised were about physical size and power requirements.
DerCoderLukas wrote:
Tue May 26, 2020 6:39 pm
Do you think it makes more sense to use a microcontroller like an arduino or would it has the same result?
Once again I have to ask: What is it you want to control exactly? And how?

It's impossible to suggest an optimal controller hardware solution without knowing what it is expected to do.
Memory in C++ is a leaky abstraction .

bjtheone
Posts: 856
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

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

Tue May 26, 2020 6:52 pm

I think a more relevant point to consider is "why". As in why are you doing this and what do you want to achieve. Is it programming, design and fabrication, anonymous operation, desire to muck about with a Pi.... There are lots of fun and interesting things to do with Pi's. However the intersection between Pis and RC aircraft is likely small and not a particularly rewarding first project. If you could more fully articulate your "why" people likely could make more constructive suggestions.

A Pi is not the right controller for a small RC aircraft (way to big, power hungry and complex). You want just enough processing power to run PID loops, and talk to gyros, maybe gps and whatever control system you are using. You also really really want it to be real time. While you can get closer with some bare metal OSes than with Linux, a Pi is still the wrong choice. Unless your focus is building the control system, you are also much more likely to maximize success and minimize headaches by buying a control solution and integrating that into your RC craft.

We use Pis on FRC robots to run vision systems and they work great there. However, we are talking about 150 pound robots and effectively unlimited power resources.

lurk101
Posts: 55
Joined: Mon Jan 27, 2020 2:35 pm

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

Tue May 26, 2020 7:32 pm

Check out the PX4 ecosystem https://px4.io/. Mostly built on available STM32 based controller boards. The closest thing to a PI4 they support is the Beaglebone. Plenty of software dev opportunities since it is mainly a user developed open source project.

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

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

Tue May 26, 2020 8:34 pm

@emma1997

I have now taken a closer look at your message and read something on the Internet and do not try to repeat myself.
What you think is important is a real time computer (like arduino or smt32) to keep the commands up to date. You suggested that I use things like ardupilot, but I think that this just destroys the appeal of the project. I just want to do as much as possible myself and not just buy and stick together. Would you say that an rc receiver in combination with an arduino could cause an rc plane to flee properly or would you say that it is senseless or almost impossible to get such good control over the plane. I'm sorry if I ask stupid questions, but I'm probably still at the bottom of the mount stupid of aviation ;).

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

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

Tue May 26, 2020 8:43 pm

Heater wrote:
Tue May 26, 2020 6:48 pm
DerCoderLukas wrote:
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.
Despite the issues with Raspbian not being a real-time deterministic operating system I'm sure that can be worked around by preventing Linux from scheduling on a core with suitable "isolcpus" parameters on it's command line and running ones control code on the isolated CPU with "taskset".

But the other issues raised were about physical size and power requirements.
DerCoderLukas wrote:
Tue May 26, 2020 6:39 pm
Do you think it makes more sense to use a microcontroller like an arduino or would it has the same result?
Once again I have to ask: What is it you want to control exactly? And how?

It's impossible to suggest an optimal controller hardware solution without knowing what it is expected to do.
I have already posted a link to a rc wing kit that I want to control. You just find it in a further post. My important aspects are a good range (1km) and a good controlability. Do you have an idea which board would be the best?

User avatar
davidcoton
Posts: 5011
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

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

Tue May 26, 2020 8:52 pm

DerCoderLukas wrote:
Tue May 26, 2020 8:43 pm
My important aspects are a good range (1km) and a good controlability.
Learn about legality and licensing first.
Then go and find a more appropriate forum that centres on aeromodelling and flight control.
Signature retired

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

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

Tue May 26, 2020 8:57 pm

davidcoton wrote:
Tue May 26, 2020 8:52 pm
DerCoderLukas wrote:
Tue May 26, 2020 8:43 pm
My important aspects are a good range (1km) and a good controlability.
Learn about legality and licensing first.
Then go and find a more appropriate forum that centres on aeromodelling and flight control.
I live in Germany and as long as you can see the plane and some other aspects you can fly any plane without a license.

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

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

Tue May 26, 2020 9:05 pm

DerCoderLukas wrote:
Tue May 26, 2020 8:57 pm
davidcoton wrote:
Tue May 26, 2020 8:52 pm
DerCoderLukas wrote:
Tue May 26, 2020 8:43 pm
My important aspects are a good range (1km) and a good controlability.
Learn about legality and licensing first.
Then go and find a more appropriate forum that centres on aeromodelling and flight control.
I live in Germany and as long as you can see the plane and some other aspects you can fly any plane without a license.
Not autonomously I suspect.
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.

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

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

Wed May 27, 2020 3:53 am

DerCoderLukas wrote:
Tue May 26, 2020 8:43 pm
I have already posted a link to a rc wing kit that I want to control. You just find it in a further post.
It makes no difference what plane you want to use. Within reason.

You still have not answered my questions.
DerCoderLukas wrote:
Tue May 26, 2020 8:43 pm
My important aspects are a good range (1km) and a good controlability. Do you have an idea which board would be the best?
Now we are entering fantasy land.

Can you even see a 1 meter wingspan plane at 1km? Well enough to control it properly?

What is the range of typical RC gear now a days? I would not want to trust such control to a home brew WiFi set up.

As noted above, the law often has something to say about such activities, depending on where you live. Especially regarding autonomous flight.

Given the nature of your questions you clearly have no experience of flying such things or the electronics and control systems required to do so. That is OK it's fun to learn. But start with something less ambitious. If planes is the thing then by all means get that kit and a regular RC set up for it. Getting that flying properly will already have taught you a lot. It's probably a good idea to hook up with a local RC club and tap them for advice.

Meanwhile you can be getting familiar with controlling things with servos and sensors etc using a Pi or whatever on the ground. A great starter project for that kind of experience is building a two wheeled bot that balances itself upright. A situation as unstable as a quadcopter. You will find discussion and examples of doing that all over the net. For example: https://www.pololu.com/blog/464/raspber ... cing-robot

After a year of so of this kind of activity you will be in a position to reevaluate your questions here.
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. :-(

Wed May 27, 2020 7:07 am

Many thanks to all of you, you advised me really well in my situation. I will try to follow some tips from you and rethink my idea. However, I think that this forum is not the right place for further discussion, which is why I will probably turn to another forum. Nevertheless, many thanks to everyone who took the time to persuade me to view my idea a little more critically.

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

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

Wed May 27, 2020 7:42 am

Heater wrote:
Wed May 27, 2020 3:53 am
Now we are entering fantasy land.

Can you even see a 1 meter wingspan plane at 1km? Well enough to control it properly?

What is the range of typical RC gear now a days? I would not want to trust such control to a home brew WiFi set up.
Yeah, I didn't really think it through last night. Of course, 1km is completely absurd. Do you think I could count on a range of about 100m?

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

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

Wed May 27, 2020 8:03 am

Sounds reasonable. But I have no idea of the range of modern day RC gear.
Memory in C++ is a leaky abstraction .

User avatar
bensimmo
Posts: 4618
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

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

Wed May 27, 2020 8:25 am

I'll just add, you can build them with a Pi, people have been doing it since the early days with the original A for instance, so larger, more power hungry and less overall powerful than a Zero.
A quick search would show you that.

But a gyro is used.
What I do not understand is why you do no want to use a Gyro. ?
They're pretty cheap, small and 'plug n play '-ish with respect to the hardware side.

Buy one and keep at it for fun, you'll learn something.

here's a project from way back in that time, even in the very early days when MagPi was not part of RPF and had very technical writeups. issue 19/20 ish
https://github.com/PiStuffing/Quadcopter


and no, I'm no expert, doubt it will be as good as Emma1977 or microcontroller one, but why give up.

A lot of project I have seen use the Pi as the Comms, navigation, routes etc etc and use a hat/attachment like mutiwii and seen navio too.

Why not use both, same applies to the plane.

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

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

Wed May 27, 2020 8:48 am

Well, even if I now put such a gyro on and give each motor its power depending on the balance, I don't think that it will fly stable. So don't get me wrong, I don't know if it works. But precisely because I see how things are going, I can't imagine how I can get a flying object that is the epitome of unstable, stable with the help of a sensor and my own program. I am also not sure whether, despite the possibility of using a pi, that would be the best choice. During my attempts, I noticed that the connection between pi and my mobile device was very inconsistent. You can imagine the connection roughly as follows: The Pi opens a hotspot (WiFi) and my cell phone connects to it. Then I developed an app that communicated with the Pi. I was aware from the start that this construction would not break length records, but I never thought it would work so badly. My "new plan" is not related to WIFI or Bluetooth but to communicate with my board with the help of an external radio controller module (whether pi or something else should be put there).
bensimmo wrote:
Wed May 27, 2020 8:25 am
A lot of project I have seen use the Pi as the Comms, navigation, routes etc etc and use a hat/attachment like mutiwii and seen navio too.

Why not use both, same applies to the plane.
I've already looked at it as a solution, but at least the navio is not in my price range :)

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

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

Thu May 28, 2020 12:13 am

You generally either have to do it yourself or pay big for a ready to go hat solution. Otherwise you can pick up chinese 10dof module and set of motor controllers and wire them yourself for about 1/10th the cost.

That link from bensimmo is probably as close to what you want as possible. It's been 10yrs since I was doing this stuff and can't believe how far things have advanced.

I will add that it is technically possible to fly a multicopter without gyro, autopilot, or rx/tx. As an experiment many many years ago I built and flew a 2 meter tricopter w/o any of these. Just an AVR (Arduino) chip wired directly to the ESCs. It did manage to take off, hover, and land upright. Initially flight time was measured in milliseconds with lots of flipping and broken props. Eventually, by fine tuning the mega8 code, got it up for over 2 seconds before dropping back to the ground. No crash though.

Only reason it was stable that long was inertia of the very wide frame. Shorter arms had no chance. I suspect a 4 meter multicopter might manage 3-4seconds w/o flipping. lol

My level of competence was about the same as yours and, like you I was determined not to use a gyro. They were very expensive ($30-$40 and you needed more than one) and accelerometers and magnetometers cost hundreds and weighed 50 times more.

Then few years later stumbled across Captainkuk's famous autopilot on RCGroups (which incidentally actually did use PID). It used the same chip as mine written in assembly language. Got me started and the rest was history.

BTW this was years before Ardupilot, the first real hobby autopilot.

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

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

Thu May 28, 2020 12:58 am

You know how when you buy firework rockets you basically get a tube of propellant attached to a long stick? That stick is what make the rocket fly straight up nicely rather than spiraling around into your face. The stick stabilizes it.

I have always wondered if one could stabilize a quad copter like that. Put a rigid tail on it. Put the rotors at the top and as much of the weight at the bottom of the tail as possible.

It would be a clunky contraption but might possibly be flyable manually. Having seen people flying super lightweight electric RC planes and have them hovering vertically in the air, hanging from their propellers, this might just work.
Memory in C++ is a leaky abstraction .

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

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

Thu May 28, 2020 2:03 am

Yes, I had the same 'hanging off the prop' idea. Unfortunately it don't work like that at all. The model, plane or copter, shoots and flips all over the place. Even with counter rotating props. Without proper control surfaces and aided by IMU virtually unflyable.

The guys you saw probably had both and still needed quite a lot of skill. I still recall making a fool of myself insisting I could fly my friends aerobatic but when he handed over the remote... well you can guess the rest.

aBUGSworstnightmare
Posts: 1953
Joined: Tue Jun 30, 2015 1:35 pm

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

Thu May 28, 2020 5:15 am

Real fun reading that you consider to fly a copter without IMU ... Might not be impossible, but I doubt that you're fast - and at the same time smooth - enough for prividing the correct inputs to the ESC's your own.

A flightcontrollern is very cheap these days! Buy one and build your copter and then learn how ro fly it. Next step is adding the Pi for more fancy stuff light autopilot etc.

And: get to know the legal restrictions in your country, related to operating/flying a copter.

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

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

Thu May 28, 2020 6:34 am

emma1997 wrote:
Thu May 28, 2020 2:03 am
Yes, I had the same 'hanging off the prop' idea. Unfortunately it don't work like that at all. The model, plane or copter, shoots and flips all over the place. Even with counter rotating props. Without proper control surfaces and aided by IMU virtually unflyable.

The guys you saw probably had both and still needed quite a lot of skill....
What got me thinking was that the planes I describe were incredibly lightweight, hardly more than plastic bags with a motor, they flew very slowly. I suspect they were never flown outdoors. I guess actually have control surfaces was helpful, and skilled pilots. I'm not sure they had IMU, after all we were flying RC planes before any of that.

Of course the kopter-with-a-tail I described ends up being a pendulum, which is going to swing terribly if it's too short. I wondered if some dihedral on the motors would help, that would make it easier to push the top around and keep over the tail.

This calls for a simulation, I don't want to start wrecking lots of expensive parts....
Memory in C++ is a leaky abstraction .

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

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

Fri May 29, 2020 10:08 pm

Actually in this case the longer pendulum makes things worse. CG vs center of effort. Very non-intuitive and opposite what one might expect, for example, after balancing end of a pencil vs yardstick in palm of hand where longer really is more stable.

Those flimsy planes were probably indoor pattern (F3P). No IMU allowed and whole plane including battery weighs fraction as much as a Pi. Most fascinating aspect of RC for me at the time though and I did get to witness a few trials. Actually bought a kit. Unfortunately no local venues, mostly a EU thing, so it didn't get too far.

Most of this stuff boils down to either extreme skill or a little (aka LOTS OF) help from gyro/accel gadgetry.

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

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

Fri May 29, 2020 10:28 pm

emma1997 wrote:
Fri May 29, 2020 10:08 pm
Actually in this case the longer pendulum makes things worse. CG vs center of effort. Very non-intuitive and opposite what one might expect, for example, after balancing end of a pencil vs yardstick in palm of hand where longer really is more stable.
I'm confused.

You start out by saying "...longer pendulum makes things worse..." and ending up by saying "... longer really is more stable..."

So which is what?

I get the point about " CG vs center of effort" though.
Memory in C++ is a leaky abstraction .

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

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

Fri May 29, 2020 10:57 pm

What I was trying to get across was that, after seeing longer helps with the yardstick/pencil, one might expect that too with prop hanging. But it actually makes things worse.

Also, to increase your confusion even more, note that pendulum effect (low CG) does increase stability big time with fixed wing aircraft. IE high wing vs low as mentioned in this weeks Nova episode. My Quicksilver ultralight for example is unbeatable here due to highest wing of all. Impossible to stall. With stick all back, instead of spinning down into negative AGL, just parachutes down (the famous QS 'mush').

pidd
Posts: 519
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

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

Fri May 29, 2020 11:51 pm

From a small amount of experience many moons go. I'd much rather program a quadcopter than a plane because you can do it in stages. gyros are pretty compulsory unless you want accelerometers in three separate locations.

The first stage is to get it "flying" indoors (no wind) with it keeping no rotation in any axis while hanging from string ie keeping total lift less than the weight of the copter. This is 100% gyro control.

Next stage correcting and keeping it horizontal this is adding the accelerometer which also give you a feel for the next stage - this is still hanging from string.

Next is constant altitude - this is tricky because with zero acceleration it is free-fall downwards, it needs a calibration before take-off to measure gravity - this is the stage you lose the string.

Next stage is correction -if the accelerometers detect feel a force it angles itself against that force.

The next stage is user control where you add offsets to force it to move or rotate.

All along you are having to find non-linear damping figures to make sure you don't over/under compensate. As well as the best guess damping it also has to learn figures as it is moving - much like a car's ecu, it start with defaults and finds its own correction factors. You also have to realise it is not about 100% correction all the time, a little movement here and there can be corrected over seconds not microseconds. There is nothing better than seeing it getting blown 5ft sideways then move itself back 5ft, its just fine tuning to reduce that 5ft once you have cracked the basic correction concept.

You can't modularise your programming and testing like that with a plane.

Gyros are easier to program with than accelerometers as they are much less noisy, you create a datum 6 axis attitude with three axis position in software and everything is relative to that.

Our project failed, it started off as a hovercraft with four lift sections and a concept of a lot of inbuilt intelligence to do "instantaneous" stops and fast turns, then some idiot (not me for a change) said "lets get this airborne", the cheap homemade six accelerometers and six pseudo-gyros were all based on weights, springs, sponges and guts of microphones, we never perfected any stage before moving on to the next and we ran out of time, patience and money. The six of us have hardly spoken since.

With modern devices I'm sure its not beyond a bit of patience to crack, its much easier to do an Elon Musk development and learn from failure rather than trying to perfect from the start.

I have no idea if that i the way the software is tackled these days but it was our basis and the same as I'd try again. Starting with a hovercraft was easier as we just floated it and did a limited number of axis first, then we jumped too many stages far too quickly.

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

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

Sat May 30, 2020 12:15 am

But the pencil balancing problem and the prop hanging problem are very different.

In the first case one can move the base rapidly under the CofG. And independently of the CofG. In the second case the prop thrust is always towards the CofG, typically, and gets tilted in the wrong direction to fix the error in verticallity (as it were)

You know, hot air balloons don't have so much of a stability problem. They have the lift at the top and the weight at the bottom. They sail by very nicely and nobody dies.

Is it really so we cannot replace the lift of the hot air balloon with the thrust of a motor?

Whatever, this calls for some maths and simulation...
Memory in C++ is a leaky abstraction .

ti994/a
Posts: 10
Joined: Mon Jan 06, 2014 11:00 pm

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

Sat May 30, 2020 9:47 am

Heater wrote:
Wed May 27, 2020 8:03 am
Sounds reasonable. But I have no idea of the range of modern day RC gear.
Well I’ve just bought the new DJI Mavic Air 2 which has a theoretical range of 6-10KM (dependant on geographic location. UK is 6KM). Obviously flying at such distance, out of visual line of sight, would be illegal unless you hold permission from the CAA to do so. Still get the odd idiot who choose to ignore the rules mind.

Return to “General discussion”