Emulate ICs In Python

Most people who want to simulate logic ICs will use Verilog, VHDL, or System Verilog. Not [hsoft]. He wanted to use Python, and wrote a simple Python framework for doing just that. You can find the code on GitHub, and there is an ASCII video that won’t embed here at Hackaday, but which you can view at ASCIInema.

Below the break we have an example of “constructing” a circuit in Python using ICemu:

Continue reading “Emulate ICs In Python”

Building A Working Game Of Tetris In Conway’s Game Of Life

If you haven’t been following along with Conway’s Game of Life, it’s come a long way from the mathematical puzzle published in Scientific American in 1970. Over the years, mathematicians have discovered a wide array of constructs that operate within Life’s rules, including many that can be leveraged to perform programming functions — logic gates, latches, multiplexers, and so on. Some of these creations have gotten rather huge and complicated, at least in terms of Life cells. For instance, the OTCA metapixel is comprised of 64,691 cells and has the ability to mimic any cellular automata found in Life.

A group of hackers has used OTCA metapixels to create a Tetris game out of Life elements. The game features all 7 shapes as well as the the movement, rotation, and drops one would expect. You can even preview the next piece. The game is the creation of many people who worked on individual parts of the larger program. They built a RISC computer out of Game of Life elements, as well as am assembler and compiler for it, with the OTCA metapixels doing the heavy lifting. (The image at the top of the post is the program’s data synchronizer.

Check out the project’s source code on GitHub, and use this interpreter. Set the RAM to 3-32 and hit run.

For a couple of other examples of Life creations, check out the Game of Life clock and music synthesized from Life automata we published earlier.

InstantCAD Promises Faster Iterative Design

The design process for any product is necessarily an iterative one. Often, a prototype is modelled or built, and changes are made to overcome problems and improve the design. This can be a tedious process, and it’s one that MIT’s CSAIL has sought to speed up with InstantCAD.

The basic idea is integrating analysis tools as a plugin within already existing CAD software. A design can be created, and then parametrically modified, while the analysis updates on screen in a near-live fashion. Imagine modelling a spanner, and then dragging sliders to change things like length and width while watching the stress concentrations change in real time. The tool appears to primarily be using some sort of finite element analysis, though the paper also shows examples of analyzing fluid flows as well.

The software is impressive, however there are caveats. Like any computer analysis, serious verification work must be undertaken to ensure its validity. We suspect that there may be issues with more complex geometries that lead to inaccurate simulation. It’s not the sort of tool you’d use for anything that puts life and limb at risk, but we can see it having great uses for designing basic objects when you want to quickly gain an idea of what sort of effect certain parameter changes will have.

The other main disappointment is that while this tool looks great, it doesn’t appear to be publicly available in any form. Whether this is due to universities and complicated IP requirements or the potential for future commercialization is anyone’s guess. Regardless, you can read the conference paper here or check out the video below. Or you could read up on the applications of finite element analysis to 3D printer slicers, too.

Continue reading “InstantCAD Promises Faster Iterative Design”

OpenEMS Makes Electromagnetic Field Solving… Merely Difficult

To ordinary people electronics is electronics. However, we know that the guy you want wiring your industrial furnace isn’t the guy you want designing a CPU. Neither of those guys are likely to be the ones you want building an instrumentation amplifier. However, one of the darkest arts of the electronic sects is dealing with electromagnetic fields. Not only is it a rare specialty, but it requires a lot of high-powered math. Enter OpenEMS, a free and open electromagnetic field solver.

We would like to tell you that OpenEMS makes doing things like antenna analysis easy. But that’s like saying Microsoft Word makes it easy to write a novel. In one sense, yes, but you still need to know what you are doing. In fairness, though, the project does provide a good set of tutorials, ranging from a simple wave guide to a sophisticated phased array of patch antennas. Our advice? Start with the waveguide and work your way up from there.

The software uses Octave or MATLAB for scripting, plotting, and support. You can download it for Windows or Linux.

If you want to start with something more intuitive for electromagnetic field visualization, this might help. If you prefer your models more concrete and less abstract, perhaps you should work at Lincoln Lab.

Simulating The Learn-by-Fixing CPU

Last time I looked at a simple 16-bit RISC processor aimed at students. It needed a little help on documentation and had a missing file, but I managed to get it to simulate using a free online tool called EDA Playground. This time, I’ll take you through the code details and how to run the simulation.

You’ll want to refer to the previous post if you didn’t read it already. The diagrams and tables give a high-level overview that will help you understand the files discussed in this post.

If you wanted to actually program this on a real FPGA, you’d have a little work to do. The memory and register initialization is done in a way that works fine for simulation, but wouldn’t work on a real FPGA. Anyway, let’s get started!

Continue reading “Simulating The Learn-by-Fixing CPU”

Desktop Factory Teaches PLC Programming

How to train young engineers in industrial automation is a thorny issue. Most factories have big things that can do a lot of damage and cost tons of money if the newbie causes a crash. Solution: shrink the factory down to desktop size and let them practice on that.

Luckily for [Vadim], there’s an off-the-shelf solution for miniaturizing factory automation: FischerTechnik industrial training models. The models have motors, conveyors, pneumatic cylinders, and sensors galore, but the controller is not exactly the industry standard programmable logic controller (PLC). [Vadim] set out to remedy this by building an interface between the FischerTechnik models and a Siemens PLC. He went through a couple of revisions of his board, including one using rivets from the sewing store to interface with the FischerTechnic connectors. Eventually, he settled on more robust connectors and came up with a board that lets students delve into PLC programming without killing anyone. The video below shows it going through its paces; we can only imagine where playing with these kits as a kid would have led us.

As great as [Vadim]’s system is for training engineers, we can also see it helpful in getting kids interested in a career in industrial automation. We recently covered a similar effort to show kids big science using LEGO Mindstorms. Both of these can help get STEM kids to see the wider world of technical careers and perhaps steer them into automation. After all, the people who make the robots are probably going to be the last ones obsoleted, right?

Continue reading “Desktop Factory Teaches PLC Programming”

Learn Neural Network And Evolution Theory Fast

[carykh] has a really interesting video series which can give a beginner or a pro a great insight into how neural networks operate and at the same time how evolution works. You may remember his work creating a Bach audio producing neural network, and this series again shows his talent at explaining the complex topic so anyone may understand.

He starts with 1000 “creatures”. Each has an internal clock which acts a bit like a heart beat however does not change speed throughout the creature’s life. Creatures also have nodes which cause friction with the ground but don’t collide with each other. Connecting the nodes are muscles which can stretch or contract and have different strengths.

At the beginning of the simulation the creatures are randomly generated along with their random traits. Some have longer/shorter muscles, while node and muscle positions are also randomly selected. Once this is set up they have one job: move from left to right as far as possible in 15 seconds.

Each creature has a chance to perform and 500 are then selected to evolve based on how far they managed to travel to the right of the starting position. The better the creature performs the higher the probability it will survive, although some of the high performing creatures randomly die and some lower performers randomly survive. The 500 surviving creatures reproduce asexually creating another 500 to replace the population that were killed off.

The simulation is run again and again until one or two types of species start to dominate. When this happens evolution slows down as the gene pool begins to get very similar. Occasionally a breakthrough will occur either creating a new species or improving the current best species leading to a bit of a competition for the top spot.

We think the series of four short YouTube videos (all around 5 mins each) that kick off the series demonstrate neural networks in a very visual way and make it really easy to understand. Whether you don’t know much about neural networks or you do and want to see something really cool, these are worthy of your time.

Continue reading “Learn Neural Network And Evolution Theory Fast”