Mysterious Files PH

Thursday, August 6, 2026

CNC’d, CNC-inspired Adjustable Wrench Won’t Round Your Bolts

August 06, 2026 0

We’ve probably all got one item in our toolboxes or chests that we really, really don’t like, but find too handy to toss. For [Someone Should Make That], that item was the bolt-rounding adjustable wrench. Rather than continuing to gripe about it, or alter his habits to make greater use of the full wrench set he also owns, he decided to build a better mousetrap. By mousetrap, we mean adjustable wrench.

It took a couple of iterations on-screen before he hits on a solution that seems to work quite well indeed. The problem [Someone] had with his adjustable wrench was one of physical slop: once adjusted, there’s just too much play in the mechanism, which results in rounded-off bolt heads. [Someone]’s CNC’d solution takes inspiration from the CNC machine that manufactures it: he’s using spring-loading in the adjustment screw akin to what you find in the anti-backlash nut on your CNC mill or 3D printer’s ball threads. The tension from the springs keeps the wrench tight to the bolt, and that keeps [Someone] from rounding them off. Speaking of 3D printers, he prototyped in plastic before machining, and the screw in the end product stayed that way. It would be interesting to see how well that holds up.

Not only do we appreciate that it’s solved a common problem many of us have, the ethos of “this angers me, so I shall hack it” is one we support 100%, so do give a watch unless you’re one of those people who absolutely can’t stand videos, even when they’re spring-loaded to have no slop. There’s some good tips for beginner CNC operators in there, too.

This isn’t the first time someone’s tried to reinvent this particular wheel, though the last version we liked was a ratchet.


Calculus-Free PID (Almost) in a Spreadsheet

August 06, 2026 0
Calculus-Free PID (Almost) in a Spreadsheet

PID controllers are everywhere. They regulate temperature, motor speed, power supplies, positioning systems, process equipment, and probably a dozen things within arm’s reach of you right now.

They’re also frequently explained with enough calculus to make them seem more mysterious than they really are. Granted, the I and D in PID stand for calculus terms, but they are easy enough to build into a spreadsheet. Grab a copy and keep it open while you read this post.

The Google Sheet implements a simple simulated PID controller along with a simulated process — the thing we’re trying to control. You can change the controller gains, alter the process, introduce disturbances, and watch what happens without compiling anything or wiring up a heater that might accidentally become a toaster.

The three letters in PID stand for Proportional, Integral, and Derivative. If your calculus is rusty, integral is just how much is building up over time, and the derivative is how much changed just now. Each operates on the error:

error = setpoint - process value

The setpoint is where we’d like the system to be, the process value (PV) is where it actually is, and we would obviously like the error to be zero. Proportional is the most obvious method of control. The more we are off, the more we adjust. The closer we are to the setpoint, the less proportional output we need.

Integral, on the other hand, looks at a running tally of errors. Finally, derivative measures how much things have changed from the last time we looked. The basic cycle time for the spreadsheet is set by dt, which, by default, is 0.1 seconds. Therefore, it takes ten spreadsheet rows to cover an entire second.

Suppose we’re controlling temperature and want it to be 20 degrees. If the temperature is 15, the error is +5. If it’s 22, the error is -2. Our controller’s job is to turn that error into an output. That output affects something — a heater or a motor speed or whatever — that can change the process value. So for a temperature example, the output might drive a heating resistor, and the process value is measured by a thermistor.

The PID tries to drive the heater so that the process value is as close as possible to the setpoint. To the PID algorithm, the actual units of the output and the process values are immaterial. The spreadsheet limits output from 0 to 100 and, presumably, that would be a percentage of voltage or a PWM duty cycle. The setpoint and process value might be in degrees C or F. But the algorithm doesn’t really care.

First, Just P

Make sure the Model drop-down is set to DEFAULT. We’ll begin by setting:

Kp = 4
Ki = 0
Kd = 0

Set the initial process value to 0, the setpoint to 20, the process gain to 1, and the time constant to 2 seconds. With only the proportional term operating, the controller is particularly easy to understand:

output = Kp × error

At the beginning, the error is 20, so the controller asks for an output of 80 (that is, 4 times 20). However, the process doesn’t instantly jump to 80. Our simulated plant is a first-order system implemented essentially as:

PVnew = PVold + dt/tau × (Kprocess × output - PVold)

The actual spreadsheet has extra terms for a bias and disturbance, but you’ll usually leave those at zero. That’s a useful generic model for a surprising number of real things. Turn up a heater, and the temperature approaches a new value gradually. Apply voltage to a motor and its speed doesn’t change instantaneously. Charge a capacitor through a resistor, and you’ve seen exactly this sort of exponential behavior before.

As the process value rises, the error gets smaller. Because the error gets smaller, the proportional controller reduces its output. This works. At least, mostly.

Proportional can’t quite get there.

Watch where it eventually settles. With the suggested values, the process value winds up around 16 even though our setpoint is 20. Why? At a process value of 20, the error would be zero. A proportional controller presented with zero error produces zero output. But this particular process needs an output of 20 to remain at 20. Therefore, it can’t ever quite get there.

This is the classic steady-state error of proportional-only control. We could crank Kp upward. Try Kp=8. The process gets much closer to the setpoint. But continually increasing proportional gain isn’t a universal solution. Eventually real systems start overshooting, oscillating, amplifying noise, or otherwise expressing their displeasure. We need another term.

Remember the Error

Set Kp back to 4 and try:

Ki = 0.5

The integral term looks at not just the error right now, but the error accumulated over time. In the spreadsheet there’s an Integral State column. Each row does approximately this:

integral = previous_integral + error × dt

and the I contribution becomes:

I = Ki × integral

Now consider our P controller sitting stubbornly below the desired value. As long as some positive error remains, the integral keeps growing.

That gradually increases the controller output until the remaining error disappears. Instead of settling around 16, the process now creeps all the way toward 20. This demonstrates one of the major reasons integral control exists: it eliminates persistent offset. It also gives us a good excuse to disturb the system.

Select the user process model and set User Model # to 1. This will let you disturb the process value by entering numbers into the User1 column. Leave the first bit of the User1 column at 0. But somewhere farther down the simulation, put a disturbance into that column — perhaps -5. If you are feeling especially salty, try a sequence like: 0.5, 0.75, 1, 1.5, 2, 1.5, 0.75, 0.5, -1, -1, -0.5. That sequence should already be in the template’s User1 column.
You can imagine that as opening a refrigerator door, suddenly putting a mechanical load on a motor, or connecting another load to a regulated power supply.

A proportional-only controller reacts immediately, but once things settle, it again tolerates a permanent error.

The integral controller doesn’t. If the process remains below the setpoint, integral action continues increasing until the disturbance has been compensated. That’s a powerful trick. Unfortunately, integral control has tricks of its own.

Too Much of a Good Thing

Integral action remembers errors, but memories aren’t always helpful. The derivative term responds to how rapidly the error is changing:

D = Kd × (error - previous_error) / dt

If proportional control asks, “How far away are we?”, derivative control asks, “How fast are we approaching?” Or, more precisely in this case, “How fast is the error changing?”

Make the simulated process faster by changing its time constant from 2 to about 0.8 seconds. Then try something deliberately more aggressive:

Kp = 8
Ki = 1
Kd = 0
Overshoot in user model #1

The response now gets to the setpoint quickly, but it overshoots it. The problem is easy to see in the spreadsheet. While the process is racing upward, it remains below the setpoint, so the integral continues accumulating positive error. By the time we arrive at the destination, the integral term is still pushing. Depending on the process and gains, the result may be a little overshoot, a lot of overshoot, or sustained oscillation.

Since the default plant is only first-order, derivative action doesn’t have much to work with. User Model 2 adds another lag, using the USER2 column as an intermediate process state. That produces more phase lag and makes aggressive PI tuning more prone to overshoot.

Overshoot observed in model 2.

Switch to User Model 2 and start with Kd=0. Then note the peak process value. Then try Kd=0.2, 0.5, and perhaps 1.0. Try some negative values. You will find that there is a range where the peak overshoot is reduced slightly, but keep going and the response starts to ring. Push Kd far enough, and the derivative term becomes part of the problem rather than part of the cure. The graphs autoscale, so sometimes what looks like a peak the same size (or even bigger) is really smaller than the previous result. Be sure to read the numbers.

That’s the basic PID balancing act. P reacts to the error that exists now. I reacts to error that has existed for a while. D reacts to where the error appears to be heading. Put all three together, and you have a controller that may respond strongly, eliminate steady-state error, and anticipate rapid changes. However, sometimes you are better off with, for example, just PI or even just pure proportional control. Having the algorithm in a spreadsheet form is a nice way to experiment, especially if you can model the system’s behavior.

It’s Only a Spreadsheet

You can add your own models by modifying USR_PROCESS to call your function or just modify one of the existing ones. DEF_PROCESS is just a simple lag model. USR_PROCESS0 has some random noise, while USR_PROCESS1 lets you inject a disturbance in the USER1 column. USR_PROCESS2 is like USR_PROCESS1 but has a second-order process in the USER2 column as well. Of course, real control systems are messier than these nice models.

The output may have hard limits. In fact, the spreadsheet includes minimum and maximum output clamps. This exposes another classic PID problem: integral windup. If the controller desperately requests an output of 150 but the actuator can only deliver 100, the integral can continue accumulating error even though the actuator cannot respond. When the error finally reverses, all of that stored integral has to unwind. Practical controllers frequently include anti-windup schemes to deal with this. In practical terms, imagine a thermistor gets unplugged, and the system suddenly thinks there is a giant temperature error. It will try to correct it, but it can’t. Then someone plugs the sensor back in. All the accumulated error in the integral term now has to be backed off.

Derivative action causes its own problems. The spreadsheet calculates derivative from the error, which means suddenly changing the setpoint produces a large derivative pulse — the notorious derivative kick. Real controllers often calculate derivative from the process value instead.

Of course, real measurements also contain noise. Differentiation is very good at making high-frequency noise more prominent, so the D term is commonly filtered. We aren’t doing any of those sophisticated things here, and that’s intentional. The point of the sheet is that every number is visible and to make it easy to experiment.

Change a setpoint in the middle of the Setpoint column, and you’ve generated a step input. Change one of the User columns, and you can inject a disturbance. Adjust Kp, Ki, or Kd, and you can immediately see which portions of the controller output changed and why.

To add your own models, modify USR_PROCESS and add a custom function to the SWITCH statement. Then create your custom function. If you need to grab data from the spreadsheet, you’ll see examples of using ROW() and INDIRECT() to get the right numbers. It is fairly straightforward to add motors, thermal systems, second-order plants, dead time, nonlinearities, or whatever other pathological system you’d like to inflict on your controller.

The most important lesson about PID control? There isn’t a magic set of Kp, Ki, and Kd values. A set of gains that works beautifully on one plant may be terrible on another. Change the mass, thermal capacity, load, delay, sample rate, actuator limits, or sensor characteristics and the optimum controller changes with it. Not every control job needs all three terms.

The equations fit comfortably into a few spreadsheet cells. The interesting part is figuring out what numbers to put in them.

Most of our spreadsheet hijinks center around DSP. Except for the ones that simulate computers.


Going Full Fruity with Apple’s 1999 High-End Power Mac G3

August 06, 2026 0

Back in the late 90s, Apple was definitely a pretty fruity company, with its aggressively translucent shades of colored plastic that often got described in terms of such fruit variants. Although the iMac steals a lot of the glory here, the Power Mac series and associated hardware deserves that spot in the limelight as well. Recently [Dan Wood] put together a full Power Mac G3-based setup, including the appropriate LCD monitor and other peripherals as someone with some serious disposable income back in 1999 might have owned.

Why Macs are better than PCs. (Credit: Dan Wood, YouTube)
Why Macs are better than PCs. (Credit: Dan Wood, YouTube)

Part of Steve Jobs’ return to Apple, the Power Macintosh G3 debuted first in basically recycled beige enclosures from previous Macintosh systems before its second generation introduced the Blue and White version, as it was officially called. This dazzling style was carried through in the peripherals, with pin stripes, translucent plastic and a distinct absence of sharp corners or edges.

As for what you get in these colorful Power Mac G3s, a 300 to 450 MHz CPU, an official memory limit of 192 MB and perhaps the most user-friendly way to access the logic board to upgrade and install components with the folding lid. Something which had PC users with sharp edged cases and plentiful blood sacrifices to the PC gods somewhat steaming in jealousy.

For the time these Power Mac G3s didn’t just look fetching, they also were quite powerful. Something which came at a pretty hefty price tag, of course. The 400 MHz model that [Dan] got his paws on would have cost around $2,000 back in 1999, or closer to $4,000 clams today. The active-matrix TFT LCD screen would have been cutting edge as well, with a similar cutting edge price tag.

Released before OS X this system runs Mac OS 8.6, though it can run OS X 10.4 (Tiger) which unlocks more software options and of course the transition a proper multi-tasking OS. This particular system was apparently used for graphics design until 2010 based on the files on the HDD. As demonstrated in the video, the system is still quite usable, even in 2026, thanks to all the software available online.


Wednesday, August 5, 2026

Addressable LEDs Make Giant 16×2 Character Display

August 05, 2026 0

We’ve always taken a certain childlike joy in seeing tiny things made big, and big things tiny. Evidently [Uncle Stem] is the same way, if this 7x sized 16×2 “LCD” display is any indicator.

“LCD” is in scare quotes there, because while the original display is a character LCD, [Uncle Stem]’s embigginated recreation is not. Liquid crystal displays are beyond all but the most dedicated DIYers, so [Stem] recreated the whole thing with addressable LEDs instead — over a thousand of them. Each character got its own PCB, and rather than pay for assembly [Stem] used a 3D printed stencil to help apply solder paste, an idea we’ve seen before. His choice of long lengths of nickle strip — the stuff you spot weld to Li-ion batteries — to join the LED-holding PCBs is also worth noting.

In order to get his giant display to act like the I2C-operated module he loves, [Uncle Stem] equipped it with an RP2040 pre-programmed with the LCD character set. That way he can plug it into any Arduino project that uses the LiquidCrystal_I2C library and have the authentic 1602 experience. The green “PCB” the display is mounted to is actually laser-cut plywood, while some acrylic sits in front of his PCBs with office paper to act as as a diffuser. A 3D printed frame completes the illusion. He even goes so far as to replicate the pin headers at 7:1 scaling with brass rods.

He also connects it to a over-sized Arduino, with giant jumper wires. But for the record, not the giant Arduino we featured previously. Like we said, hackers like to mess with scale, and we’ve seen everything from giant benchies to a working Mac Classic for Barbie.


FLOSS Weekly Episode 878: A Tool With Opinions

August 05, 2026 0

This week Jonathan chats with Jonathan Pallant about embedded Rust! Learn about the growing Rust driver library, the different ways to build a Rust stack on an embedded device, and how the opinionated tooling can make you a better programmer!

Did you know you can watch the live recording of the show right on our YouTube Channel? Have someone you’d like us to interview? Let us know, or have the guest contact us! Take a look at the schedule here.

Direct Download in DRM-free MP3.

If you’d rather read along, here’s the transcript for this week’s episode.


Theme music: “Newer Wave” Kevin MacLeod (incompetech.com)

Licensed under Creative Commons: By Attribution 4.0 License


Know Your Food: Our Daily Bread

August 05, 2026 0
Know Your Food: Our Daily Bread

It’s time to return to our no-punches-pulled look at food manufacture, and this time we’re looking at the humble loaf of bread. As before, we’re approaching the subject with a look at breadmaking both in the traditional sense that marketing people would like you to imagine, and in the modern sense of the loaf you’ll find on your supermarket shelf.

A Food Of Great Cultural Significance

An ancient Egyptian relief, showing stylised figures at work on a variety of baking tasks.
An ancient Egyptian bakery, depicted in the reign of Ramesses III. Scanned by Peter Isotalo, CC BY-SA 4.0.

Perhaps there are few foods with as much cultural significance as bread. If your distant ancestors took the path of growing grain as their major subsistence carbohydrate, the chances are there will be some form of bread woven into your identity. Where this is being written for example were I to head for the cathedral of a Sunday morning I would recite the Lord’s Prayer as part of the service, Give us this day our daily bread. Whether your culture leavens its bread or not, or whatever grain it uses, the chances are that there will be something similar about the humble foodstuff within it.

Sitting in a coffee shop writing this a few streets away from that cathedral in a British county town, the bread here is made from wheat flour and leavened using yeast. I’d hazard a guess that it’s the loaf most of you reading this will find at your local store, and with apologies to people whose bread takes a different form it’s the bread I’ll be examining here. It’s the loaf the wheat fields where I grew up supply grain for, so it’s the one whose production I’m most familiar with.

The Ideal Bread, At Least For The Adverts

A baker stands next to the opening of his oven, a fresh loaf of bread on his paddle. In the foreground is a stack of loaves.
We all want our bread to come from a bakery like this one in Malta. Noport, CC BY-SA 4.0.

Advertising for bread is steeped in a tradition both real and imaginary, but behind the image does lie an artisan past. Very few English villages did not have a mill or a baker, whether the stone grinding wheels were driven by water or wind. The bread would have been made in much the same way as you’d make it in your 21st century kitchen, with the flour being mixed with water to a dough, before being slowly proved and leavened using a yeast culture, and baked. The oven would have been a wood-fired domed clay or brick affair rather than a gas or electric device, and perhaps our artisan baker of yore wouldn’t have used a neat rectangular tin, but the final product would be something you’d recognise.

You can still buy artisan bread made this way and it’s a fine product, but despite the industry leaning heavily on such imagery the loaf in your supermarket is not quite the same. This is not a judgement on its quality but a statement on the technological advancement that has given us an affordable, consistent, and often high quality mass produced product.

First, Chase The Ingredients

A green and white Claas combine harvester at work.
These things are the symphony of my summer. Reinhold Möller, CC BY-SA 4.0.

So to start with 21st century bread making, we need to stand in an Oxfordshire field like the one surrounding where I grew up. It’s the end of July, so the wheat is being harvested. The field will be part of a crop rotation scheme, so it may have had canola, beans, or any of a number of other crops grown in it the previous year. The wheat may be so-called hard wheat, usually a winter wheat with a high gluten content planted last autumn, or depending on the bread process it can be a spring-planted variety with a lower gluten content.

The wheat will be stored by the farmer in a silo until the best price can be had for it, then once sold it goes to a mill. A modern industrial mill rather than the rustic watermill of our previous description, but the principle is the same. The grain may be moistened to aid the separation of its outer husk, and then it’s passed through sets of rollers to grind it. This results in a flour, but it’s not the flour you buy, nor is it the flour that goes into your bread.

A cross section of a wheat seed, with nutritional information.
A wheat seed, in fine detail. Jon C, CC BY-SA 3.0.

A single piece of grain, a wheat seed, is loosely comprised of three components. The endosperm is the white flour portion you may recognise, the wheatgerm is the embryo, the part of the grain which germinates, and the outer husk is referred to as bran. The raw flour is wholewheat flour and you can bake with it, but it has the problem of a limited shelf life as the wheatgerm will spoil after milling if left. This the three components are separated, and the wheatgerm is heat treated to render it inert. The flour used for baking bread is thus compounded from these components to the formulation required, along with a set of additives to preserve it, improve its baking qualities, or add vitamins and nutrients. For a flour to be referred to as wholemeal its proportions of these components are defined by law, at least where this is being written.

The other major bread ingredient is yeast, which for a modern baker is a carefully maintained monoculture of a yeast strain selected for best performance in baking. The traditional method of farming a yeast strain is something we had a look at back in the pandemic when there was a shortage of the stuff, and its industrial equivalent is a much more sterile and scientifically controlled version of the same thing. It will arrive at the baker not as the dried yeast you’ll pick up at the supermarket but as a damp paste, which will be activated by dissolving it in a sugar solution.

A Loaf That’s Better Bread

