Robot Art

Recently, we've been experimenting with robotically-generated artwork, and the results have been surprisingly good.  The first video is a demonstration of image processing, automatic path generation, and plotting algorithms.  The robotic arm is a stock Interbotix WidowX.  The control platform is a Windows 8 laptop running custom software developed in Visual Studio (C#).







Image Gallery






Technical Details

The image processing is actually the simplest task in this project.  We preprocess the images using standard image editing tools to first generate a 1-bit representation.  The image processing code walks through that bitmap at random, using multiple passes to slowly build up the effective density (each pass being statistically independent).   With each successive pass, the code builds a path of coordinates to drive the arm.  When the arm is running, each pass causes more and more detail to be defined.  This approach – though it’s tedious – causes the image to slowly emerge out of the noise.  We can then choose to cancel the job when the image reaches an appealing level of detail.  The images shown above actually take hours to generate.  Note that we now have a faster implementation that has a hard limit on the vector length of the pen movement, so the arm doesn’t end up traversing the entire work surface from point-to-point.

Most of the work for this project was in implementing an inverse kinematics (IK) engine to drive the robot's servos.  The IK engine is the primary algorithm for translating the 2D picture coordinates into a series of arm servo rotations that will land the pen at the right locations.  For a multi-axis robot arm, this is no trivial task.  In fact, from a mathematical standpoint, there is no single equation to solve the problem.  For this reason, we use an iterative technique to determine the most efficient way to move the arm from one point to the next.  Generally, this algorithm allows us to converge on a close approximation to the ideal solution.  This approach also tends to give the arm a more organic-looking motion.  Different movements will cause the arm to behave differently depending on the type of movement required.  For a large movement, the IK engine may require all of the arm servos to move.  For a fine movement, the IK engine may only need to drive a single servo.  When you think about it, this is very similar to how the human arm works as well.  For a large movement, you might move your shoulder, elbow, and wrist.  But for a fine movement, you don't need to move your shoulder or elbow, so you only move your wrist.

The next video demonstrates the basic functionality of the custom control software that was developed for the project.  It also illustrates some of the capabilities of the custom inverse kinematics and forward kinematics solvers.  These advanced mathematical algorithms allow the robot to automatically find the best way to get from point to point.





The original purpose for the project was to learn more about IK solver algorithms as well as evaluate the capabilities of the Dynamixel servos used in the WidowX robot arm.  After discovering some of the more advanced features of the servos, the project scope has grown to include more complex motion profile processing and capture algorithms.

One feature we discovered unexpectedly was the ability to use the robot arm as a rudimentary digitizer -- a device used to take measurements of 3D objects.  When the arm's servos are disabled, the arm can be freely positioned manually.  Our software's kinematic solver is able to use the servo positions to calculate the end point of the arm.  We can then capture that 3D point in space, display it on screen, and store it for later analysis or processing.  In the demonstration that follows, in order to improve the accuracy of our 3D digitizer measurements, we've replaced the arm's normal gripper with a simple probe (a small bolt, actually).  This gives us a solid single endpoint to track in our calculations.







Source Code

Source code and configuration files are provided as a courtesy of Phantom Data Services, LLC under the terms of the MIT License:
ArmController_2014-09-19.zip (Visual Studio 2012 Project)