Using Statistics Instead Of Sensors

Statistics often gets a bad rap in mathematics circles for being less than concrete at best, and being downright misleading at worst. While these sentiments might ring true for things like political polling, it hides the fact that statistical methods can be put to good use in engineering systems with fantastic results. [Mark Smith], for example, has been working on an espresso machine which can make the perfect shot of coffee, and turned to one of the tools in the statistics toolbox in order to solve a problem rather than adding another sensor to his complex coffee-brewing machine.

To make espresso, steam is generated which is then forced through finely ground coffee. [Mark] found that his espresso machine was often pouring too much or too little coffee, and in order to improve his machine’s accuracy in this area he turned to the linear regression parameter R2, also known as the coefficient of determination. By using a machine learning algorithm tuned to this value, which assesses predictable variation in a data set, a computer can more easily tell when the coffee begins pouring out of the portafilter and into the espresso cup based on the pressure and water flow in the machine itself rather than using some other input such as the weight of the cup.

We have seen in the past how seriously [Mark] takes his coffee-making, and this is another step in a series of improvements he has made to his equipment. In this iteration, he has additionally produced a simulation in JupyterLab to better assist him in modeling the system and making even more accurate predictions. It’s quite a bit more effort than adding sensors, but since his espresso machine already included quite a bit of computing power it’s not too big a leap for him to make.

Hacked GDB Dashboard Puts It All On Display

Not everyone is a fan of GUI interfaces. But some tasks really lend themselves to something over a bare command line. Very few people enjoy old command line text editors like edlin or ed. Debugging is another task where showing source files and variables at all times makes sense. Of course, you don’t absolutely have to have a GUI per se. You can also use a Text User Interface (TUI). In fact, you can build gdb — the GNU Debugger — with a built-in TUI mode. Try adding –tui to your gdb command line and see what happens. There are also many GUI frontends for gdb, but [cyrus-and] has an easy way to get a very useful TUI-like interface to gdb that doesn’t require rebuilding gdb or even hacking its internals in any way.

The secret? The gdb program runs a .gdbinit file on startup. By using Python and some gdb commands, [cyrus-and] causes the debugger to have a nice dashboard interface for your debugging sessions. If you install a helper script, you can even get syntax highlighting.

The system uses modules and you can even add your own custom modules and commands, if you like. You can also control what modules appear on each dashboard display. Normally, the dashboard shows when the program stops. For example, on each breakpoint. However, gdb has a hook system that allows you to trigger a dashboard using the appropriately-named dashboard command on other commands, too. Using the layout option to the dashboard command, you can even trigger different modules at different times.

Installation is simple. Just put the .gdbinit file in your home directory. If you want syntax highlights, you need to install Pygments, too. We understand you can even use his under Windows, if you like.

We don’t always take full advantage, but gdb is actually amazing. The flexible architecture makes all sorts of interesting things possible.

A Macintosh-inspired desk ornament, next to a sceenshot of a classic Macintosh computer desktop

‘Desk Accessory’ Pays Homage To Macintosh

The retrocomputing community are experts at keeping vintage Apple iron running, but if you’re looking for a simpler way to pay homage to the original Mac, check out this Raspberry Pi powered ‘desk accessory’ by [John Calhoun], fittingly called ‘SystemSix’.

Housed inside a delightfully Mac-shaped piece of laser-cut acrylic, SystemSix is powered by as Raspberry Pi 3, with the graphics displayed on a sizeable 5.83″ e-ink panel. While it resembles a kind of retro-futuristic take on the ‘classic’ Macintosh, SystemSix is the illusion of a fully interactive computer. While non-interactive, the fake desktop is every bit as charming as a real Macintosh display, albeit scaled down. The desktop updates automatically with new information, and presently includes a calendar, dithered lunar phase graphic, and a local weather report.

Clearly calling it a ‘desk accessory’ is a neat play on words. The original Macintosh implemented simple desk accessory programs, such as the calculator and alarm clock, that could run alongside the main application in memory. This was the only way to run more than one application on the Macintosh, before MultiFinder added rudimentary cooperative multitasking in 1987. As such, SystemSix is a functional, stylish and quite literal ‘desk accessory’.

[John] has the full project write-up over on GitHub, and goes into great detail about maintaining the Macintosh aesthetic. For example, the lunar phase graphic uses ‘Atkinson’ dithering. This technique was pioneered by Apple programmer Bill Atkinson, the author of MacPaint and the QuickDraw toolbox on the original Macintosh (and later, Hypercard).

And in case you were wondering – yes, this is the [John Calhoun], who programmed Glider for Macintosh. Now recently retired from Apple, we’re really excited to see what other Macintosh-inspired creations he comes up with. Maybe he will come back around to his Mac-powered MAME cabinets that we covered all the way back in 2005. Or perhaps a sleeper battlestation, like the iMac G4 lampshade that was upgraded with an M1 processor.

 

 

Keep Tabs On Asteroids With Asteroid Atlas

Keeping tabs on the night sky is an enjoyable way to stay connected to the stars, and astronomy can be accessible to most people with a low entry point for DIY telescopes. For those who live in areas with too much light pollution, though, cost is not the only issue facing amateur astronomers. Luckily there are more ways to observe the night sky, like with this open source software package from [elanorlutz] which keeps tabs on all known asteroids.

