Tuesday, March 31, 2015

Machinekit To Aid With Heart Research

Recently I was contacted by a Professor Andreas Lueger of Medical University of Graz, Austria, Dept. of Internal Medicine, probing me with some rather intricate questions on Machinekit. Andreas is head of the emergency room there, helipad on the roof and all. So if you drive recklessly around here, you stand a chance for a helicopter ride and being stitched up by Andreas and his team, but that is certainly not “motion control” as we know it. That made me curious, and I visited Andreas to probe what he is up to:

Andreas in business attire, as found in his professional habitat
Beyond stitching up patients, Andreas is deeply involved in heart research - investigating atrial fibrillation, a precursor of heart attacks. And that is some very geeky project  - for his research, he develops the electronics based on a TI MSP430, as well as the software for his own Wifi-enabled pacemakers - a whole new meaning of “embedded” for me. Andreas brought down current consumption to a couple of hundred nanoampĂ©res, and does solder the parts under his own stereo microscope:

What can I say? at last an MD who talks our language! And when I visited him, he had a bug report for Machinekit, including a screenshot from his oscilloscope. I was impressed.

Now that pacemaker certainly is not running Machinekit, so where do we come in? Well, in the next iteration of the project, Andreas plans to integrate acceleration sensors in the setup, to measure actual mechanical performance of heart muscles. And for manufacturing these sensor attachments Andreas is designing a custom CNC machine with FreeCAD:

Now we’re talking.. that machine will run Machinekit! Here comes the twist: Andreas plans to use Trinamic servo stepper motors. Those are very smart motors with an embedded controller and power stages attached; among other features, these motors can detect and report a stall, and autonomously compensate for lost steps:

Trinamic motors can be controlled through various methods: Step/Direction pins, RS232, RS485, USB, and CANbus. Now out of these options, CANbus is the most interesting one because it operates on a much higher level than the other options; the motor can report back (heartbeat, stall, position, velocity etc).  It’s really a much more intelligent motor subsystem than we usually use in Machinekit, like servos or stepgens.

I found all this terribly geeky, and beyond that also valuable for the project overall: if we investigate and collectively learn how to integrate CANbus, we open up Machinekit to literally thousands of peripherals with a professional bus system - as opposed to homegrown methods like hooking up an Arduino over RS232 or USB. The Beaglebone's TI3359 chip comes with two CAN devices on board - add MCP2562 bus drivers and you are done; or use an appropriate cape. For other platforms, PCI cards and USB adapters do the trick.

CANbus peripherals come in many shapes and forms - like this controller used by Claudio Lorini with support for the zedboard which he recently merged into machinekit; but also more mundane devices like your car's windshield wipers and power windows: yes - your car is a one extensive CANbus installation (provided your car was built in the current millennium). And if you research that topic, you will find there’s a whole “car CANbus” hacking scene out there, using Arduinos and whatnot to tap into their car’s CANbus, like this example

Where does this leave us? I have decided to support Andreas with this project, and while it is not absolutely certain the Trinamics will work as motion units as planned, it will be a very interesting expedition. And along the journey, Machinekit will learn to support CANbus peripherals.

And that exciting story is the background why you saw references to CANbus in my recent postings to the Machinekit list!

Saturday, March 14, 2015

Machinekit Running on Odroid C1

Machinekit already runs on x86 machines, the BeagleBone, and the Raspberry Pi.  Now GP Orcullo reports he has Machinekit running on the Odroid C1 using rt-preempt.  There are no hardware drivers yet, but it shouldn't take long to port GPIO access and get some motors moving.  If you're interested, there's a link to a bootable Debian Wheezy image in the Machinekit list post.

I'm anxiously waiting for boards based around all the new Big/Little parts coming out, which combine Cortex-A cores for good OS performance and Cortex-M parts for real-time tasks.  Then there's the BeagleBoard X15 coming out soon with Big/Little + DSPs + PRUs!  Exciting times in the ARM world!

Tuesday, March 10, 2015

IoT Vienna Presentation

Alexander Rössler recently gave a presentation on Machinekit and Machinetalk at the IoT Vienna Talks March 2015.  If you're interested in the new remote user interfaces and distributed HAL capabilities, take a look!