Technology

How we taught an industrial robot to tweet: The story of Arska

October 21, 2015

Read time 8 min

A while back, we figured it would be cool to get Reaktor involved in the robotics business. Long story short: we just got an industrial robot and learned how it works. In this blogpost we shed light into the chain of events that resulted in an ABB IRB 120 robot tweeting at a conference by the name of Arska.

Fast, accurate and strong – the Terminator

There are plenty of consumer level robots available, starting from drones like Parrot to programmable toys like Lego Mindstorms, but how do these compare with industrial robots? This is what we found out about real robots:

They’re fast. The tip of the robot moves up to 5m/s.
They’re accurate. The can be positioned with a 0.01mm accuracy.
They’re heavy and strong. Unfortunately, this also means that they can easily harm you if you’re not careful.

This led us to name the robot as “Arska”, referring to the Finnish nickname of Arnold Schwarzenegger, who’s also known for these attributes – at least when acting as the Terminator.

A couple of my colleagues, Tuomas and Juhani, were asked to take the first contact with Arska. Equipped with a jump-to-the-deep-end mindset typical to Reaktor, they managed to plug it in, turn it on and operate it manually without resorting to any manuals or ABB representatives. They also installed an open source library called Open ABB on it, which allowed them to control the robot remotely with something resembling a modern programming language, python.

To get the robot to do something based on a program running on a remote computer was an achievement in itself. Still, it was no time to celebrate yet: almost every large movement ended up in the robot suddenly stopping and showing a singularity error. This turned out not to be Arska reaching self-awareness but a well-known problem in robotics: How to align the different parts of the robot without getting them in such angles that the robot cannot move to the requested direction any more? (For more, see Industrial robot singularities.) Even drawing a square on the air got the robot stuck.

So, there we were, with a fast, accurate, strong – and very stupid – robot.

The Breakpoint challenge

At this point, the project was handed to me with the wish from our marketing people to get the robot to “do something cool for next week’s Reaktor Breakpoint conference, where it could, like, interact with people“. This was 7 workdays away.

On the first day, me and my fellow robotics enthusiast colleagues participated on ABB’s industrial robot programming crash course. In just a few hours, we learned the same lessons the original robot team had found out the hard way. We also got confirmation that the problems with singularities could not be solved with any single trick. A typical industrial robot only moves in a very strict, pre-programmed way, so the singularity problem is avoided by planning each move carefully. After the training, we delved into the available open source libraries to see if any offered us a solution to the problem. The short answer – with the time we had available – was no.

What kind of movement could the robot safely do, then? After some experimenting, it became apparent that if all the robot axes were in a non-perpendicular angle, there was quite a big imaginary box of free movements in front of the base of the robot. A script was used to move the robot in this space to be sure that the space was big enough to do something “interactive” and “cool”. But what?

A more or less obvious option was the act of writing text with a pen. Writing, we figured, is something that happens in predictable and testable movements on a level surface. The robot could be made to write something with an impressive speed and accuracy. The only tiny problem was that the robot was sitting in a fully enclosed epoxy glass container in order not to harm anyone. So, how to erase the text? The answer came to me when checking my Facebook feed and seeing this joke from my friend:

ipad pro for kids

Now we only needed to get a similar toy, teach the robot to write, and wipe the text out by manipulating the lever.

Anyone up for something cool and hazardous?

At this point, five and half days before the conference, the poor fellow responsible of getting the 200kg robot to the conference venue wanted to know whether or not to prepare for the move. To get him an answer, I marched into a room full of people at our office and asked if anyone was willing do “something cool involving a hazardously fast, strong and heavy industrial robot writing on a kids toy”. All hands went up.

By morning, me and my colleague had managed to find the desired kids’ toy from a toy store. We created a robot writing library and a partial font (thanks Masaichi!) in a matter of hours. A quick test verified that the robot could, in fact, really write comprehensible text.

Industrial robot tweeting

With the main parts of the demo setup now existing, the next task was setting up the mounting of the toy. This turned out to be very time consuming. Our talent seemed to be on the brain work side, not so much on the screwdriver and hammer side. Time was wasted on running back and forth to the hardware store, buying parts that turned out to be unnecessary.

Let’s get printing!

It was time for the next leap forward in our thinking: what we cannot find or build from parts, we can create with our company’s 3D printer. This realization turned the whole development process inside out. Instead of limiting to existing stuff, the only limit was now our imagination. And, of course, the fact that we knew nothing about 3D models or 3D printing.

3D printing parts for tweeting industrial robot

Luckily, trial and error was again a good teacher, and within a couple of hours we got the missing parts. After two full days of development we got the main parts of the demo working. People who saw the demo in the making were most impressed about the font and erasing the text. Many even called it cool.

With the cool box now checked, the other original request was yet to fill. How to get Arska to interact with people? My teammate suggested the obvious: let’s have it write tweets! This would make the written text interesting to the conference audience, and from a software industry point of view, integrating something with Twitter is quite a common first demonstration of new technology. With the standard python development tools and open source libraries, adding this capability took no more than a few hours. The demo for Reaktor Breakpoint was ready.

What does Arska have to say?

With one day left before moving the robot to the conference, we still felt like something was missing. With Arska only copying other people’s tweets, it felt like one of the guys from a comedy movie where one guy could speak but not understand a foreign language and another guy understood but could not speak it. We decided to add a tweet-creating capability.

How to allow Arska to write with a keyboard on a computer when it is in the isolated box? With a wireless keyboard. How to convert a character in a text to a press on a keyboard? By creating a coordinate mapping algorithm char -> (x, y) on keyboard. How to send the typed text to Twitter? By making the typing to go to a console, appending all text with a call to a shell script which sends the rest of the command to Twitter. The final thing was to decide what Arska had to say. We decided to use terminator quotes with a twist: the engine generating the quotes was actually using functions to generate the quotes, so we could add dynamic content like time and weather information. In one day Arska could now tweet.

Tweeting capability

The final episode was moving Arska to the venue. Of course, the robot was too big for the van reserved for the move, and eventually a bunch of my colleagues ended up pushing the robot from the company garage to a big truck waiting outside. This was quite a bumpy ride, and as the clearance of our demo setup was just a few millimeters, we knew we had to recalibrate everything at the destination. Of course, being software engineers, we didn’t want to do this manually. So, as a final piece of the puzzle we wrote a calibration script which took the robot through all the different parts of the demo in small steps. Using this whenever the robot was moved, we could readjust either the robot coordinate system or the mechanical rigging in just a few seconds.

Hasta la vista, baby

The demo turned out to be quite a hit, especially considering that we used less than a work week to code and build it. This was actually the whole point of the exercise: we proved that a modern industrial robot can be made to do flexible things with a relatively small amount of work.

So what next? Because the costs of programming a robot are relatively low, even a small company could benefit from including robotics in their business. We now consider industrial robots as a part of the toolset we can offer to our customers, if we see a need for it. There is a lot of interest from the educational sector – for example, a Coding School will take place today, where kids will learn how to program a robot. Arnold already has his coding diploma.

Arnold Schwarzenegger coding

I, for one, think this has been one of the most fun and coolest – if not the coolest – projects we’ve had the privilege to be part of. It is a great example of what an open-minded company like Reaktor can offer to its employees and customers.

Without a doubt: Arska will be back!

Never miss a post