Here at Synthetos we came up with the idea of using the grblShield to control a wirebot. A wirebot (or “cable robot”) is the same type of robot as the SkyCam that sports stadiums use to fly video cameras over the field. We plan on using this robot setup to control some really cool Halloween decorations! However the uses are many. Riley’s son wants a TIE Fighter flying around the ceiling in his room. Using the grblShield and three stepper motors, some braided fishing line and some odds and ends we get our WireBot. Check out the Make:Project here to find step by step instructions. Below is an explanation of the setup and the math.
The wirebot has the following components – from the top layer to the bottom:
- A Python program that reads Gcode files, transforms X,Y and Z them into wirebot coordinates and sends commands to…
- grbl. Which is a 3 axis CNC controller running on the Arduino hardware.
- grblshield plugs into the Arduino and provides 3 stepper controllers which drive…
- three motors the control the string lengths needed to position the wirebot.
Setting up the motors
The working volume of the wirebot is a triangular solid defined by the three motor positions: left vertex, right vertex, and rear vertex (v1, v2, and v3). The useful working volume where the coordinates are relatively linear is somewhat smaller than the full triangle, and is roughly the cylinder that fits within the volume. So when setting up a wirebot you want to chose vertex locations to get a good working volume. While the robot can move outside the working volume, the coordinates get very distorted very fast. They stay pretty linear inside the working volume.
Chose a good space to work in (like an open porch), and mount the motors at the vertices, probably along the ceiling of the porch. For best results the string should come off the spool pointing roughly towards the center, but any reasonable angle will do. We wound the strings so they feed off the top of the spools. Here’s a picture of the wirebot test rig (considerably smaller than the porch!).
When you mount the motors it’s easiest if they are all “pointing the same way”, i.e. the shafts are all pointing clockwise or counterclockwise around the circle. If one motor is reversed from the others you will need to invert the polarity of that motor either at the plug (electrically) or by using the grbl polarity setting (see: http://www.synthetos.com/wiki/index.php?title=Using_the_grblShield)
Configuring the vertices
The wirebot coordinate system has an X, Y, Z origin (0,0,0) in the middle of the volume. Positive X moves to the right, positive Y moves towards the back, and positive Z moves up.
To set up the vertices determine the position of each vertex relative to the origin. Measure the vertex offset in X (left/right), Y (backwards/forwards) and Z (up/down) dimensions from an origin point in the center of the volume. Measure from the origin to the center of each spool. So if the above diagram represents an 8 foot cube the coordinates will look something like this (in inches):
v1 = (x1, y1, z1) = ( -48″, -48″, 48″ ) left vertex motor
v2 = (x2, y2, z2) = ( 48″, -48″, 48″ ) right vertex motor
v3 = (x3, y3, z3) = ( 0″, 48″, 48″ ) rear vertex motor
These offsets are entered into the Python program. The above example assumes the vertices are all at the same height, but they don’t have to be. Just enter the actual height from the origin. The example also assumes that the rear vertex is half way between the left and right in X (centered), but it doesn’t have to be. The positions of the vertices are somewhat arbitrary, assuming you don’t reduce the working volume too much.
Wirebot inverse kinematics math
The math is actually very simple once you realize that all you need to do is compute the line lengths (distances) between the target position and the vertices. The line lengths are the cartesian distances defined by the following equations.
L1 = sqrt((x1-x)^2 + (y1-y)^2 + (z1-x)^2)
L2 = sqrt((x2-x)^2 + (y2-y)^2 + (z1-x)^2)
L3 = sqrt((x3-x)^2 + (y1-y)^2 + (z1-x)^2)
Where (x1,y1,z1)… are the vertex positions and (x,y,z) is the target position.
Rather than modifying the grbl code to perform the inverse kinematics, we cheat and do the transformation beforehand using a Python program. The Python program transforms the X,Y,Z coordinates you input to produce Gcode that produces the right string lengths from the grblshield.The Python takes the actual X, Y and Z coordinates and transforms them to L1, L2, and L3 values before sending them to grbl/grblshield. The L1 length is fed to grbl/grblshield as the Gcode “X” coordinate, L2 as the “Y”, and L3 as the Z.
Here is a video of it moving the ping pong ball in a spoke like pattern.