Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: The Jankest Autonomous Drone Built and Programmed from Scratch (github.com/alexozer)
137 points by alexozer on March 10, 2019 | hide | past | favorite | 37 comments

I love this. I've been a professional dev for almost a decade now, and over the last couple of years have started migrating toward a blend of hardware and software/firmware development, and I can't get enough of learning to build physical things from scratch. I don't often get to iterate in this way at my job, and rebuild the same thing over and over, so I tend to spend my free time with projects like this that start out shitty, and you get to take the time to comb over the details, making constant prototypes.

I started a deep dive in electronic music and synthesizers in the last couple of months, and have been thoroughly enjoying playing the productions units I own (Korg Monologue, Elektron Digitakt, Roland JV1080), but have even more so enjoyed the sort of free form effort of building my own instrument:


That started out as a nightmare breadboarded voltage controlled oscillator, to a nicely breadboarded vco, to a rebuild on perf board, and then obviously I needed a perfboard power supply. But, once I wanted a mixer, I needed +/- 12v, not just 5v, so that led to a better iteration of the power supply, etc. It's a rabbit hole, but an immensely educational and fairly inexpensive one. I figure I'm about 3 months and a couple of YouTube tutorials away from my first Kicad developed oshpark printed PCB, and I have a ton of ideas for next steps, and prototypes in flight (CES3340 based VCO, Arduino MIDI control and CV translation, Lowpass/bandmiss filters, so on and so forth).

Back to the subject of the original post, this totally looks like Pennsylvania, and if it is and the engineer who built this is in the job market, and has any interest in working for a smaller, established (20 year) shop that lives in one of the automotive spaces doing a lot of cool custom hardware/software development, I'd happily accept a resume.

Similar story here, developer then sysadmin, but I decided I wanted to have a hobby and "physical stuff" seemed interesting.

When my child was born I spent my paternity leave getting started with Arduino, and ESP8266 devices. These days I've kinda stalled, but there's something fun about making the hardware and the software, and getting back to the limits I used to "enjoy" with limited RAM/flash-space.

Mostly my projects are put together for learning, then the parts are recycled, but there are a few projects dotted around the house that have stayed in-place for a couple of years now.

(Wireless temperature/humidity sensors, along with tram-departure information, etc.)

We use the ESP8266 extensively at work, great little micro.

Awesome vco build! Have you read the MAKE book about building the Noise Toaster? It's great!

I ran into my own discouraging brick wall when trying to figure out how to fabricate metal control panels/enclosures and printing labels on them without expensive cutting equipment.

Thanks man! I have not read the book yet, my synth education has basically been a ton of googling, the synthdiy and synthesizer subreddits, muff wiggler, and all the awesome old school websites like mfos, birth of a synth, ken smith's designs, etc. I always knew of electronic music production and had some friends who are super into the DAW way of doing things, but I had no clue the level the hobby/eurorack scene was at.

Oooh you should learn how to route PCBs, you're going to love both the process and the result.

I've definitely done some research into a few different manners of making my own PCBs, but I'm trying to find the right balance of doing things myself vs. time/cost associated. Since the majority of the PCB learning is going to be around KiCad, and I'll just be able to send the files along with $15 off to oshpark and get perfect boards in a week or two, it's hard to start the investment of fully custom boards.

> Since the majority of the PCB learning is going to be around KiCad, and I'll just be able to send the files along with $15 off to oshpark and get perfect boards in a week or two, it's hard to start the investment of fully custom boards.

I'm not sure what you mean here. Since it's just KiCAD and then you can get boards for cheap, why is it hard to start the investment?

Sorry, when I saw fully custom I mean printing designs on photo paper and doing the chemical, as opposed to just having oshpark print them.

Oh, no, that's too much hassle, I meant KiCAD instead of perfboard.

Came across this little PCB mill just today: https://www.youtube.com/channel/UCX44z-SSL7LzcB4xxgUdHHA

I used to make PCBs at home, first using toner transfer and ferric chloride (never again, impossible to avoid staining everything in your lab), then with a UV lithography mask (photoresist and a laminator) and an exposure box used for making stencils. The UV stuff is actually pretty good, you can easily go down to 0.5mm pitch with some practice. Etching is still a pain, but I started using a clear etchant (sodium persulfate?) which at least didn't stain everything. I briefly experimented with laminated and cured solder masks, but that's also tricky. Never got round to silkscreening, though apparently you can do it with coloured foils.

Drilling is a pain in the ass. The bits break easily and drilling accurately, even with a press, is hard. Milling makes this so much easier. Then you need to think about plated through holes, do you rivet? Do you just put some 30 gauge wire and solder?

Nowadays I find I rarely need to rush boards and Oshpark is so cheap it's ridiculous. There are cheaper companies (I've yet to try Dirty PCB), but you get 3 boards, ENIG and really good tolerances for free. Even rush shipping ($20 international fedex) is cheaper than getting it done here in the UK. The only competitor I've found is Ragworm, and they're both more expensive and you only get one board with HASL.

Unless you really want a board made now, I would say just get them made for you. The quality is so much better without spending tons of time. Of course sometimes you really do want a prototype instantly and if you want to make a weird shape - perhaps a really long rectangle that would cost a fortune to get made, it's worth having the kit in your house to do.

On the milling side, I'd be tempted just to buy a Spokeo mill which can apparently do reasonably good PCB milling. Costs a lot, but at least it'll do other things as well.

I've recently got access to a lab with some very expensive rapid protoptying kit (from LPKF), which I'm keen to try out. It can even do 3D PCBs laid onto plastic components.

That's what I do as well. I switched to JCLPCB from Dirty PCBs and am pretty happy, but I was pretty happy with Dirty as well. They give me ten 10x10cm paneled boards for like $15, and because I design tiny boards I get around 100 of them in the end, which is 99 more than I reasonably need. It's so cheap, though, that it's not worth doing anything else.

This is where I'm at. If we see absurd leaps and bounds made in the homebrew milling/printing scene in terms of speed, cost, performance, then I'll start down that path, but for the time being the race to the bottom in terms of cost in small run PCBs is just too good for the consumer that it's hard to justify going totally homebrew.

The homebrew 3D printing/milling scene is turning into such a cool, viable space these days. There's not enough time to build all this cool stuff!

What did you use for a power supply, out of interest? I've been dabbling with synths & info about power supplies seems to be the major thing that's lacking.

Originally, my 5v was just an Arduino wall wart wired into the whole thing with these:


Now I'm using the same barrel jacks, but with an old linksys wall wart.

That said, it's not an ideal situation, and I'll most likely build something like this in the not too distant future:


If you want to build a really cheap drone that can actually do autonomous GPS-guided stuff, the Kakute F7 can be flashed with Arducopter (Arudpilot), and is $49 with a power distribution board. Mostly intended for small racing drones, but can be used for other purposes.



Or you can get the version that combines a four motor ESC in a stack with the version of the Kakute F7 that doesn't have a built in PDB (power distribution board), for under $120.


other parts needed to complete something: motors, propellers, frame, battery, video tx (for something like 5.8 GHz band goggles), RC receiver, wiring, ublox m8n GPS receiver.

want a cheap frame? It'll be heavier than ordering a $45 carbon fiber frame from banggood or gearbest or aliexpress or such, but you can 3d print one at the cost of maybe half of a spool of $18 PLA filament:



This is all great advice. Ardupilot/Arducopter is heavy duty stuff, you can make a quadcopter/plane/whatever that will fly completely autonomously by giving it waypoints on a Google Maps interface. Highly recommended, I've built a plane like this and very much enjoyed the process.

Total flight time was around thirty seconds because I managed to crash it twice, but live and learn.

What is the approximate price range to get everything needed?

absolutely everything, there's some common ground station stuff (your handheld transmitter, and goggles or 7" LCD monitor + video receiver), that's an unavoidable upfront cost separate from the aircraft itself. Figure at minimum $300 to $400 for that.

For a small quadcopter, $400-500 total parts cost, anything below that will involve a lot of quality compromises.

Take a look at some of the RTF / ready to fly specifications sold by getfpv.com or helipal.com for examples.

I've only seen the word written as jank, janky or jankiest. First for jankest. Where can I view photos of the various physical build attempts?

At Twitter in the early days it was janky/jankiest. “Jankest” is also new to me.

The opposite of janky was prostyle. There was no middle ground.

