A RPI HAT For Synchronized Measurements

A team from the Institute for Automation of Complex Power System (ACS) at RWTH Aachen University have been working for a while on the analysis of widely distributed power systems. In a drive to move away from highly specialised (and expensive) electronics platforms, they have produced some instrumentation designed to operate with the Raspberry Pi platform, and an open source software stack. They call the platform the SMU (Synchronised Measurement Unit.) The SMU consists of a HAT sitting on an RPi3, inside a 3D printed box that is intended to attach to a DIN rail. After all, this is supposed to be an industrial platform.

Hardware wise, the star of the show is the Texas Instruments ADS8588S which is a 16-bit 8-channel simultaneous sampling ADC. This is quite a nice device, with 200 kSPS throughput and a per-channel programmable front end, packaged in a hacker-friendly 64-pin QFP. What makes this project interesting however, is how they solved the problem of controlling the sampled data acquisition and synchronisation.

1-PPS and BUSY edges converted to levels, then OR’d to trigger the DMA

By programming the ADC into byte-parallel mode, then using the BCM2837 Secondary Memory Interface (SMI) block together with the DMA, samples are transferred into memory with minimal CPU overhead. An onboard U-Blox Max-M8 GNSS module provides a 1PPS (top of second pulse) signal, which is combined with the ADC busy signal in a very simple manner, enabling both sample rate control as well as synchronisation between multiple units spread out in an installation. They reckon they can get synchronisation to within 180 ns of top-of-second, which for measuring relatively slow-changing power systems, should be enough. The HAT PCB was created in KiCAD and can be found in the SMU GitHub hardware section, making it easy to modify to your needs, or at least adjust the design to match the parts you can actually get your hands on.

Continue reading “A RPI HAT For Synchronized Measurements”

Mokeylaser: A DIY Laser Engraver That You Can Easily Build

[Mark aka Mokey] borrowed his friend’s open-frame laser engraver for a while, and found it somewhat lacking in features and a bit too pricey for what it was. Naturally, he thought he could do better (video, embedded below.) After a spot of modelling in Fusion 360, and some online shopping at the usual places, he had all the parts needed to construct an X-Y bot, and we reckon it looks like a pretty good starting point. [Mark] had a Sainsmart FL55 5.5W laser module kicking around, so that was dropped into the build, together with the usual Arduino plus CNC shield combo running GRBL.

[Mark] has provided the full F360 source (see the mokeylaser GitHub) and a comprehensive bill-of-materials, weighing in at about $400, and based upon the usual 2040 aluminium extrusions. This makes MokeyLaser a reasonable starting point for further development. Future plans include upgrading the controller to something a bit more modern (and 32-bits) as well as a more powerful laser (we do hope he’s got some proper laser glasses!) and adding air assist. In our experience, air assist will definitely improve matters, clearing out the smoke from the beam path and increasing the penetration of the laser significantly. We think there is no need for more optical power (and greater risk) for this application. [Mark] says in the video that he’s working on an additional build video, so maybe come by later and check that out?

Obviously, MokeyLaser is by no means the only such beast we’ve featured, here’s the engravinator for starters. For even more minimalism, we covered a build with some smart optics doing all the work. But what if you don’t happen to have a 5W laser module “lying around” then perhaps try a more natural heat source instead?

Continue reading “Mokeylaser: A DIY Laser Engraver That You Can Easily Build”

AI Midjourney Imagines “Stairway To Heaven”

This modern era of GPU-accelerated AI applications have their benefits. Pulling useful information out of mountains of raw data, alerting users to driving hazards, or just keeping an eye on bee populations are all helpful. Lately there has been a rise in attempts at producing (or should that be curating?) works of art out of carefully sculpted inputs.

One such AI art project is midjourney, which can be played with via a Discord integration bot. That bot takes some textual input, then “dreams” with it, producing sometime uncanny, often downright disturbing images.

You can have a tinker with it for free, for a short while, but there is monthly cost if you want to use it ‘for real’ whatever that means. YouTuber [Daara] has been feeding the lyrics from Led Zeppelin’s “Stairway to Heaven” into it, producing a video tour of the resulting outputs for your perusal. Continue reading “AI Midjourney Imagines “Stairway To Heaven””

Let Slip The Chips Of War

We’re going to go out on a limb and predict that future history books will note that the decision to invade a sovereign nation straight after a worldwide pandemic wasn’t exactly the best timing. Turns out the global electronics shortage the pandemic helped to catalyze isn’t just affecting those of us with peaceful intentions, as the Russian war machine is having a few supply issues with the parts needed to build modern weapons and their associated control equipment.

As you might expect, many of these parts are electronic in nature, and in some cases they come from the same suppliers folks like us use daily. This article from POLITICO includes an embedded spreadsheet, broken down by urgency, complete with part numbers, manufacturers, and even the price Moscow expects to pay!

Chips from US-based firms such as Texas Instruments are particularly hard for the Kremlin to source.

So what parts are we talking about anyway? The cheapest chip on the top priority list is the Marvell ‘Alaska’ 88E1322 which is a dual Gigabit Ethernet PHY costing a mere $7.10 USD according to Moscow. The most expensive is the 10M04DCF256I7G, which is an Altera (now Intel) Max-10 series FPGA, at $1,101 USD (or 66,815 Rubles, for those keeping score).

But it’s not just chips that are troubling them, mil-spec D-sub connectors by Airborn are unobtainable, as are all classes of basic passive parts, resistors, diodes, discrete transistors. Capacitors are especially problematic (aren’t they always). A whole slew of Analog Devices chips, as well as many from Maxim, Micrel and others. Even tiny logic chips from Nexperia.

Of course, part of this is by design. Tightened sanctions prevent Russia from purchasing many of these parts directly, which is intended to make continued aggression as economically unpleasant as possible. But as the POLITICO article points out, it’s difficult to prevent some intermediaries from ‘helping out’ without the West knowing. After all, once a part hits the general market, it is next to impossible to guarantee where it will eventually get soldered down.

Thanks to [Kim Tae] for the tip!

What Every PCB Designer Needs To Know About Track Impedance With Eric Bogatin

PCB design starts off being a relatively easy affair — you create a rectangular outline, assign some component footprints, run some traces, and dump out some Gerber files to send to the fab. Then as you get more experienced and begin trying harder circuits, dipping into switching power supplies, high speed digital and low noise analog, things get progressively more difficult; and we haven’t even talked about RF or microwave design yet, where things can get just plain weird from the uninitiated viewpoint. [Robert Feranec] is no stranger to such matters, and he’s teamed up with one of leading experts (and one of this scribe’s personal electronics heroes) in signal integrity matters, [Prof. Eric Bogatin] for a deep dive into the how and why of controlled impedance design.

RG58 cable construction. These usually are found in 50 Ω and less commonly these days 75Ω variants

One interesting part of the discussion is why is 50 Ω so prevalent? The answer is firstly historical. Back in the 1930s, coaxial cables needed for radio applications, were designed to minimize transmission loss, using reasonable dimensions and polyethylene insulation, the impedance came out at 50 Ω. Secondarily, when designing PCB traces for a reasonable cost fab, there is a trade-off between power consumption and noise immunity.

As a rule of thumb, lowering the impedance increases noise immunity at the cost of more power consumption, and higher impedance goes the other way. You need to balance this with the resulting trace widths, separation and overall routing density you can tolerate.

Another fun story was when Intel were designing a high speed bus for graphical interfaces, and created a simulation of a typical bus structure and parameterized the physical constants, such as the trace line widths, dielectric thickness, via sizes and so on, that were viable with low-cost PCB fab houses. Then, using a Monte Carlo simulation to run 400,000 simulations, they located the sweet spot. Since the via design compatible with the cheap fab design rules resulted often in a via characteristic impedance that came out quite low, it was recommended to reduce the trace impedance from 100 Ω to 85 Ω differential, rather than try tweak the via geometry to bring it up to match the trace. Fun stuff!

We admit, the video is from the start of the year and very long, but for such important basic concepts in high speed digital design, we think it’s well worth your time. We certainly picked up a couple of useful titbits!

Now we’ve got the PCB construction nailed, why circle back and go check those cables?

Continue reading “What Every PCB Designer Needs To Know About Track Impedance With Eric Bogatin”

Renewable Hydrogen Sucked From Thinish Air

Stored hydrogen is often touted as the ultimate green energy solution, provided the hydrogen is produced from genuinely green power sources. But there are technical problems to be overcome before your average house will be heated with pumped or tank-stored hydrogen. One problem is that the locations that have lots of scope for renewable energy, don’t always have access to plenty of pure water, and for electrolysis you do need both. A team from Melbourne University have come up with a interesting way to produce hydrogen by electrolysis directly from the air.

Redder areas have more water risk and renewable potential

