Art of 3D printer in the middle of printing a Hackaday Jolly Wrencher logo

3D Printering: Listen To Klipper

I recently wrote about using Klipper to drive my 3D printers, and one natural question is: Why use Klipper instead of Marlin? To some degree that’s like asking why write in one programming language instead of another. However, Klipper does offer some opportunities to extend the environment more easily. Klipper runs on a Linux host, so you can do all of the normal Linux things.

What if you wanted to create a custom G-code that would play a wave file on a speaker? That would let you have custom sounds for starting a print, aborting a print, or even finishing a print.

If you recall, I mentioned that the Klipper system is really two parts. Well, actually more than two parts, but two important parts at the core. Klipper is, technically, just the small software stub that runs on your 3D printer. It does almost nothing. The real work is in Klippy, which is mostly Python software that runs on a host computer like a Raspberry Pi or, in my case, an old laptop.

Because it is Python and quite modular, it is very simple to write your own extensions without having to major surgery or even fork Klipper. At least in theory. Most of the time, you wind up just writing G-code macros. That’s fine, but there are some limitations. This time, I’m going to show you how easy it can be using the sound player as an example.

Macros All the Way Down

Normally, you think of gcode as something like: G1 X50 Y50. Some of the newer codes don’t start with G, but they look similar. But with Klipper, G1, M205, and MeltdownExtruder are all legitimate tokens that could be “G-code.”

For example, suppose you wanted to implement a new command called G_PURGE to create a purge line (case doesn’t matter, by the way). That’s easy. You just need to put in your configuration file:

[gcode_macro g_purge]
gcode:
# do your purge code here

The only restriction is that numbers have to occur at the end of the name, if at all. You can create a macro called “Hackaday2024,” but you can’t create one called “Hackaday2024_Test.” At least, the documentation says so. We haven’t tried it.

There’s more to macros. You can add descriptions, for example. You can also override an existing macro and even call it from within your new macro. Suppose you want to do something special before and after a G28 homing command:

[gcode_macro g28]
description: Macro to do homing (no arguments)
rename_existing: g28_original
gcode:
M117 Homing...
g28_original
M117 Home done....

Continue reading “3D Printering: Listen To Klipper”

GPS Tracking In The Trackless Land

Need a weekend project? [Cepa] wanted a GPS tracker that would send data out via LTE or the Iridium network. Ok, maybe that’s one for a very long weekend. However, the project was a success and saw service crossing the Barents Sea in the Arctic. Not bad.

Apparently, [Cepa] is very involved in sharing tracks to odd and remote places. While you may not have cell service in the middle of the Barents Sea, you can always see Iridium. The device does make some sacrifices to the expense of satellite communications. On LTE, the system pings your location every ten seconds. Without it, it dials up the sat connection once an hour. However, it does store data on a SD card, so — presumably — you get caught up when you have a connection.

Continue reading “GPS Tracking In The Trackless Land”

WiFi Meets LoRa For Long Range

What do you get when you cross WiFi and LoRa? Researchers in China have been doing this, and they call the result WiLo. They claim to get reliable connections over about half a kilometer. Typical WiFi runs 40 to 60 meters, barring any Pringle’s cans or other exotic tricks.

According to [Michelle Hampson] writing in IEEE Spectrum, the researchers manipulated Wi-Fi’s OFDM multiplexing to emulate LoRa’s chirp-spreading signal. The advantage is that existing WiFi hardware can use the protocol to increase range.

Continue reading “WiFi Meets LoRa For Long Range”

Hackaday Podcast Episode 291: Walking In Space, Lead In The Earth, And Atoms Under The DIY Microscope

What have you missed on Hackaday this week? Elliot Williams and Al Williams compare notes on their favorites from the week, and you are invited. The guys may have said too much about the Supercon badge this year — listen in for a few hints about what it will be about.

For hacks, you’ll hear about scanning tunneling microscopes, power management for small Linux systems, and lots of inertial measurement units. The guys talked about a few impossible hacks for consumer electronics, from hacking a laptop, to custom cell phones.

Of course, there are plenty more long-form articles of the week, including a brief history of what can go wrong on a spacewalk and how to get the lead out (of the ground). Don’t forget to take a stab at the What’s That Sound competition and maybe score a sweet Hackaday Podcast T-shirt.

Check out the links below if you want to follow along, and as always, tell us what you think about this episode in the comments!

