grblshield wirebot

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.

Intro

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.

Comments

How difficult would it be to directly control the movement of the ping pong ball? So it would be more like the full scale wirecams.

JayApril 25, 2011

Not sure I follow… Once you have your origin set any commands (gcode that is) to say go up is making the ball move up.. Can you clarify what you mean?

I’d use analog joysticks, one for x and y the other for z. So I could adjust the position on the fly.
I’m trying to see the about scaling it up to a size that could handle a small camera, (Go pro HD) maybe a servo package at the end.

JayApril 27, 2011

There are a few things to be mindful of when scaling it up to stadium size (or smaller). Platform stability is the first. The stadium cams use 4 wires, not 3. TinyG could handle 4 wires but grblshield will not. Also, I think skycams use gyros for stability – like a steadycam. There are other cable robots that use 6 or 8 lines to keep the platform stable – usually half are from underneath. This puts you squarely into the “parallel robot” territory (like a Stewart/Gough platform, and all that implies for the kinematics).
The second aspect is torque versus speed. The bigger the winding shaft, the higher the speed and the lower the torque. The teeny motors we used do a ping pong ball quite nicely, but you do have to be careful of the motor torque.
We’ve been interested in scaling it up as well. Please let us know what you find out.

aldenApril 27, 2011

Hi there

Would you also be able to share the python code you used for the drawbot you made? I am experimenting with python at the moment but can’t do the math.

CarlJune 4, 2011

Yah I willpost it soon. Sorry. I am in process of moving and its been quite a time!

Hello,
I have completed a wirebot and after chasing down and resolving and issue with 64 bit Python I am communicating with the shield. But I do not have any movement. The steppers are taking current, and cannot be rotated by hand when powered. I sent long commands, s.write(“G0 x1000 y1000 z1000 \n”), and tried setting the current with no success. Any tips on where to look next?
Cheers
-ken

Are you sure you have the entire chain working correctly? If grbl is installed correctly and working it should return about 10 lines of parameters if you hit it with a $. Once that’s done you can run grblshield on top of it with no motors and the XYZ LEDs should light or flash. Is grblshield powered up properly? (Power LED is on – hasn’t been mis-wired / blown up). After that, If the motors are wired correctly they should turn. As always, never change out the parts when things are powered up. Hope this helps.

aldenAugust 31, 2011

No Luck writing $! After chasing down a hyper terminal program for Win7 I could connect but could not write. I am using a duemilanove not an uno, could that be it? At the shop I have one running but it is on an uno.

Thank you for the replies! My problem was twofold, needed the patched code, and can only upload hex at 57.6K? $ returns parameters and I am able to change them at will.
I am know chasing down scaling as the ball moves, but not as expected.