By utilising a novel electrolysis cell with a hygroscopic electrolyte, the so-called direct air electrolysis (DAE) can operate with humidity as low as 4% relative, so perfectly fine even in the most arid areas, after all there may not be clouds but the air still holds a bit of water. This is particularly relevant to regions of the world, such as deserts, where there is simultaneously a high degree of water risk, and plenty of solar potential. Direct electrolysis of saline extracted at coastal areas is one option, but dealing with the liberated chlorine is a big problem.

The new prototype is very simple in construction, with a sponge of melamine or a sintered glass foam soaked in a compatible electrolyte. Potassium Hydroxide (alkaline) was tried as was Potassium Acetate (base) and Sulphuric Acid, but the latter degraded the host material in a short time. Who would have imagined? Anyway, with electrolysis cell design, a key problem is ensuring the separate gasses stay separate, and in this case, are also separate from the air. This was neatly ensured by arranging the electrolyte sponge fully covered both electrodes, so as the hygroscopic material extracted water from the air, the micro-channels in the structure filled up with liquid, with it touching both ends of the cell, forming the circuit and allowing the electrolysis to proceed.

Hydrogen, being very light, would rise upward through holes in the cathode, to be collected and stored. Oxygen simply passed back into the air, after passing though the liquid reservoir at the base. Super simple, and from reading the paper, quite effective too.

You can kind of imagine a future built around this now, where you’re driving your hydrogen fuel cell powered dune buggy around the Sahara one weekend, and you stop at a solar-powered hydrogen fuel station for a top up and a pasty. Ok, possibly not that last bit.

The promised hydrogen economy may be inching closer. We covered using aluminium nanoparticles to rip hydrogen out of water. But once you have the gas, you need to store and handle it. Toyota might have a plan for that. Then perhaps handling gas directly at all isn’t a great idea, and maybe the future is paste?

Thanks to [MmmDee] for the tip!

Ztachip Accelerates Tensorflow And Image Workloads

[Vuong Nguyen] clearly knows his way around artificial intelligence accelerator hardware, creating ztachip: an open source implementation of an accelerator platform for AI and traditional image processing workloads. Ztachip (pronounced “zeta-chip”) contains an array of custom processors, and is not tied to one particular architecture. Ztachip implements a new tensor programming paradigm that [Vuong] has created, which can accelerate TensorFlow tasks, but is not limited to that. In fact it can process TensorFlow in parallel with non-AI tasks, as the video below shows.

A RISC-V core, based on the VexRiscV design, is used as the host processor handling the distribution of the application. VexRiscV itself is quite interesting. Written in SpinalHDL (a Scala variant), it’s super configurable, producing a Verilog core, ready to drop into the design.

A Digilent Arty-A7, Arducam and a VGA PMOD is all you need

From a hardware design perspective the RISC-V core hooks up to an AXI crossbar, with all the AXI-lite busses muxed as is usual for the AMBA AXI ecosystem. The Ztachip core as well as a DDR3 controller are also connected, together with a camera interface and VGA video.

Other than providing an FPGA-specific DDR3 controller and AXI crossbar IP, the rest of the design is generic RTL. This is good news. The demo below deploys onto an Artix-7 based Digilent (Arty-A7) with a VGA PMOD module, but little else needed. Pre-build Xilinx IP is provided, but targeting a different FPGA shouldn’t be a huge task for the experienced FPGA ninja.

Ztachip top level architecture

The magic happens in the Ztachip core, which is mostly an array of Pcores. Each Pcore has both vector and scalar processing capability, making it super flexible. The Tensor Engine (internally this is the ‘dataplane processor’) is in charge here, sending instructions from the RISC-V core into the Pcore array together with image data, as well as streaming video data out. That camera is only a 0.3 MP Arducam, and the video is VGA resolution, but give it a bigger FPGA and those limits could be raised.

This domain-specific approach uses a highly modified C-like language (with a custom compiler) to describe the application that is to be distributed across the accelerator array. We couldn’t find any documentation on this, but there are a few example algorithms.

The demo video shows a real-time mix of four algorithms running in parallel; one object classification (Google’s Tensorflow mobilenet-ssd, a pre-trained AI model) canny edge detection, a Harris corner detection, and Optical flow which gives it a predator-like motion vision.

[Vuong] reckons, efficiency wise it is 5.5x more computationally efficient than a Jetson Nano and 37x more than Google’s TPU edge. These are bold claims, to say the least, but who are we to argue with a clearly incredibly talented engineer?

We cover many AI-related topics, like this AI assisted tap-typing gadget, for starters. And not wanting to forget about the original AI hardware, the good old-fashioned neuron, we got that covered as well!

Continue reading “Ztachip Accelerates Tensorflow And Image Workloads”