Creating Black Holes: Division By Zero In Practice

Dividing by zero — the fundamental no-can-do of arithmetic. It is somewhat surrounded by mystery, and is a constant source for internet humor, whether it involves exploding microcontrollers, the collapse of the universe, or crashing your own world by having Siri tell you that you have no friends.

It’s also one of the few things gcc will warn you about by default, which caused a rather vivid discussion with interesting insights when I recently wrote about compiler warnings. And if you’re running a modern operating system, it might even send you a signal that something’s gone wrong and let you handle it in your code. Dividing by zero is more than theoretical, and serves as a great introduction to signals, so let’s have a closer look at it.

Chances are, the first time you heard about division itself back in elementary school, it was taught that dividing by zero is strictly forbidden — and obviously you didn’t want your teacher call the cops on you, so you obeyed and refrained from it. But as with many other things in life, the older you get, the less restrictive they become, and dividing by zero eventually turned from forbidden into simply being impossible and yielding an undefined result.

And indeed, if a = b/0, it would mean in reverse that a×0 = b. If b itself was zero, the equation would be true for every single number there is, making it impossible to define a concrete value for a. And if b was any other value, no single value multiplied by zero could result in anything non-zero. Once we move into the realms of calculus, we will learn that infinity appears to be the answer, but that’s in the end just replacing one abstract, mind-boggling concept with another one. And it won’t answer one question: how does all this play out in a processor? Continue reading “Creating Black Holes: Division By Zero In Practice”

3D Printer Warning: Heating Plastic To High Temps Is Not Healthy

If you’ve ever tried to cut a piece of acrylic with a tool designed to cut wood or metal, you know that the plastic doesn’t cut in the same way that either of the other materials would. It melts at the cutting location, often gumming up the tool but always releasing a terrible smell that will encourage anyone who has tried this to get the proper plastic cutting tools instead of taking shortcuts. Other tools that heat up plastic also have this problem, as Gizmodo reported recently, and it turns out that the plastic particles aren’t just smelly, they’re toxic.

The report released recently in Aerosol Science and Technology (first part and second part) focuses on 3D printers which heat plastic of some form or other in order to make it malleable and form to the specifications of the print. Similar to cutting plastic with the wrong tool, this releases vaporized plastic particles into the air which are incredibly small and can cause health issues when inhaled. They are too small to be seen, and can enter the bloodstream through the lungs. The study found 200 different compounds that were emitted by the printers, some of which are known to be harmful, including several carcinogens. The worst of the emissions seem to be released when the prints are first initiated, but they are continuously released throuhgout the print session as well.

Perhaps it’s not surprising that aerosolized plastic is harmful to breathe, but the sheer magnitude of particles detected in this study is worth taking note of. If you don’t already, it might be good to run your 3D printer in the garage or at least in a room that isn’t used as living space. If that’s not possible, you might want to look at other options to keep your work area safe.

Thanks to [Michael] for the tip!

Jittery Back Off To Speed Up

In systems where there are multiple participants who need to interact with a shared resource some sort of concurrency protection is usually appropriate. The obvious technique is to use locking (and fun words like “mutex”) but this adds a constant performance hit as every participant needs to spend time interacting with the lock regardless of the number of other participants. It turns out this is actually a Big Problem that garners original research, but there are techniques that can yield great effect without a PhD. Years ago [Marc] posted a great walkthrough of one such method, exponential backoff with jitter, to Amazon’s AWS blog which is a great introduction to one such solution.

The blog post was written specifically to deal systems using a specific technique called optimistic concurrency control (OCC) but that doesn’t mean the advice isn’t generally applicable. OCC refers to a method where each writer checks for a write collision only after performing the write (but before committing it), which works well in scenarios where writes are relatively uncommon. [Marc] observed that even in systems where this is a safe assumption things bog down significantly when there are too many writers clamoring for attention all at once.

The traditional solution to such a problem is for each writer to pause for an exponentially increasing amount of time before trying again, but as writers come back in big groups the same problem can recur. He provides a discussion of simple modifications to that strategy which result in significantly reduced wait times for writers.

Problems like this are not especially relevant for single Arduino sensor networks, but even small groups of systems can have concurrency trouble and it’s nice to see such an accessible write up with solutions which are viable even for simple systems. Bonus points to [Marc] for posting source to his test tool online. It doesn’t require anything outside of your computer to run (no AWS required) so if you have any brainwaves about speeding up multi-writer environments it might make a nice test environment! Maybe don’t mention the blog post in your PhD applications though.

Simulating A Speaker

Speakers are one of those components that are simple to use, but difficult to simulate. Most of us have used a simple resistor to do the job. But a speaker’s response is much more complex, and while that might be enough for a simple simulation the fidelity is nowhere near close. [Sourav Gupta] recently shared his technique for modeling speakers and it looks as though it does a credible job.