Use this link to teleport a DRM-free MP3 to your location.

Continue reading “Hackaday Podcast Episode 291: Walking In Space, Lead In The Earth, And Atoms Under The DIY Microscope”

Inside The F-4 Attitude Indicator

[Ken] recently obtained an attitude indicator—sometimes called an artificial horizon—from an F-4 fighter jet. Unlike some indicators, the F-4’s can rotate to show pitch, roll, and yaw, so it moves in three different directions. [Ken] wondered how that could work, so, like any of us, he took it apart to find out.

With the cover off, the device is a marvel of compact design. Then you realize that some of the circuit is inside the ball, so there’s even more than it appears at a quick glance. As you might have guessed, there are two separate slip rings that allow the ball to turn freely without tangling wires. Of course, even if you don’t tangle wires, getting the ball to reflect the aircraft’s orientation is an exercise in control theory, and [Ken] shows us the servo loop that makes it happen. There’s a gyroscope and synchros—sometimes known by the trade name selsyn—to keep everything in the same position.

You have to be amazed by the designers of things like this. Sophisticated both electrically and mechanically, rugged, compact, and able to handle a lot of stress. Good thing it didn’t have to be cheap.

We’ve seen inside an ADI before. If you want to make any of this look simple, check out the mechanical flight computers from the 1950s.

Continue reading “Inside The F-4 Attitude Indicator”

The Last Sun Sparc Workstation

The truth is, our desktop computers today would have been classed as supercomputers only a few decades ago. There was a time when people who needed real desktop power looked down their noses at anyone with a Mac or a PC with any operating system on it. The workstation crowd used Sun computers. Sun used the Sparc processor, and the machine had specs that are laughable now but were enviable in their day. [RetroBytes] shows off Sun’s final entry in the category, the Ultra 45 from 2007.

Confusingly, the model numbers don’t necessarily increase. The Ultra 80, for example, is an older computer than the 45. Then there were machines like the Ultra 20, 24, 27, and 40 that all used x86 CPUs. A ’45 had one or two UltraSPARC III 64-bit CPUs running at 1.6 GHz and up to a whopping 16 GB of RAM (the one in the video has 8GB). Sure, we see less powerful computers today, but they are usually Chromebooks or very cheap PCs.

The Ultra line started back in 1995 but went underground for a few years with a re-branding. Sun brought the name back in 2005, and the Ultra 45 hit the streets in 2006, only to discontinue the machine in late 2008. According to [RetroBytes], the Sun team knew the Workstation days were numbered and wanted to produce a final awesome workstation. Partially, the reason for sparing few expenses was that anyone who was buying a SPARC workstation in 2006 probably had a reason not to move to cheaper hardware, so you have them over a proverbial barrel.

We liked the CPU cooler, which looked hefty. Honestly, except for the type of CPUs in it, the box could pass itself off as a mid-range desktop tower today with PCI express sockets. The operating system was Sun’s brand of Unix, Solaris, now owned by Oracle.

Sun’s big competitor for a while was Apollo. We’d point out that if all you want is to run Solaris, you don’t need to buy new old hardware.

Continue reading “The Last Sun Sparc Workstation”

Spectroscopy On The Cheap

[Project 326] wanted to know exactly what gas was in some glass tubes. The answer, of course, is to use a spectrometer, but that’s an expensive piece of gear, right? Not really. Sure, these cheap devices aren’t perfect, but they are serviceable and, as the video below shows, there are ways to work around some of the limitations.

The two units in question are “The Little Garden” spectrometer and a TLM-2. Neither are especially sensitive, but both are well under $100, so you can’t expect much. Because the spectrometers were not very sensitive, a 3D printed jig and lens were used to collect more light and block ambient light interference. The jigs also allowed the inclusion of special filters, which enhanced performance quite a bit. The neon bulbs give off the greatest glow when exposed to high voltage. Other bulbs contain things like helium, xenon, and carbon dioxide. There were also tubes with mercury vapor and even deuterium.

We’ll admit it. Not everyone needs a spectrometer, but if you do, there’s a lot of really interesting info on how to get the most out of these cheap devices. Apparently, [Project 326] was frustrated that he couldn’t buy an X-ray spectrometer and has vowed to create one, so we’ll be interested to see how that goes.

Some homebrew spectrometers can get pretty fancy. Of course, there’s more to spectroscopy than just optics.

Continue reading “Spectroscopy On The Cheap”