A friend gave me an old industrial robot the other week. Yay! OK, “robot” sounds fancy. It’s a cartesian robot, just a posh name for summat that can move in X, Y and Z directions like a plotter. Tidy looking thing, though:
Even came with a pendant – a programmer / controller to teach it what you want it to do. It’s completely self-contained, so you can just plug it into the mains, programme it to do some moves, and then it’ll do those moves happily until you switch it off.
I’ve got history with these kinda robotics, though. The controller and the logic board are fine for industrial stuff, you can tell it “move 33mm in the X direction, then move the head down 20mm” etc, but it doesn’t handle graceful acceleration, it’s just moving or not. And I want to be able to control it with a computer, so I can get it to carve circuit boards, sculpture, engrave stuff. So … it needs some new innards.
Nice thing is that it breaks down pretty easily, once you find the hidden screws holding it together:
OK – a week or so later, and I have an hour to kill while waiting for a render. So let’s investigate.
Motors and motor drivers
First thing: the motors driving the axes are a bit unusual; they’re 5-phase Sanyo Denki stepper motors. Fancy.
Most steppers and stepper drivers (certainly the ones in my junk bin) are 2 or 4 phase, so I’m hoping there’ll be separate driver boards inside this thing, or I’m going to have to source or build some weird drivers.
Thankfully, when I take the top off, I can see 3 obvious drivers inside…
OK – so each driver has connections to the PSU, connections to the motor (10 wires) and 6 wires going off to the controller board.
Need to know what those wires do. One’ll be GND, but the others..?
I made a quick tap: something I can plug between the control cable and the socket to give me an easier way to probe the wires in-situ. The photo makes it look like half the solder is shorting out, but it’s a bad photo. I mean, it’s terrible soldering, too, but not quite as bad as the pic makes it look, honest:
Now I can hook a scope to those pins and see what happens when you use the pendant to make the robot do something:
I can see broadly which wires do what now. Time to rip out all the controllers and bits and pieces I don’t need from the robot and replace them with an interface board. This connects to a computer via USB, and has a bunch of input and output connections I can use to control and watch things:
One minor issue: stepper drivers are usually controlled with two inputs, STEP (pulses to make the motor move) and DIR (to choose which direction the step pulses should make the motor move, clockwise or counterclockwise). The stepper drivers in this robot are different; they have two step inputs – one for each direction, CW and CCW. I’ve got a number of interface boards I can use to connect a computer to stepper drivers, but none can handle this setup. Not the end of the world; for simplicity and speed I grabbed an Arduino Nano and wrote a tiny program to convert between them. Plug STEP and DIR signals in one side, and get CW and CCW pulses out the other. That’s it sitting on a huge prototyping board, top left:
Ended up making a tiny version I could fit neatly, but never got a picture.
Power
The robot has a fairly decent PSU in it, providing 24V for the motors, 5V and 12V for other bits and pieces. Most of the outputs are switched off by default, as the robot’s controller would only switch everything on if it deemed all was good, none of the safety cutouts had been tripped. Now I’d ripped out the controller, the PSU needed a naughty bypass fitting so it’d turn on properly. Fancy way of saying “connect the two end pins on this connector if you want everything to switch on”:
First run
OK – motors now worked, and with a bit of faffing about I got the various sensors hooked up too, so we can tell when an axis is about to hit its end stop. I should be able to get the robot to move, now, but it needed one more thing: a tool. I’d got an old spindle motor (drill, basically), so I mounted it to a bit of Acetal and stuck it on the robot’s Z axis. Time to hook it up to a computer and try making it move… I grabbed an old tablet PC and installed Mach 3 on it (CNC software), connected the USB cable, powered it up, and loaded an old PCB design. After a bit of tweaking of speeds:
Not bad for a first attempt: