Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I tested the hell out of it to make sure that it worked as intended. Long story short, the hard part was to make sure that on powering up the system it wouldn't put random bits of output on the various ports which the hardware would then interpret as signals to make servos run and power up spindles. Initially I thought that the hard part was to make things stop, but that's actually rather easy, you just drop the power to a relay that is held 'on' by itself. That's irreversible from the software side, someone then needs to re-enable the power manually using the same mechanism (those mushroom switches stay down once you activate them). But when you do that - the re-enabling - you risk mayhem because the state of the machine is completely undefined. The trick to solving this was to confirm one-by-one that all outputs were in defined states and then outputting a sequence of bytes on a port to re-engage the relay, independent of whether the user had re-set the e-stop. The sequence was long enough that it could not happen by chance.

It's this kind of subtle interaction between hardware and software where it is super easy to make a stupid mistake and to end up regretting it the rest of your life. Making sure that machine stayed off when it had to was super important, some of those servos were the size of buckets and would happily rip your arm off when powered up, the chuck on the largest machine that we did was 6 meters, to cut wheels for harbor cranes. Really nothing to fuck up with.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: