Friday, December 6, 2013

Four Cable Drawing Machine

This is a cable driven drawing machine I constructed for the Telus Spark Science Centre in Calgary, Alberta.

Each of the four stepper motors is connected to a pulley and string. By winding in or letting out string on each corner the computer can position the draw head anywhere in three dimensional space, or at least within its work envelope of roughly 590x590x220mm.

The machine is controlled with LinuxCNC using a custom kinematics module and python script written by Kevin Loney. Its input files are standard g-code, the same format used for controlling a CNC mill, all the weird coordinate transformation math is handled by the kinematics wrapper.

More construction info and photos after the video,

By far the hardest thing on this build was getting the machine to to home fully automatically. For those new to motion control, I am using stepper motors, these are open loop which means that I can move them incrementally, but I have no idea where they actually are. To determine their current state, I have to move them to a known position, and call that home. This is fairly easy on a traditional CNC machine where each axis is independent and on guides, but quite painful when all four are tied together and made of string.

Many ideas were floated to solve this, from IR range finders, to vision based systems with openCV and a webcam. Finally for reliability I settled on simple switches.

From here though, there are two main problems, first, how do you trip a switch with a length of string, and second how do you keep everything taught and tangle free when you haven't got a clue where the drawhead is starting from.

The switches were the easy(er) part, the first attempt used a magnetic reed switch mounted over the fairleads (cable guides), and neodynium ring magnets mounted to the draw head.  Once the magnets got close to the switch it would trip and tada! That was the theory at least, in practice they would fail to trip half the time, the magnets would stick to any ferrous metals in a 6 inch radius, and that was just the start of the problems. I got around some of the issues by using larger magnets, and brass screws, but it was really unworkable.

The final solution was to build custom rocker switches around the fairleads. They were spring loaded so that as the head was drawn into them, they would fold back and trip a small lever switch. They still had to be strong enough to keep the cable in the same position and they had to be rigid enough to not accidentally trip under normal load. Good times.

Now, to get the drawhead to trip the switch I have to have slack from the opposite side. The first thing I tried was to just spool out cable on one motor as I spooled in on the other. For a two cable machine this technique works great, once you get two more cords in the mix, and a lack of space to use gravity to keep things taught, a lot of tangles result. The solution was a bit of a hack, but one I am rather proud of. Stepper motors have no direct mechanical connection between the shaft and the body of the motor (well, other than the bearings), its the magnetic field in the coils that causes the shaft to turn. This means that stepper motors can slip without damage if the force on the shaft exceeds the holding torque of the coils. Further, the stepper motor driver I am using allows the current going into the motor to be adjusted with a resistor which then adjusts the holding torque. Yup, that's right, the motors have a tug of war. One is stronger than the others so it just reels it in with some enthusiasm, everything stays taught and you are off to the races.

This video shows the switches getting hit, I need to upload another video showing the unholy chunking and shaking that happens during the tug of war phase.

The construction of this machine was a mixture of hand machining, carpentry and a bit of laser cutting for the towers and overwrap guides. The head is replaceable, for the early tests I had a larger head that could mount a pen and do some fairly accurate drawings, only issue was that in a more resistive material like sand it tended to flop around a lot.

Monday, December 2, 2013

Sidewalk Drawing Machine Goto Test

Motion test of my new draw bot. I have made my own DC servos by using a gear motor and a hall effect absolute angular position sensor. So now I can send a position over serial, and the robot will attempt to move there from wherever it is. I am using a PID loop to achieve this but still need to do some tweaking as you can see from the oscillations. Mostly this is due to the inertia of the arm being radically different depending on the extension.