News for hackers. Stuff that matters.
Re:Have you ever hurt yourself from your own code? by sowbug on Wednesday May 26, 2021 @10:20PM (#27298622)
About seven years ago I got a bright idea to build a quadcopter. I had experience with little $25-50 drones that bumped around the house with their fragile one-inch propellers, which obviously qualified me to build and pilot something significantly bigger.

Off to Aliexpress and Banggood I went. I ordered a carbon-fiber chassis, big strong motors, ESCs, 3-inch propellers, a FrSky receiver, a Devention transmitter, an STM32-based controller, giant li-poly batteries, and all the cables and fasteners I needed. Over the coming weeks the parts trickled in. Finally once the whole kit had arrived, I assembled everything, connected the TTL serial, built the firmware, downloaded it to the controller, and like the brilliant software engineer I am, plugged in the batteries on my bench at home.

Nothing happened. Those of you who have blown off fingers wondering why the firecracker under the Coke can hasn't exploded yet can guess what I did next.

I examined the chassis closely and began fiddling with the cables and connectors. Again, like the brilliant software NOT HARDWARE engineer that I am.

Evidently, I fixed the problem. Which caused four gigantic propellers to begin whirling around my hands and face. And four brushless electric motors to emit their usual high-pitched whine, which today I instinctively hear as them saying to me "You god damned idiot. You are so ours."

I was not injured. But that evening, I came close to slicing at least a couple things off my body. I hadn't appreciated the scale of the thing I was building, or the inherent risk in debugging it once I'd slapped it all together. I shelved the project for years, eventually giving it to someone at work who claimed to know his stuff when it came to drones. I hear he's doing fine.

Disclaimer: this story isn't about code or my own code. But I think it fits here because I approached dangerous hardware with the "build, run, see what happens" mindset of a software developer.

Re:Have you ever hurt yourself from your own code? by VBprogrammer on Thursday May 27, 2021 @05:57AM (#27301050)
I feel obligated to add my silly mistake here. I was playing with SDR and was soldering together a small antenna for receiving ADS-B signals.

I soon realised my electric soldering iron wasn't powerful enough so I nipped out and bought a miniature blow torch. The kind which are basically a big cigarette lighter. Having got it home I tried igniting it a few times and nothing happened. I held it up to my ear to try to hear if there was any gas coming out, sure enough there was gas coming out, which in that instant ignited beautifully into a 700 degree flame pointed right at my ear.

Re:Have you ever hurt yourself from your own code? by signaturefish on Thursday May 27, 2021 @06:30AM (#27301231)
Hey, accident twins! I once had a Zippo lighter that was playing up - you could strike it and you could see the spark fly, but it didn't light. I sniffed the wick, yeah, definitely fuel evaporating off it. I struck the striker, yup, spark. Sniff, fuel, strike, spark. Sniff, strike and OF COURSE the thing lights up immediately, sending a cigarette lighter flame right up my right nostril. I'm told by bystanders that half my face lit up in an "electrocuted film character" way for a fraction of a second before I jerked it away, and I was smelling nothing but burnt nose hair every time I inhaled for about a week.
Re:Have you ever hurt yourself from your own code? by trasz on Thursday May 27, 2021 @01:39PM (#27305824)
FWIW, when that happens just blow at it slightly.
Re:Have you ever hurt yourself from your own code? by HeyLaughingBoy on Thursday May 27, 2021 @05:32PM (#27308821)
Friend of mine did that with his gas furnace after it went out. I think his eyebrows grew back to where you couldn't tell anymore...
Re:Have you ever hurt yourself from your own code? by busymom0 on Thursday May 27, 2021 @06:30AM (#27301233)
WHAT?
Re:Have you ever hurt yourself from your own code? by 8fGTBjZxBcHq on Thursday May 27, 2021 @12:05AM (#27299280)
People are sometimes kind of down on that approach in software, considering it sloppy. Especially in comparison to other engineering disciplines it just looks kinda bad sure.

But really I'm pretty sure if for example civil engineers could build a bridge in an hour and load it up consequence-free they'd do it too.

The fact that we do it isn't bad at all, but yeah it's easy to not realize when you've exited the realm of consequence-free testing.

Re:Have you ever hurt yourself from your own code? by Mauricebranagh on Thursday May 27, 2021 @12:17PM (#27304794)
Well hundreds of years of bridge disasters, fatalities and some times bad poetry [https://www.scottishpoetrylibrary.org.uk/poem/tay-bridge-dis...] is a harsh teacher.
Re:Have you ever hurt yourself from your own code? by devoutsalsa on Thursday May 27, 2021 @12:25AM (#27299382)
I wonder how long it will be before we can 3-D print a dam in place.
Re:Have you ever hurt yourself from your own code? by hyperhopper on Friday May 28, 2021 @03:36AM (#27312695)
I mean, the novel of 3d printing is that it's just additive construction, don't we already build dams and almost all other structures that way already?

A crane is just a bigger print arm :)

Re:Have you ever hurt yourself from your own code? by hutzlibu on Friday May 28, 2021 @05:48AM (#27313431)
Yes, but the dream is to build physical things, just with software.

You type in your commands and then magic happens and something is build (after a while). Nothing to be done by hand (ideally)

But I would love to play with a fully automated remote controlled printer the size of an crane, though.

But then there should probably be no humans around.

Re:Have you ever hurt yourself from your own code? by devoutsalsa on Friday May 28, 2021 @04:10PM (#27319883)
You have a point :)
Re:Have you ever hurt yourself from your own code? by agustif on Thursday May 27, 2021 @04:07AM (#27300516)
Those beaver-bots will be ferocious!
Re:Have you ever hurt yourself from your own code? by SavantIdiot on Thursday May 27, 2021 @01:00AM (#27299572)
I built one too, and the first time I powered on the motors I felt like I was staring at four unguarded blenders and thought: wow, people actually handle these things while they are running.

Made me very nervous for a long time, especially the first few flights (or attempt at flight).

Now I twitch whenever I connect the battery and the FC makes them jerk a little. I know they aren't armed and failsafe is active and all, but you bet yer tuchus that I'm super careful connecting!

Glad you didn't shred anything.

Re:Have you ever hurt yourself from your own code? by Ao7bei3s on Thursday May 27, 2021 @03:19AM (#27300302)
Not sure if you want to hear this, but please don't entirely trust any arm/safe system. I've had to debug one when it failed. Original dev: "impossible... show me... huh?!".

(It was some faulty hardware. Dont remember the details; it was a non obvious issue with one FC. Wasn't worth fixing the hardware, I discarded it.)

Re:Have you ever hurt yourself from your own code? by SavantIdiot on Thursday May 27, 2021 @12:38PM (#27305039)
Point taken. I'm getting a tiny bit lazy connecting the batteries (too bad XC60 connectors require so much force). But I'm very cautions to make sure my fingers aren't in the line of the props (I actually used to wear welding gloves when connecting the battery). I just need an inline 60A switch or something even safer that doesn't keep my fingers in the line of fire that long. Thanks!
Re:Have you ever hurt yourself from your own code? by HeyLaughingBoy on Thursday May 27, 2021 @05:30PM (#27308807)
You learn. Hopefully before someone gets hurt.

I still remember an EE lab professor saying one day "get in the habit of using red wires for Power and black for Ground. That way, when you have your first accident, maybe it won't be too bad."

Or a technician I used to work with who would quote his tech school instructor daily, "NO, no loose conductors on the test bench."

All the nail heads on my work bench are covered with electrical tape. I try to use red wires for + and black or green for - whenever possible. I learned to think about what could happen before I flip the power switch (first power up use the lab supply with current limited to the absolute minimum the circuit needs), or when I hit F5 in the debugger (does anyone have their hands in the machine?).

I've still set things on fire, still broken expensive pieces of equipment because I had the wrong sign on a variable, still made loud banging steel-on-steel noises because I didn't calculate an offset correctly etc.,

At the end of the day, if everyone goes home with all body parts intact, we'll call it good.

Re:Have you ever hurt yourself from your own code? by sowbug on Sunday May 30, 2021 @07:21PM (#27337971)
I set my first Arduino on our washing machine, which was my platform for demos for my family. I set it right on an area with chipped paint and exposed metal.

I eventually figured out I'd shorted and destroyed the 7805 regulating the DC input to 5v. My first in-the-field electronics repair was to remove it, bodge it, and live with a USB-only Arduino. I still have that Arduino; it's a reminder of the first time I let out the magic smoke.

Re:Have you ever hurt yourself from your own code? by dharmab on Thursday May 27, 2021 @12:15AM (#27299333)
There are some pretty gruesome photos on /r/multicopter of fingers sliced like a four year old's hot dog. Spooky stuff!
Re:Have you ever hurt yourself from your own code? by TameAntelope on Thursday May 27, 2021 @12:08PM (#27304682)
In a similar vein, I once stuck my finger in one of the fans on my desktop to stop it from knocking.

Sliced it pretty good! Honestly, if I had just touched it closer to the center it probably would have been okay...

Re:Have you ever hurt yourself from your own code? by Ao7bei3s on Thursday May 27, 2021 @01:25AM (#27299694)
tl;dr: Experience makes dangerously careless. Examples: quadcopters, lasercutters.

I had a similar scenario with the same preconditions. In this case, one of the propellers came off and barely missed a face.

This was a 10 inch hard plastic prop with some sharp edges. It could've taken an eye out. It could've caused serious cuts. It could've been a carbon fiber prop and caused _serious_ cuts. Of course it could also have been a soft plastic, round edged prop that would've done less damage. It missed, and nothing happened.

In this case, the cap on the mount wasn't tight enough - complete negligence; preventable. But what bothers me it that it is not possible to completely prevent that kind of mistake. Mount caps _can_ shake loose under vibration - with some features (spin reversal) there is no one safe screw direction. Also, mounts can break. More importantly, prop blades can break. Some prop mounts only use rubber loops to secure the props - they props are _meant_ to fly off off in that case. A prop could be inverted, or the PID controller could diverge, potentially sending the entire copter into your face. Probably everyone should wear safety goggles. But nobody does, and things rarely go wrong. At the very least, please do not have your head on _or above!_ the propeller's plane. Search Youtube for "quadcopter hand launch" for an appreciation how often this rule is broken as a matter of normal, routine operating practice. Often the person holding is not the pilot. That's some trust, when a small inadvertent finger movement on the pitch axis could permanently injure.

What also bothers me is that the people who should and do know best often ignore safety the most. Ever seen a group of copter devs scramble as the noise of the copter thirty feet overhead cuts off? Ever seen the same group charge a few dozen lithium polymer batteries that have survived more than a few crashes, unattended, with no fireproof bags, with no fire extinguisher, in someones room? Nothing ever went seriously wrong. But everything could have. And dont get me wrong - these are smart, safety minded people.

Along the same lines, if you are ever near someones DIY lasercutter, say in a hackerspace/makerspace... do _not_ assume it is eye safe, no matter what they claim and what laser safety certs they claim to have. In particular, do _not_ ever assume it is eye safe when you look at it from an unusual angle, like when you bend down, kneel, or when small people, children or pets are present. I have seen multiple DIY lasers get the top cover right (easy - any thick plastic sheet will block stray light from a CO2 laser), and completely and utterly fail to close small holes in front (air vents, or lid not closing perfectly, ...). There's a back of the envelope calculation that looking at the diffuse (not even reflected) spot (invisible! - and there might not be secondary light) a 100W CO2 laser (a typical size for ambitious hobbyists) creates on a surface can cause permanent eye damage if viewed from 1 meter away.

Re:Have you ever hurt yourself from your own code? by 05 on Thursday May 27, 2021 @09:26AM (#27302789)
> Probably everyone should wear safety goggles. But nobody does

well, some of us do, it's called 'FPV'.

Re:Have you ever hurt yourself from your own code? by amelius on Thursday May 27, 2021 @04:40AM (#27300666)
> Examples: quadcopters, lasercutters.

Believe it or not, but you can find YouTube videos where the two are combined.

Re:Have you ever hurt yourself from your own code? by driverdan on Thursday May 27, 2021 @05:33PM (#27308841)
I love laser cutters but all the videos of cheap open frame cutters on YouTube scare the shit out of me. I never want to be around one with an open frame.
Re:Have you ever hurt yourself from your own code? by sowbug on Thursday May 27, 2021 @03:00AM (#27300205)
I stick with off-the-shelf drones since my DIY incident, but I still get very uncomfortable when mine hover at eye level.
Re:Have you ever hurt yourself from your own code? by noisy_boy on Thursday May 27, 2021 @01:20AM (#27299660)
Thankfully you were unscathed. Otherwise I could not have mentioned that I really enjoyed reading that :)