Edging Ahead When Learning On The Edge

“With the power of edge AI in the palm of your hand, your business will be unstoppable.

That’s what the marketing seems to read like for artificial intelligence companies. Everyone seems to have cloud-scale AI-powered business intelligence analytics at the edge. While sounding impressive, we’re not convinced that marketing mumbo jumbo means anything. But what does AI on edge devices look like these days?

Being on the edge just means that the actual AI evaluation and maybe even fine-tuning runs locally on a user’s device rather than in some cloud environment. This is a double win, both for the business and for the user. Privacy can more easily be preserved as less information is transmitted back to a central location. Additionally, the AI can work in scenarios where a server somewhere might not be accessible or provide a response quickly enough.

Google and Apple have their own AI libraries, ML Kit and Core ML, respectively. There are tools to convert Tensorflow, PyTorch, XGBoost, and LibSVM models into formats that CoreML and ML Kit understand. But other solutions try to provide a platform-agnostic layer for training and evaluation. We’ve also previously covered Tensorflow Lite (TFL), a trimmed-down version of Tensorflow, which has matured considerably since 2017.

For this article, we’ll be looking at PyTorch Live (PTL), a slimmed-down framework for adding PyTorch models to smartphones. Unlike TFL (which can run on RPi and in a browser), PTL is focused entirely on Android and iOS and offers tight integration. It uses a react-native backed environment which means that it is heavily geared towards the node.js world.

Continue reading “Edging Ahead When Learning On The Edge”

A Simple RP2040-Based Audio DSP Board

If you’re one of those people who got into building electronics for the purpose of making music, then this Raspberry Pi RP2040-based audio DSP project by [DatanoiseTV] might be of interest. Provided is a FreeRTOS template application for creating Eurorack compatible synthesizers, effects processors, and similar DSP-based audio widgets.

The hardware platform has the usual Eurorack connectivity, including MIDI in, Control Voltages (CV) and the usual 5V-compatible triggers. An audio output is provided to send the audio out to the system mixer or any other analog modules. Additionally, connections are provided for a rotary encoder, a few push buttons, and an OLED display to allow construction of a rudimentary user interface on the module, if that is required.

The application template is generic enough, however the project is intended to be used with the Vult DSP transcompiler. Vult is a high-level programming language designed to enable easy creation of audio synthesizers and similar, producing C++ code as an output of the compilation process. This is then wrapped up with the RTOS goodies (although you don’t actually need them) to drop onto the RP2040 in the usual way, via the handy USB-C port. So, if you’re looking to get into DSP-based Eurorack modules for your homebrew synth rack, this might be a good place to start.

Just like the RP2040 isn’t the most obvious choice for a DSP application, neither is the ESP32 for that matter, but who cares? many modern micros are more than capable of audio DSP these days, with or without the dedicated functionality.

Linux Fu: Docking Made Easy

Most computer operating systems suffer from some version of “DLL hell” — a decidedly Windows term, but the concept applies across the board. Consider doing embedded development which usually takes a few specialized tools. You write your embedded system code, ship it off, and forget about it for a few years. Then, the end-user wants a change. Too bad the compiler you used requires some library that has changed so it no longer works. Oh, and the device programmer needs an older version of the USB library. The Python build tools use Python 2 but your system has moved on. If the tools you need aren’t on the computer anymore, you may have trouble finding the install media and getting it to work. Worse still if you don’t even have the right kind of computer for it anymore.

One way to address this is to encapsulate all of your development projects in a virtual machine. Then you can save the virtual machine and it includes an operating system, all the right libraries, and basically is a snapshot of how the project was that you can reconstitute at any time and on nearly any computer.

In theory, that’s great, but it is a lot of work and a lot of storage. You need to install an operating system and all the tools. Sure, you can get an appliance image, but if you work on many projects, you will have a bunch of copies of the very same thing cluttering things up. You’ll also need to keep all those copies up-to-date if you need to update things which — granted — is sort of what you are probably trying to avoid, but sometimes you must.

Docker is a bit lighter weight than a virtual machine. You still run your system’s normal kernel, but essentially you can have a virtual environment running in an instant on top of that kernel. What’s more, Docker only stores the differences between things. So if you have ten copies of an operating system, you’ll only store it once plus small differences for each instance.

The downside is that it is a bit tough to configure. You need to map storage and set up networking, among other things. I recently ran into a project called Dock that tries to make the common cases easier so you can quickly just spin up a docker instance to do some work without any real configuration. I made a few minor changes to it and forked the project, but, for now, the origin has synced up with my fork so you can stick with the original link.

Continue reading “Linux Fu: Docking Made Easy”

Up In The Sky… It’s A Bird… It’s A Drone… Oh Yeah, It’s A Drone