[Sourav] shows how a simple resistor and an inductor can do the job, but for better fidelity you need more components to model some mechanical effects. The final model has six components which keeps it easy enough to construct but the problem lies in finding the values of those six components. [Sourav] shows how to use the Thiele-Small parameters to solve that problem. Speaker makers provide these as a guide to low frequency performance, and they capture things such as Q, mass, displacement, and other factors that affect the model.

Continue reading “Simulating A Speaker”

Little Emulators Do 8 Bits At A Time

Have you ever wondered how many, for example, Commodore 64s it would take to equal the processing power in your current PC? This site might not really answer that, but it does show that your machine can easily duplicate all the old 8-bit computers from Commodore, Sinclair, Acorn, and others. By our count, there are 86 emulators on the page, although many of those are a host machine running a particular application such as Forth or Digger.

If you are in the US, you might not recognize all the references to the KC85, this was an East German computer based on a Z80 clone. Very few of these were apparently available for personal purchase, but they were very popular in schools and industry. These were made by Robotron, and there are some other Robotron models on the page, too.

Continue reading “Little Emulators Do 8 Bits At A Time”

Retro Wall Phone Becomes A Doorbell, And So Much More

We have to admit that this retasked retro phone wins on style points alone. The fact that it’s filled with so much functionality is icing on the cake.

The way [SuperKris] describes his build sounds like a classic case of feature creep. Version 1 was to be a simple doorbell, but [SuperKris] would soon learn that one does not simply replace an existing bell with a phone and get results. He did some research and found that the ringer inside the bakelite beauty needs much more voltage than the standard doorbell transformer supplies, so he designed a little H-bridge circuit to drive the solenoids. A few rounds of “while I’m at it” later, the phone was stuffed with electronics, including an Arduino and an NFR24 radio module that lets it connect to Domoticz, a home automation system. The phone’s rotary dial can now control up to 10 events and respond to alarms and alerts with different ring patterns. And, oh yes – it’s a doorbell too.

In general, we prefer to see old equipment restored rather than gutted and filled with new electronics. But we can certainly get behind any effort to retask old phones with no real place in modern telecommunications. We’ve seen a few of these before, like this desk telephone that can make cell calls.

Continue reading “Retro Wall Phone Becomes A Doorbell, And So Much More”

Scratch-Building A Supersized Laser Cutter

Now that 3D printers have more or less hit the mass market, hackers need a new “elite” tool to spend their time designing and fiddling with. Judging by the last couple of years, it looks like laser cutters will be taking over as the hacker tool du jour; as we’re starting to see more and more custom builds and modifications of entry-level commercial models. Usually these are limited to relatively small and low powered diode lasers, but as the following project shows, that’s not always the case.

This large format laser cutter designed and built by [Rob Chesney] is meticulously detailed on his blog, as well as in the in the video after the break. It’s made up of aluminium profile and a splattering of ABS 3D printed parts, and lives in an acrylic enclosure that’s uniquely isolated from the laser’s internal gantry. All told it cost about $2,000 USD to build, but considering the volume and features of this cutter that’s still a very fair price.

[Rob] carefully planned every aspect of this build, modeling the entire machine in CAD before actually purchasing any hardware. Interestingly enough his primary design constraint was the door to his shed: he wanted to build the largest possible laser cutter that could still be carried through it. That led to the final machine’s long and relatively shallow final dimensions. The design was also guided by a desire to minimize material waste, so when possible parts were designed to maximize how many could be cut from a one meter length of aluminum extrusion.

The laser features a movable Z axis that’s similar in design to what you might see in a Prusa-style 3D printer, with each corner of the gantry getting an 8 mm lead screw and smooth rod which are used in conjunction to lift and guide. All of the lead screws are connected to each other via pulleys and standard GT2 belt, but as of this version, [Rob] notes the Z axis must be manually operated. In the future he’ll be able to add in a stepper motor and automate it easily, but it wasn’t critical to get the machine running.

He used 3D printed parts for objects which had a relatively complex geometry, such as the laser tube holders and Z axis components, but more simplistic brackets were made out of cut acrylic. In some components, [Rob] used welding cement to bond two pieces of acrylic and thereby double the thickness. Large acrylic panels were also used for the laser’s outer enclosure, which was intentionally designed as a separate entity from the laser itself. He reasoned that this would make assembly easier and faster, as the enclosure would not have to be held to the same dimensional tolerances as it would have been if it was integrated into the machine.

[Rob] gives plenty of detail about all the finer points of water cooling, laser control electronics, aligning the mirrors, and really anything else you could possibly want to know about building your own serious laser cutter. If you’ve been considering building your own laser and have anything you’re curious or unsure about, there’s a good chance he addresses it in this build.

Short of having the fantastically good luck to find a laser cutter in the trash that you can refurbish, building your own machine may still be the best upgrade path if you outgrow your eBay K40.

Continue reading “Scratch-Building A Supersized Laser Cutter”