Yes, my use of jankest is possibly 100% contrived.

Also, I recently added a comment with a photo album if you are interested!

Great! Thanks!

“Most jank” is the correct superlative when using the noun as an adjective according to Wiktionary.

For a minute I thought the drone algorithm was somehow running on Scratch, and I was curious as to how the author had managed to accomplish this feat...

You might find his style grating, but Michael Reeves did something related: https://www.youtube.com/watch?v=bZDE6I5B9-E

Hi, I'm the creator! Thank you all for your thoughtful comments.

Some of you wanted a photo album of the journey; I quickly collected one here [0]. Apologies for duplicates, no descriptions, and Google.

The full album shows a lot more of the process, but I also linked some quick highlights / milestones at the end of this comment.

Also, to those who were wondering, I am still in the market for a Summer 2019 internship.

I really ought to have a blog post detailing more of this, but here's a little backstory anyway. My best friend from high school and I wanted to experiment with creating our own modular drones, and although we bought a bunch of parts, we ended up leaving for college before we could do anything. A couple years later I had some time on my hands, and I decided that I wanted to see whether or not I could actually build and program a drone myself. For the project, I tried to focus on writing high quality software while still managing to build something flyable with my nearly-nonexistent mechanical skills. Even though much of this project was physical (and electrical), I still largely consider this a software project, actually.

Physically, my prototypes are something you might laugh at. Zip ties, styrofoam, and Gorilla tape were my go-to materials for the most part. I originally started by mounting (read: zip-tying and taping) components to PVC tubes and metal sheets; combined with the pretty large LiPo battery I bought, it should have been no wonder that four motors were no match for the weight of the thing. I later decided to screw together 6 strips of carbon fiber sheet (a "frame") and add two motors to help assure my drone can actually lift greater than two inches off the ground at a time. Reworking the flight controller to work with six motors instead of just two was a fun challenge; I decided to make the flight controller support an unlimited number of motors in a circle while I was at it.

Figuring out the optimal wireless technology for the drone was a bit of a process as well. It was frustrating when I thought I had everything ready for a test flight, but then slowly realized that, perhaps, I wasn't going to be able to get away with using Bluetooth LE over non-trivial distances. Eventually I found a radio module with superb distance and transmission rate; and after some struggle, I got them working. You can see in the video that I could control the drone from quite far away!

It took quite a few days of test "flights" to get the drone to fly as well as it did in the video (if you consider the oscillating nightmare in the video "flying well"). Even getting the drone to launch two feet in the air, instantly lose control and backflip, and crash back down on the ground felt like an AMAZING feat from my perspective; it demonstrated all my systems were at least online and functional. I slowly increased the hover time of each attempt by a couple seconds or so, adjusting my controller tuning and implementation as I went. The flight in the video was nowhere near as primitive as some of my early experiments, even.

I'm sure I skimped on many details, don't hesitate to ask for more information on anything.

[0]: Full album: https://photos.app.goo.gl/QhSZEyd4DA1r9S9G6

First physical prototype: https://photos.app.goo.gl/k6km6Hyrkq4FuxkH9

Second physical prototype: https://photos.app.goo.gl/sL1LjnAgeXrmGvgEA

Third physical prototype: https://photos.app.goo.gl/bY33peH7RZbXPxyx9

LED strip code testing: https://photos.app.goo.gl/wZJJJ4NrFENjpUkHA

Custom remote control assembled: https://photos.app.goo.gl/z577cVbH59vjW3g56

Final "boxy" physical prototype: https://photos.app.goo.gl/8ESsQidi5Tgsb1mm6

How did you get the remote control to work? Looks like you started with an Xbox controller?

I originally used an Xbox controller as a case, but the hardware was my own. Eventually I ended up putting everything inside a Raspberry Pi case. Inside I put a protoboard with an Arduino and a radio module which communicates with the radio module on the drone. The code for message serialization is custom.

Blog post on design process please! Would be fun to read about the various hardware iterations.

Is that two chunks of drywall as substrate on one of those drones?

I need to do a write up of my FPV hovercraft its also quite janky.

Just need to dial in those PID controllers a little more!

What is the white dot on the video ?

Interesting, I've never noticed that before. I would guess it's a lens artifact, since it seems to move depending on where the sun is in the frame.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact