Hackaday Links Column Banner

Hackaday Links: February 26, 2023

It’s probably safe to say that most of us have had enough of the Great Balloon Follies to last the rest of 2023 and well beyond. It’s been a week or two since anything untoward was spotted over the US and subsequently blasted into shrapnel, at least that we know of, so we can probably put this whole thing behind us.

But as a parting gift, we present what has to be the best selfie of the year — a photo by the pilot of a U-2 spy plane of the balloon that started it all. Assuming no manipulation or trickery, the photo is remarkable; not only does it capture the U-2 pilot doing a high-altitude flyby of the balloon, but it shows the shadow cast by the spy plane on the surface of the balloon.

The photo also illustrates the enormity of this thing; someone with better math skills than us could probably figure out the exact size of the balloon from the apparent size of the U-2 shadow, in fact.

Continue reading “Hackaday Links: February 26, 2023”

OpenSPICE: A Portable Python Circuit Simulator

[Roman Parise] and [Georgios Is. Detorakis] have created OpenSPICE a fork of the PySpice project, adding a new simulation engine written entirely in Python. This enables the same PySpice simulations to be executed on any platform that runs python (which we reckon is quite a few!) whilst leveraging the full power of the python infrastructure. Since it is a fork — for supported platforms — you can also run your simulations upon Ngspice as well as Xyce, giving options for scaling up to larger systems when required, but importantly without having to recreate your circuit from scratch.

The OpenSPICE simulator first converts the parsed netlist into a set of data structures that represent the equations describing the various parts of the system. These are then in turn passed along the scipy library “optimize.root” function which solves the system, generating a list of branch currents and node voltages. The output of the simulation is a numpy array, which can be further processed and visualized with the mathplotlib library. All pretty standard stuff in python circles. Since this is based upon PySpice, it’s also possible to use KiCAD netlists, so you have a nice way to enter those schematics. We’ve not dug into this much yet, but support for the vast libraries of spice models out there in circulation would be high up on our wish list if it already can’t handle this. This scribe will most definitely be checking this out, as LTSpice whilst good, is a bit of a pain to use and does lack the power of a Python backend!

Continue reading “OpenSPICE: A Portable Python Circuit Simulator”

Microsoft’s New Simulator Helps Train Drone AIs

Testing any kind of project in the real world is expensive. You have to haul people and equipment around, which costs money, and if you break anything, you have to pay for that too! Simulation tends to come first. Making mistakes in a simulation is much cheaper, and the lessons learned can later be verified in the real world. If you want to learn to fly a quadcopter, the best thing to do is get some time behind the sticks of a simulator before you even purchase anything with physical whirly blades.

Oddly enough, the same goes for AI. Microsoft built a simulation product to aid the development of artificial intelligence systems for drones by the name of Project AirSim. It aims to provide a comprehensive environment for the testing of drone AI systems, making development faster, cheaper, and more practical.

Continue reading “Microsoft’s New Simulator Helps Train Drone AIs”

Hackaday Links Column Banner

Hackaday Links: July 17, 2022

Webb’s first deep-field image. Source: NASA

The folks at NASA are taking a well-deserved victory lap this week after the splashy reveal of the first scientific images from the James Webb Space Telescope. As we expected, the first public release included a lot of comparisons to images obtained from Hubble, as the general public understandably sees Webb as the successor to the venerable space telescope, now in its third decade of service. So for a “let’s see what this baby can do” image, they turned Webb loose on a tiny patch of sky in the southern hemisphere containing galactic cluster SMACS 0723, and sent back images and spectroscopic data from galaxies up to 13 billion light years away. There are plenty of analyses of Webb’s deep field and the other images in the first release, but we particularly liked the takes by both Anton Petrov and Dr. Becky. They both talk about the cooler scientific aspects of these images, and how Webb is much more than just a $10 billion desktop image generator.

Continue reading “Hackaday Links: July 17, 2022”

Can You Help NASA Build A Mars Sim In VR?

No matter your project or field of endeavor, simulation is a useful tool for finding out what you don’t know. In many cases, problems or issues aren’t obvious until you try and do something. Where doing that thing is expensive or difficult, a simulation can be a low-stakes way to find out some problems without huge costs or undue risks.

Going to Mars is about as difficult and expensive as it gets. Thus, it’s unsurprising that NASA relies on simulations in planning its missions to the Red Planet. Now, the space agency is working to create a Mars sim in VR for training and assessment purposes. The best part is that you can help!

Continue reading “Can You Help NASA Build A Mars Sim In VR?”

A PNG Based Circuit Simulator

We’re sure thousands of hours have been spent in Minecraft implementing digital logic. Inspired by that, [lynnpepin] created a digital logic simulator named Reso that is based on pixels rather than voxels.

There are a few clever things here. First, different colors represent different parts. There are three different colors of wire, output and input wires, XOR gates, and AND gates. OR gates are just output wires, which or all the input wires together. By implementing these gates, Reso is, by definition, Turing complete. Since it’s just a PNG, it is trivial to open it up in GIMP and copy and paste one bit of the circuit multiple times. The different color wires are mainly to help route in a 2d plane, as you don’t have vias. Currently, the image compiles into a graph that is executed. [Lynn] chose code readability and ease of prototyping over premature optimization, so the code isn’t particularly fast. But it is pretty fun, squinting at the pixels that make up the adders and clocks he has on his blog. After giving Reso your image, it outputs a series of images that enumerate the state for several states.

The code is available on Github, and a Rust version has already been written that offers some impressive speed improvements at the expense of not being at feature parity yet. If MS-Paint isn’t your IDE of choice, perhaps a more Javascript-based digital logic simulator might be more to your taste.

The threeboard simulator running

Threeboard: Short On Keys, Long On Documentation

As peripherals go, few are hacked on more than keyboards. The layouts, the shapes, the sizes, materials, and even the question of what a keyboard is are all on the table for tinkering. In that vein, [TaylorConor] released his simplified keyboard called the threeboard on GitHub, having only three keys and replicating a full keyboard.

We’ve covered keyboards built with chording in mind, wrapped around coffee cups, and keyboards with joysticks for added speed. So why cover this one? What makes it different? The execution is superb and is a great example to look at next time you’re making a project you want to show off. The keyboard is just three mechanical switches, two 8-bit binary displays (16 LEDs total), three status LEDs, and three LEDs showing the current layer (four layers). The detailed user’s manual explains it all. There is a reliable Atmega32U4 microcontroller and two EEPROM chips at its heart.

Where this project shows off is the testing. It has unit tests, simulated integration tests, and simulated property tests. Since all the code is in C++, unit testing is relatively straightforward. The integration and property tests are via a simulator. Rather than recompiling the code with some new flags, he uses the simavr AVR simulator, which means it simulates the same binary file that gets flashed onto the microcontroller. This approach means the design is tested and debugged via GDB. It’s an incredible technique we’d love to see more of in hobby projects. Marketing speak might call this a “digital twin” but the idea is that you have a virtual version that’s easier to work on and has a tighter iteration loop while being as close as possible to the physical version.

[TaylorConor’s] goal was to create a from-scratch microcontroller project with easy-to-read code, fantastic documentation, and best practices. We think he nailed it. So feel free to run the simulator or jump right into building one for yourself. All the hardware is under a CERN-OHL-P license, and the firmware is under GPLv3.