For a traditional or specialty style bread then, the baker will take a compounded strong flour and fresh yeast, and follow a surprisingly similar process to that of the rustic baker mentioned earlier. The equipment will be stainless steel and the quantities may be greater, but our baker from the past would recognise it. It makes lovely bread, and you have no doubt enjoyed it in your time.

A loaf od sliced brown bread, cascading from its bag onto a plate.
The Chorleywood loaf in the kitchen chez List as this is being written.

The more mundane loaves in your supermarket though, are not made in quite the same way. They take flour and yeast and make a leavened dough just as with a traditional loaf, but the process is very different indeed. The Chorleywood process, named after the town hosting the research institution where it was invented, is a high-speed baking process designed to use a wheat with a much lower gluten content than traditional bread. The problem facing the mid-20th-century researchers who created it was that the UK’s climate and agriculture isn’t suitable for growing the quantities of hard wheat its bread market demanded. Their innovation was to replace the leavening and proving of the traditional bakery with high-speed mechanical mixing, which since some of the gluten is broken down in the traditional fermentation, requires less gluten. The result is an extremely fast industrial process that produces an extremely consistent light and fluffy bread, and over the last three quarters of a century it has become the dominant loaf. It’s likely that wherever you are, a similar process tailored to your country is also responsible for most of your bread.

So you now know a little about where your daily bread comes from, and how it is made. As is usual for this series, it’s now time to look at the various claims and controversies surrounding the modern loaf, which can sometimes even take on a political dimension. Is the nutritional value of a supermarket load less than that of an artisan loaf made by that village baker? This is a question which has caused some considerable controversy over the years.

As we said earlier, modern flour is a refined and processed product whether it’s wholemeal or bleached white, and a process such as the Chorleywood one is designed to make a loaf from a cheaper ingredient. It’s then not unreasonable to suppose that the artisan loaf might be a better product, and in the sense of flavours and textures imparted by the traditional process you would probably be right to take that view. An artisan loaf is a high quality culinary experience.

But from the nutritional perspective it becomes a much less clear-cut assessment, because while a true artisinal loaf contains all the nutrients of the raw grain, the formulated flour used by the industrial baker has its nutrition precisely controlled. If the recipe uses a high-nutrition flour then the resulting bread has a high nutritional value, and since at least where this is being written such things are regulated, you can eat a Chorleywoord loaf with confidence that it’s not a nutritional desert.

As a parting thought I’d say this: eat the highest quality bread you can, support artisan producers if you can, you’ll eat some really nice bread. But don’t worry too much about the cheaper stuff, it’s only cheaper because it’s mass-produced, not because it’s worse for you.


Reading a Thermocouple with Mercury and a Potentiometer

August 05, 2026 0
A man's hand is shown adjusting a black Bakelite dial on the front panel of an instrument. The instrument is contained in a wooden box, and to the left of the box, a thermocouple is inserted into the flame of an alcohol burner.

If you’ve ever thought about the nomenclature of electrical components, potentiometer stands out as a strange name, etymologically suggesting something like a voltmeter. In fact, the component took its name from a voltage-measuring instrument also named the potentiometer. [Alnwlsn] recently took a look at one such device, which was integrated into a thermometer, and the Weston cell used to calibrate it.

The potentiometer (instrument) has a galvanometer at its heart. One side of the galvanometer is connected to the center lead of a potentiometer (component) which spans a voltage source; the other side is connected to a reference voltage. The potentiometer can be adjusted until no current flows through the galvanometer, at which point both sides match the reference voltage. The reference voltage source can then be replaced with some other source, which can then be measured relative to the reference by adjusting the potentiometer until both the voltages match. The reference voltage source is a Weston cell, which uses two mercury electrodes, one amalgamated with cadmium, to produce a stable 1.018 volt reference; despite being 74 years old, this particular cell still measured at 1.017 volts.

In this case, the potentiometer was made to measure the voltage produced by a thermocouple. After calibrating the potentiometer and connecting an iron-constantan thermocouple, [Alnwlsn] tested it with ice and boiling water, and in each case it proved accurate. In a more extreme test, it captured the temperature difference between the base and the tip of an alcohol flame.

For a bit more on the history of similar devices, check out the history of Weston Electrical Instruments.

Thanks to [PeterF] for the tip!