8 ms·
Tiny quadrotor learns to fly in 18 seconds
- ducktective 3y agoApart from this project, does anyone know any other DIY quadrotor building instructions with cheap off-the-shelf materials?
- pugworthy 3y agoHave you looked into ArduPilot? https://ardupilot.org/ https://ardupilot.org/ https://github.com/ArduPilot/ardupilot https://github.com/ArduPilot/ardupilot
- IshKebab 3y agoHonestly anything with `ardu` in the name screams "I just learnt to code and I don't know what I'm doing". I know nothing about this space but I'd definitely check out the PX4 link that they other guy posted before this.
- olex 3y agoDon't dismiss Ardupilot so easily. Yes, it grew out of Arduino Megas running the code with some stapled-on sensors, but that was many years ago - it's an extremely powerful and arguably more "hobbyist"-friendly platform that's very comparable to PX4. In my experience PX4 lends itself very well to more scientific or industrial use, especially when integrating with other on-board compute units that are part of the payload, whereas Ardupilot is much easier to get working and capable off-the-shelf. Both software stacks run on essentially the same hardware nowadays.
- the__alchemist 3y agoI disagree about ease: ArduPilot is not easy to get working. It's a pain in the ass to get a flyable config, for say, a basic quadcopter. I now have a flyable config and notes, but it took me a lot of trial + error to get there. It has... surprising default settings , like going into a tumble if you 0 the throttle. Betaflight and PX4 are easier. I have a lengthy notes file with exact settings required to make ArduPilot work well with a small quad. The result is a great experience, but getting there was not! Also of note for ease: The ArduPilot code base is a mess compared to PX4's.
- 05 3y ago> I have a lengthy notes file with exact settings required to make ArduPilot work well with a small quad. There are easier ways, like using an existing config file someone posted on AP forum or rcgroups.. It’s not made specifically for small quads and it will never fly as well as BF or even iNav. I wouldn’t expect an agricultural drone to support turtle mode, so no air mode by default shouldn’t be surprising :) Re code base: AP supports LUA so for small mods you won’t have to change the code base at all, compared to PX4..
- cchance 3y agoFor freestyle betaflight is the goto firmware
- hadlock 3y agoArdupilot is very very mature software. It stopped being able to be run on an arduino about a decade ago. There's a guy who has been doing aireal waypoint missions for miles and miles, as well as terrestrial boat missions lasting days. It's been adapted for sailboats as well.
- wkipling 3y agoAt least click the link before submitting your premature damnation
- 05 3y agoThe only advantage of PX4 is its license - it’s BSD vs Ardupilot’s GPL, so companies can use the code without giving back. The mindshare just isn’t there - PX4 is orders of magnitude more obscure, so instead of YouTube tutorials you’ll be trying to get help on PX4 specific forums or digging through the code base.
- inetknght 3y agoI work for a drone company. PX4 is ubiquitous in the industry and in prosumer devices. PX4 provides the autopilot stack. There's all kinds of developer drone releases with all of the parts working and assembled.
- the__alchemist 3y agoWhat is your take on the market share between PX4 and Ardupilot, and in which domains? Are any operations rolling their own firmware?
- inetknght 3y ago> What is your take on the market share between PX4 and Ardupilot Both of them use mavlink and mavlink sucks. Mavlink is probably the worst protocol I've seen used outside of a hobby environment. In my experience, Ardupilot is more of a hobby autopilot. That doesn't make it bad, but it does make it less useful to industry and prosumers.
- the__alchemist 3y agoWhat problems do you have with MavLink? I will say I went on a (thankfully successful) goose chase this morning to figure out how to calculate the "CRC extra byte". I found the answer 2 ways: (1) by asking ChatGPT how to do it using the Python lib, and (2) by compiling ArduPilot and diving 10 folders deep into its build folder. The main issue other than this I've found is it requires 12 bytes of overhead; could be shortened to half this. What problems have you found? DroneCAN... now that's a hot mess. I think you will be pleasantly surprised with MavLINK after trying to implement that. I can go into details, but it's a more exciting experience if the jump scares aren't ruined!
- inetknght 3y ago> What problems do you have with MavLink? Where do I start? The C library has many problems. First, many of the constants are provided as macros (completely valid for C) but this can become a problem in C++ which is generally migrating towards constexpr functions or objects instead of macros. Second, many of the macros specify de/serialization to bitfields and the bitfields raise compiler warnings about safety when compiled in C++ with `-Wall -Wextra`. That's on top of the library being far too complex. I understand the need for an XML generator, but as far as I understand, the C library and C++ library do not provide an easy way to dynamically specify message types at runtime instead of at compile time (contrast with other message protocols). The library's headers are sensitive to the order they're included and they provide configuration via declarations. One of the configuration items is "how many" global "channels" to allocate. These global channels are not thread safe and are used by, eg, QGroundControl. The mavsdk library for C++ is a wrapper around the C library (for the most part) and it brings additional problems. Using the C library means that things aren't very type-safe under the hood. Mavsdk's use of C++ wants to be modern but makes several design choices that I disagree with, particularly around threading (instantiating the C++ library creates a thread to handle its own event queue and creating sockets via mavsdk C++ library creates additional one thread per socket) and serialization (the C++ code does not usefully provide type safe serialization. It's a common pattern but definitely not helpful on power-limited devices: power consumption and latency is higher compared to asynchronous socket programming, both of which are important for flight duration and control feedback. These design choices also make it difficult to unit test with Googletest's EXPECT_DEATH tests which uses `fork()` and can be sensitive to thread problems. Auterion is writing a Mavlink library, libmav. I haven't yet looked at its internals, but I understand they want to address a lot of the shortcomings of the official mavsdk C++ library. So I have high hopes for that ... but alas already have things written to mavsdk's API. Speaking of threading problems, I've encountered problems with QGroundControl's use of threads. A pattern common among these libraries is poor use of lifetime management, and poor use of shared_ptr and/or mutex to guard against races. It's the typical kind of thing that even experienced engineers make ... when they don't use tooling such as Thread Sanitizer or Address Sanitizer to warn (and raise the warning to an error) and/or insufficient test coverage. Past the libraries, Mavlink protocol itself also leaves a lot to desire. It's a protocol that wants to be at nearly every layer in the OSI model. It smells of reinventing the wheel at all of those layers. At layer 2, there's the fact that mavlink is designed to be transmitted directly over a radio, telephone modem, a serial bus such as RS232, or even a multi-component bus such as I2C. At layer 3 we have device and component addressing, and forwarding. At layer 4 we have message sequences, checksums, and retransmissions. Then layer 5 is a little fuzzy. Even at layer 6 there is a custom file transfer protocol. It has custom implementations of a terminal session, ! It stinks to the core of a hobby protocol which "matured" by reinventing every wheel there could be. That's just my observation as a 20-year software engineer who entered the hardware/embedded field a few years ago. Some components or implementations/firmwares have different interpretations of the meaning of data fields. If a coordinate is XYZ then what is the frame of reference for the XYZ? If you've got an orientation with yaw/pitch/roll, then what is the frame of reference? Is altitude based on AMSL or AGL or pressure instrumentation? Are we using WGS84 or something else? Even some messages themselves are deprecated, and there are some custom messages that vendors will use (remember: using custom messages requires a recompile of the library, with a customization to add the message definitions). That's just what I have time to write off the top of my head. There's a ton more problems with mavlink, from an experienced software engineer's perspective.
- jabroni_salad 3y agoI got a tinywhoop kit for my nephew and my sister hated it, so it's probably good. There is an entire ecosystem around those, so you can go piecemeal if you want.
- littlestymaar 3y agoAs a parent your deduction resonates well with my experience. How old is you nephew BTW?
- itishappy 3y ago+1 TinyWhoop It's a company, but also the name of that whole style of drones. Anything in the 65, 75, or 85 mm range can whoop, maybe more, idk. I'd start with a 75mm brushless if I were to do things over again.
- leobg 3y agoYou have a link for a model you’d recommend?
- itishappy 3y agoSorry, not really. I love my Beta75X2S, but it's almost a decade old at this point, and it's a fast moving field. I do have a source I trust, and here's his guide for 2023 (apparently it's someone he endorses): https://www.youtube.com/watch?v=lgeeR8TiuP0 https://www.youtube.com/watch?v=lgeeR8TiuP0 https://www.fpvknowitall.com/ultimate-fpv-shopping-list/ https://www.fpvknowitall.com/ultimate-fpv-shopping-list/ Looks like Mobula6 or Mobula7 is still a solid choice. Also, you'll need a controller and FPV goggles. I would get suggest picking up something nice-ish. They're very general and can be used with many different vehicles/projects. I got cheap goggles and upgraded immediately.
- leobg 3y agoI’d be interested in a kit. Containing everything. Any reason DJI products don’t make your list? Would have thought they are the market leaders, no? I’m just looking to use it for fun. Occasional use. No vlogging or racing or anything like that. Thing is, with the many AliExpress drones on the market, I can’t tell what is trash and what will actually be fun to use. Thanks.
- mlsu 3y agoThe quad these guys are using is a Crazyflie. Small, mostly prebuilt, targeted at researchers. It has a few "addons" like optical flow sensors and external position trackers that let you extract ground truth attitude/position, which is helpful for research like this. Not really "off-the-shelf," but it's a good thing to get if you care more about the controls, learning, trying new algorithms stuff more than sourcing parts, getting RC receiver/tx, sizing motors, that kind of thing. https://www.bitcraze.io/products/crazyflie-2-1/ https://www.bitcraze.io/products/crazyflie-2-1/
- the__alchemist 3y agoInteresting how they're using a PCB as the frame.
- tamimio 3y agoIt depends what quad you are after, fpv, normal, something else? But they are all have some essential components and other extra ones, I am planning to make a full course soon including the software that will enable it to fly over the internet (cellular like LTE/5G).
- steve_gh 3y agoThis is interesting, because it seem to be a start at solving the Fulmar Problem. A fulmar is a cliff nesting sea bird (with a defensive habit of noxious projectile vomiting). They spend their early life on a ledge, but one day they have to start flying. And if you are a fulmar you have a very limited time to learn to fly. So the question is, how does a baby fulmar learn to fly in 10s! It would be interesting to know how much computing power is required for training (compared to the power reqùred to run the controlling NN). My own view is that the network architecture is important, so fulmar brains have evolved with a neural architecture that enables extremely quick learning to stable flight. I played around with a few ideas on using GAs to evolve NN architectures for rapid learning during my PhD 25 years ago, but ended up going in another direction.
- jahnu 3y agoWhy can’t evolution build in the ability of flight and what it needs to learn in the 10 seconds is not how to fly but which way to go?
- throwup238 3y agoInstinct and coordinated muscle memory are two very different things. Animals can evolve to develop that muscle memory faster (i.e. see how long it takes a calf to walk versus a human infant) but it still needs time to develop and that development requires active practice.
- amelius 3y agoA spider does not learn to make a web either. This is arguably more complicated than flying. And its brain is much smaller than a bird's.
- throwup238 3y agoA spider spinning web is an emergent behavior built up from a bunch of simpler ones like excretion, simple movement, and electrostatic hopping from point to point. A bird flying requires the coordination of a much larger number of muscles at the same time, which is much more complex from a nervous system perspective. Spiders reproduce much faster and have a much smaller survival rate so they're well selected for that kind of instinct. Birds less so.
- ahepp 3y agoDoes anyone know of an affordable COTS drone one could try this out with? I’m very interested in the intersection of machine learning and control theory.
- UncleOxidant 3y agoThere's a link in the article to the open source drone they were using: https://www.bitcraze.io/products/crazyflie-2-1/ https://www.bitcraze.io/products/crazyflie-2-1/
- 05 3y agoFor anyone who might want to buy that - it’s a horrible craft to use for anything but in a lab environment set up with a motion tracking system (you won’t be able to do indoor navigation using just the IMU and barometer) - using PCB as frame is not good for flight performance or durability. Any whoop would fly much better.
- WanderPanda 3y agoAuthor of the referenced work here. I have to disagree with this, at least with the motion tracking system part. The optical flow deck [1] works like magic and can maintain low drift positioning even when doing relatively fast and agile maneuvres. For an example you can have a look at our video [2] (e.g. the disturbance rejection tests at 3:00 and after are solely using the optical flow deck) [1] https://www.bitcraze.io/products/flow-deck-v2/ https://www.bitcraze.io/products/flow-deck-v2/ [2] https://www.youtube.com/watch?v=NRD43ZA1D-4&t=198s https://www.youtube.com/watch?v=NRD43ZA1D-4&t=198s
- ducktective 3y agoAwesome work! Can you share the titles of some of your favorite books or courses in controls and RL (for controls) that helped you in doing this project?
- cchance 3y agoI've wondered why we haven't seen a lightweight model on quads for PID tuning, betaflight firmwares great but pid tunings such a pain in the ass if you want it tuned well how about an AI that on the fly adjusts the pid rates.
- ducktective 3y agoTechnically, PID only makes sense for linear time-invariant systems. A quadrotor drone is inherently a nonlinear system but people use linear controllers on it anyways. I mean if we're going to use "AI" on controls, it better be looking for tuning something else, better still, we should only utilize the "optimization algorithms" parts of "AI" hence optimal control.
- blt 3y agoincorrect, most serious "PID controllers" for quadrotors are using geometric PID controllers that take nonlinearity into account, e.g. [1]. [1] Taeyoung Lee, Melvin Leok, N. Harris McClamroch. Geometric tracking control of a quadrotor UAV on SE(3). https://ieeexplore.ieee.org/abstract/document/5717652 https://ieeexplore.ieee.org/abstract/document/5717652
- ducktective 3y agoWell geometric PID controllers are not vanilla PID controllers for LTI systems that I was talking about... Also, and correct me if I'm wrong, I think in industry these vanilla PD/PID controllers are used for attitude and position control of quad-copters. Like, I don't think PX4 or BetaFlight implement any geometric controllers in their code bases.
- blt 3y agoPX4 does: https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/mc_att_control/AttitudeControl/AttitudeControl.cpp https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/m...
- 3y ago
- nvahalik 3y agoI know this nit-picks but... it didn't "learn" anything. It progressively improved its algorithm using a series of feedback sessions. It _improved_ but it didn't _learn_. Someone pre-programmed basic control and feedback parameters. Don't get me wrong—this is still amazing and has useful applications. But can we please stop calling this improvement/refining/tuning process "learning"?
- tamimio 3y agoYeah my thoughts exactly, but you know how it goes in robotics, the buzzier the word the better!
- WanderPanda 3y agoAuthor here. We did not pre-programm basic control or feedback parameters. The trained policy (fully connected neural network) takes the state estimate (position, orientation, linear and angular velocity) and a history of the previous actions as the input and directly outputs the PWM/RPM setpoint (uint16 that sets the pwm interval). The code is open source, you can verify it yourself ;) https://github.com/arplaboratory/learning-to-fly https://github.com/arplaboratory/learning-to-fly
- ahepp 3y agoDo you have any idea what level of effort would be involved to modify the quadcopter? Or, say, use a different one? Would it require a lot of experience developing physical models for simulation?
- disillusioned 3y agoAh yes, one step closer to Slaughterbots reality: https://www.youtube.com/watch?v=O-2tpwW0kmU https://www.youtube.com/watch?v=O-2tpwW0kmU
- alexpotato 3y agoI had the exact same thought but you beat me to the share.
- littlestymaar 3y agoI thought exactly the same thing, this video is probably among the most impactful I've seen in the past decade.
- andix 3y agoI think the title is a bit misleading, it's thousands/millions of robots that try to learn flying (in simulation) and only one of them gets really good at it and is selected, then flashed onto the real quadcopter. It is kind of impressive that it works that well. But also shows how much at the beginning machine learning still is. Theoretically a robot could learn flying in the same way as a human, without crashing million of times first. And the robot could learn much faster than a human does.
- theturtle32 3y agoNo human has ever, not even once, learned to perform the kind of flying that this neural network learned. Because the kind of flying involved here involves subtly - and simultaneously - tweaking the speed of four independent motors by infinitesimal amounts hundreds or more times per second in order to maintain stability. Get the speed of just one motor wrong for even a fraction of a second and you might end up overcorrecting, losing control, and suddenly flipping upside down. No human pilot in history has ever had to perform such a feat. There are certainly flying machines that humans do learn to pilot fairly manually, but a quadrotor is not one of them.
- andix 3y agoAbsolutely true, I guess we would need an experiment like that with a regular model air plane that also a human can learn to fly. I think the learning process for the AI would still be rather poor compared to a human. But also in other machine learning experiments the AIs need way more practice than humans. They just can do repetitions much faster, and clone themselves.
- scotty79 3y agoI'm not sure why you believe that humans are better at anything. https://spectrum.ieee.org/ai-drone-racing https://spectrum.ieee.org/ai-drone-racing
- dukeofdoom 3y agoThe people developing this tech could end up having to face off against it one day. This is where modern warfare is now. A swarm of these could probably clear out an entire trench of soldiers. Run Forest Run, doesn't really work against drones, they'll just hunt you down, Terminator style. Brazen Bull.
- delegate 3y agoThis. Ukraine war is a testing ground for these next gen war devices and very soon they will be flying and locating targets completely autonomously.. Combine that with genai models that anyone can train...
- toxik 3y agoPut up a net. Actually drone interception is also a research topic.
- dukeofdoom 3y agoThis shit should be banned from the battle field. I've only seen one guy surviving a drone attack by throwing a stick at it. AI already mockingly reduced us to being helpless apes throwing sticks at it. Foreshadowing.
- scotty79 3y agoOn the contrary. It should dominate battlefields. To the point of making humans there completely obsolete. Any human loses in war should be treated the same way as civilian loses. It's dumb that we create special class of people that we are fine they are getting killed.
- plasticeagle 3y agoScary, but not completely true; Thankfully, at the moment, they can only fly for about half an hour. And if you're going to have the thing carry weapons too, then it's going to be even heavier. One day though, it'll be true. And sunlight will be blocked by swarms of them. And obviously, the AI will win.
- _spduchamp 3y agoTo everyone going on about animal learning... Just a reminder that this has pretty much nothing to do with animal learning. The real interesting parts is, A) rapid simulation that just works when loaded into a real quadrotor and B) that the NN is generating the PWM pulses! Eliminating all those separate control systems into a NN is an interesting leap.