The software is largely based on Python and uses a number of databases from NASA to allow anyone with a computer to explore various maps of the solar system and the planetary and non-planetary bodies within it. Various trajectories can be calculated, and paths of other solar system bodies can be shown with respect to an observer in various locations. Once the calculations are made in Python it is able to export the images for use in whichever image manipulation software you prefer.

The code that [elanorlutz] has created is quite extensive and ready to use for anyone interested in tracking comets, trans-Neptunian objects, or even planets and moons from their own computer. We would imagine a tool like this would be handy for anyone with a telescope as well as it could predict locations of objects in the night sky with accuracy and then track them with the right hardware.

Talking To A Texas Instruments Calculator

Texas Instruments is a world-class semiconductors company, but unfortunately what they are best known for among the general public is dated consumer-grade calculators thanks to entrenched standardized testing. These testing standards are so entrenched, in fact, that TI has not had to update the hardware in these calculators since the early 90s. They still run their code on a Z80 microcontroller, but [Ben Heck] found himself in possession of one which has a modern ARM coprocessor in it and thus can run Python.

While he’s not sure exactly what implementation of Python the calculator is running, he did tear it apart to try and figure out as much as he could about what this machine is doing. The immediately noticeable difference is the ARM coprocessor that is not present in other graphing calculators. After some investigation of test points, [Ben] found that the Z80 and ARM chips are communicating with each other over twin serial lines using a very “janky” interface. Jankiness aside, eventually [Ben] was able to wire up a port to the side of the calculator which lets him use his computer to send Python commands to the device when it is in its Python programming mode.

While there are probably limited use cases for 1980s calculators to run Python programs, we can at least commend TI for attempting to modernize within its self-built standardized testing prison. Perhaps this is the starting point for someone else to figure out something more useful to put these machines to work with beyond the classroom too. We’ve already seen some TI-84s that have been modified to connect to the Internet, for example.

Thanks to [Nikša] for the tip!

Continue reading “Talking To A Texas Instruments Calculator”

Wordle bot

Solving Wordle By Adding Machine Vision To A 3D Printer

Truth be told, we haven’t jumped on the Wordle bandwagon yet, mainly because we don’t need to be provided with yet another diversion — we’re more than capable of finding our own rabbit holes to fall down, thank you very much. But the word puzzle does look intriguing, and since the rules and the interface are pretty simple, it’s no wonder we’ve seen a few efforts like this automated Wordle solver crop up lately.

The goal of Wordle is to find a specific five-letter, more-or-less-common English word in as few guesses as possible. Clues are given at each turn in the form of color-coding the letters to indicate whether they appear in the word and in what order. [iamflimflam1]’s approach was to attach a Raspberry Pi camera over the bed of a 3D printer and attach a phone stylus in place of the print head. A phone running Wordle is placed on the printer bed, and Open CV is used to find both the screen of the phone, as well as the position of the phone on the printer bed. From there, the robot uses the stylus to enter an opening word, analyzes the colors of the boxes, and narrows in on a solution.

The video below shows the bot in use, and source code is available if you want to try it yourself. If you need a deeper dive into Wordle solving algorithms, and indeed other variant puzzles in the *dle space, check out this recent article on reverse engineering the popular game.

Continue reading “Solving Wordle By Adding Machine Vision To A 3D Printer”

Bend Your Vase Mode Prints By Hacking The GCode

[Stefan] from CNCKitchen wanted to make some bendy tubes for a window-mountable ball run, and rather than coming up with some bent tube models, it seemed there might be a different way to achieve the desired outcome. Starting with a simple tube model designed to be quickly printed in vase mode, he wrote a Python script which read in the G-Code, and modified it allow it to be bent along a spline path.

Vase mode works by slowly ramping up the Z-axis as the extruder follows the object outline, but the slicing process is still essentially the same, with the object sliced in a plane parallel to the bed. Whilst this non-planar method moves the Z-axis in sync with the horizontal motion (although currently limited to only one plane of distortion, which simplifies the maths a bit) it is we guess still technically a planar solution, but just an inclined plane. But we digress, non-planar in this context merely means not parallel to the bed, and we’ll roll with that.

[Stefan] explains that there are quite a few difficulties with this approach. The first issue is that on the inside of the bend, the material flow rate needed to be scaled back to compensate. But the main problem stems from the design of the extruder itself. Intended for operating parallel to the bed, there are often a few structures in the way of operating at an angle, such as fan mounts, and the hotend itself. By selecting an appropriate machine and tweaking it a bit, [Stefan] managed to get it to work at angles up to 30 degrees off the horizontal plane. One annoyance was that the stock nozzle shape of his E3D Volcano hotend didn’t lend itself to operating at such an inclination, so he needed to mount an older V6-style tip with an adapter. After a lot of tuning and fails, it did work and the final goal was achieved! If you want to try this for yourselves, the code for this can be found on the project GitHub.

If you want to learn more about non-planar printing, we’ve covered the process of non-planar slicing a while back, and if you think your 2.5D printer doesn’t quite have the range for really funky print paths, then you may want to look into a robot arm based printer instead.

Continue reading Bend Your Vase Mode Prints By Hacking The GCode”