One staple of science fiction is the ornithopter, which is a plane with moving wings. While these haven’t proved very practical in the general sense, a recent paper talks about mimicking natural wings changing shape to improve maneuverability in drones and other aircraft. In particular, the paper talks about how the flight performance of many birds and bats far exceeds that of conventional aircraft.

The technical term for being more maneuverable than a conventional aircraft is, unsurprisingly, called supermaneuverability. Aircraft performing things like the Pugachev Cobra maneuver (watch the video below, or the latest Top Gun movie) require this type of operation, and with modern aircraft, this means using thrust-vector technology along with unstable airframes and sophisticated computer control. That’s not how birds or bats operate, though, and the paper uses modern flight simulation techniques to show that biomimicry and thrust vector technology don’t have to be mutually exclusive.

Continue reading “Up In The Sky… It’s A Bird… It’s A Drone… Oh Yeah, It’s A Drone”

No Tool Left Behind With The Help Of Homemade Shadow Boards

Shadowed tool storage — where a tool outline shows at a glance what’s missing from storage — is a really smart way to keep your shop neat. They’re also super important for cases where a tool left behind could be a tragedy. Think, where’s-that-10-mm-socket-while-working-on-a-jet-engine? important. (It’s always the 10-mm socket.)

But just because shadow boards are smart, doesn’t mean they’re easy to make. That’s why [Scott Prince] came up with this semi-automated method for making toolbox shadow boards. The job of tracing around each tool on some sort of suitable material and cutting out the shapes seems straightforward, but the trick comes in organizing the outlines given the space available and the particular collection of tools.

[Scott]’s method starts with capturing images of each individual tool. He used a PiCam and a lightbox housed, strangely enough, in a storage bench; we’d love to hear the full story behind that, but pretty much any digital camera would do for the job. After compensating for distortion with OpenCV, cropping the images, and turning the image into a vector outline of the tool, [Scott] was left with the task of putting the tools into logical groups and laying them out sensibly. After tweaking the tool outlines and adding finger cutouts for easy pickup, [Scott] put his CNC router to work. He chose to use a high-density polyethylene product made by his employer, which looks fantastic, but MDF would work fine too.

We have to admit to a fair degree of toolbox envy now that we’ve seen what shadow boards can do. We’re a bit torn, though — [Zach Friedman]’s Gridfinity storage system has a lot going for it, too.

Wonderful Foldable Printable Dodecahedron

Debra Ansell of [GeekMomProjects] fame came up with a neat, 3D design that prints flat and then folds up into everyone’s favorite Platonic solid: a D12.

Why would you want to do this? Well, folding up your 3D prints gives you a third dimension “for free” without using all that support material. Here, all of the outside faces of the dodecahedron are printed flat against the build plate, which is probably the nicest side of your prints. And embedding LEDs in the resulting shape would probably be easy because they’re all in plane. And speaking of LEDs, we kinda expected to see them here, given Debra’s motto: “LEDs improve everything” — that part is up to you.

Debra notes that she likes PETG instead of PLA for the extra strength in the thin-printed hinges, and we’d bet that your printer’s tolerances will need to be spot on for the clips that hold the whole thing together. (We’d be tempted to apply a little super-duper glue.)

As always with Debra’s projects, there’s some creative solutions on display here that’ll help you out whether you need a D12 or a D20, so give it a look!

Thanks [Peter] for the tip.

Continue reading “Wonderful Foldable Printable Dodecahedron”

Blinking An Arduino LED, In Julia

The Julia programming language is a horrible fit for a no-frills microcontroller like the ATMega328p that lies within the classic Arduino, but that didn’t stop [Sukera] from trying, and succeeding.

All of the features that make Julia a cool programming language for your big computer make it an awful choice for the Arduino. It’s designed for interactivity, is dynamically typed, and leans heavily on its garbage collection; each of these features alone would tax the Mega to the breaking point. But in its favor, it is a compiled language that is based on LLVM, and LLVM has an AVR backend for C. Should just be a simple matter of stubbing out some of the overhead, recompiling LLVM to add an AVR target for Julia, and then fixing up all the other loose ends, right?

Well, it turns out it almost was. Leaning heavily on the flexibility of LLVM, [Sukera] manages to turn off all the language features that aren’t needed, and after some small hurdles like the usual problems with volatile and atomic variables, manages to blink an LED slowly. Huzzah. We love [Sukera’s] wry “Now THAT is what I call two days well spent!” after it’s all done, but seriously, this is the first time we’ve every seen even super-rudimentary Julia code running on an 8-bit microcontroller, so there are definitely some kudos due here.

By the time that Julia is wedged into the AVR, a lot of what makes it appealing on the big computers is missing on the micro, so we don’t really see people picking it over straight C, which has a much more developed ecosystem. But still, it’s great to see what it takes to get a language designed around a runtime and garbage collection up and running on our favorite mini micro.

Thanks [Joel] for the tip!