Huffpost Huffpost Code
The Blog

Featuring fresh takes and real-time analysis from HuffPost's signature lineup of contributors

Paul Taylor Headshot

The Wireless Digital Katana - Hardware Development in Australia

Posted: Updated:

My name is Paul Taylor; I am a Systems Engineer living down in Australia. When I'm not riding Kangaroos or swatting flies, I have been developing a Wireless Digital Katana. It is a high-speed, high-accuracy motion controller. Currently I am running a Kickstarter campaign to fund my project. This all began months ago when another Kickstarter campaign failed to deliver.

The Seed is Planted...
June 2012 I saw the video on the Clang Kickstarter campaign (www.kickstarter.com/projects/260688528/clang). At one point it demonstrated a digital sword controller and I fell in love. The project slipped behind and it became clear that the sword controller was not going to eventuate. It was that moment that I decided to make my own sword controller.

Prototyping Like a Boss...

Some more internet research and I knew that I would be using an Arduino microcontroller at the heart of the Digital Katana (the sword became a Katana (Japanese Sword), as it is the type that I train with (in Iaido) and have the most appreciation for).

I grabbed an Arduino Mega off my desk, it was way too big to be practical, but had enough room to debug the ugliest programming problems. Using the internet I found many great motion sensors that work with Arduino microcontrollers and I settled on the only all-in-one 9-axis motion sensor. At only 4x4x1mm this tiny device can track acceleration (gravity and motion), magnetism (think of a 3D compass), and rotation (via on-board gyroscopes). Buying these parts in Australia turned out to be impossible so I knew I'd bound to waiting on the slow postage to Australia.
I jumped on eBay and ordered some samples, then waited.... It would be 2-4 weeks before I could progress on the electronic components of my project, so I used my most valuable Wild-Card for prototyping in Austraila: Guesstimation (I know it is not a word, I'm making it a word). Taking guesses at where my project would lead I began pre-ordering all types of hardware: Various wireless modules, Batteries, connectors, Arduino boards. All up I spent less than $100AU on these guesstimated parts.
A few weeks later and enough hardware arrived for me to assemble the first prototype: An ugly pile of wires that spits out huge quantities of text via a serial connection to my PC. If I poked the pile of wires the numbers would change. From the outside not exactly exciting, but to see my creation alive, even just barely was exhilarating and super-motivating.
24 hours later I had cut and drilled a bokken, attached the sensors, and the amazingly huge Arduino. I was swinging my wooden katana (now a digital katana) around with that huge text stream pouring onto the PC screen.

2013-11-22-Prototype1.jpg

With the controller alive, it was time to work on software that could realise the text stream into something more tangible. I've done a lot of video game programming, so a weekend later I had the first interactive simulation of the digital katana. You can see lots of pretty graphs and debug text, this was really helpful, especially as some of the Axis and rotations were initially backwards.

2013-11-22-3dGame1.png

Development continued in 3 Dimensions, and it became clear that is some situations the motion sensor would get really weird. Tracking would be great one minute, and jumping all over the place snapping about the next. Testing showed that the sensors have a few orientations where behaviour is erratic. I solved this by adding a second sensor to the tip of the Digital Katana, giving me the luxury of reading from either sensor and even mixing data from both sensors. The result was a dramatic improvement in tracking and reliability, and no more weird motion tracking.

The following Monday a pair of Wireless transceivers appeared in the mail box so I was able to start working on creating a wireless link between the Katana and the PC. Two days of tears and I was unable to get the wireless link happening. Looking through the schematics provided by the chip manufacturer I was able to identify a missing capacitor on my wireless units.

2013-11-22-CapacitorofEvil.jpg

Adding one of these little guys to each unit had my wireless transmission operational. Unlike traditional Wi-Fi which can take huge quantities of data, the direct link is only capable of transmitting 32 bytes of data in each packet (transmission). Packing the information from a 9-axis motion sensor into 32 bytes was a mathematical adventure. I won't bore you with the details (contact me if you're dying to know), suffice to say I succeeded and was able to evolve the Digital Katana into the Wireless Digital Katana.

With the Katana operational it was now time to shrink the processor. My solution was an Arduino Nano V3. With only 32KB of code storage (the Arduino Mega has a whopping 256kB of storage), a lot of time was spent optimising my code to fit inside of 32kB. It involved a lot of late nights and coffee to devise code that was smarter and thus smaller, with many modifications to the Arduino libraries as well as my own code.

All I had left to do was to power my Katana.

To keep the Arduino Nano happy I had to provide a continuous 5 volts for at least 1 - 2 hours. The most dense (capacity for size) rechargeable batteries that were common enough to consider were the Lithium-Polymer and Lithium-Ion types. Another eBay splurge, and I had a few different Li-Po and Li-Ion batteries along with various USB chargers in the mail.

I found a type 1400 Li-Ion battery (the same size as a AA battery) contains more than enough power for the Digital Wireless Katana, and I was able to drill a hole in the base of the Katana to contain the batter, the only issue remaining was that the batteries are 3.7v, and I needed 5v. The solution was to either move to 2x batteries (more weight and charging difficulties) or utilise a tiny step-up converter.
I chose the latter, and soon had a DC-DC Step-Up converter in the mail.

2013-11-22-DCDCConverter.jpg

This little guy solved my voltage issues with a small (8%) power usage overhead.
Designing the receiver was very simple, as it utilises the same Arduino Nano board as the Wireless Digital Katana, yet performs less work, simply receiving packets from the Katana and passing these on to the host PC. I'm currently using 3D printing to design a compact and elegant case for the receiver.

If you would like to see my project, jump the link and take a look: http://www.kickstarter.com/projects/511679941/open-source-digital-katana-with-real-time-tracking

So if you're a budding engineer or tinkerer, learn to love eBay, dream big, and have fun!My name is Paul Taylor; I am a Systems Engineer living down in Australia. When I'm not riding Kangaroos or swatting flies, I have been developing a Wireless Digital Katana. It is a high-speed, high-accuracy motion controller. Currently I am running a Kickstarter campaign to fund my project. This all began months ago when another Kickstarter campaign failed to deliver.