Thursday, February 3, 2011

Manual Controls

CNC is about the computer controlling the movement of the machine, or automatic movement. Essentially programming it to move. The process of machining any given part will usually require multiple operations, or even if just one operation, you have to set it up. You have to mount the stock and position the spindle/cutting tool with respect to the stock. The program to cut the part "thinks" the cutter is in a certain position relative to the stock and you need to put it there.

I have double-ended shafts on my stepper drivers. I intend to remount the handwheels so I can move the machine manually when the system is off. Or do I... I will put the handwheels on. They are special wheels with an embedded quadrature encoder connected to a DRO, or digital readout. But I don't intend to do much of any cranking of these wheels. I think most CNC software packages come with some manual control interface and I could certainly write such a thing for my system. But I don't want to lose out on the ease and speed of using the stepper motors because my computer (laptop) is not nearby and powered up.

I designed this system such that the commands to step the motors comes from an Arduino microcontroller inside the same case as the stepper driver - not from a PC tower computer with keyboard, mouse, and monitor. This means without my laptop connected I still have a "computer" I can write software for and that I can connect with the real world, i.e., connect buttons and other input devices to. With a flip of a switch and a 2 or 3 second pause, I'll be able to start moving the machine around. Sure beats several minutes connecting the computer, booting up, and starting software. I'll be able to do basic machining operations like I do now with the handwheels only faster and with less effort.

Heres a picture of an industrial control unit for a CNC machine:



Many of these look OK, but I'm not buying one and I want something cooler. I've worked with the Arduino before, I built a free-space "joystick" for the computer with an accelerometer. I knew I could connect various common input devices like the Wii Nunchuck or PlayStation controllers. It seems like a joystick would be natural for moving the X/Y table around. Some button for toggling to the Z axis would be fine. The Wii Nunchuck has only 2 buttons. The PS controller has way more than I could use. I think the PS controller has an LED or 2 but I wasn't sure I could control them. The Wii has none. So I'd need some other device for feedback, like what "mode" I am in or something. In any case, with both of these devices I'd have to find someone else's software to control it and possibly deal with voltage level differences and so on. I didn't want to have to struggle with this part of the system. I also didn't want to have to hold the controller.

Then I though about an "old school" PC analog joystick. These have a bunch of buttons and at least 2 potentiometers for joystick position. I could rip out any electronics and easily connect things directly to the Arduino. But still nothing for feedback. I want to be able to walk up to it and know if it's in Z axis mode or X/Y axis mode, for example. Also, I felt the options looked kind of cheap. I wanted something really tough. Like arcade controls.

I attempted to win a couple of eBay auctions for this puppy:


This thing is built like a tank. It's got 4 buttons plus a 4-way "hat switch". That seemed like enough for me. These things sell for over $200 each. The full video game, Blazing Angels, runs over $10K. So not surprisingly, the bidding quickly went over my maximum amount. After losing twice, I thought things through some more. I thought about how I would program a joystick. How would I manage acceleration, for example? What would I do if the stick was far left and then jerked far right? One control I want while running cutting programs is a feed speed override. I could move the joystick forward and back to do this, but it didn't seem quite right. And still no visual feedback for manual settings.

I tooled around some more looking for arcade controls. It seems there's a pretty big market for people making their own arcade machines wrapped around a PC. I found a listing for a switch-based joystick and 6 buttons with LEDs to light them up.


Arcade buttons are pretty darn tough, too, with people pounding on them all day. But the switching joystick was less appropriate than an analog joystick - no proportional control.

Then I found this:
This is a brand new arcade throttle control with full proportional output (potentiometer) that springs back to center and has a thumb button (not pictured). This is perfect for feed speed override and controlling the speed in manual mode. The arcade buttons can then be laid out to control the mode and direction of movement. I figure 4 buttons in cardinal positions to enable direction, a button in the middle to toggle between X/Y and Z, and another button for "nudging". The buttons would light up according to the selection. In "non-nudge" or normal mode, pressing the button on the throttle would make it go and the position of the throttle would change the top speed. In nudge mode, the position of the throttle would change the distance, say 0.5, 1.0, 5.0, 10.0, 15.0 thousands of an inch and each press of the throttle button would move the mill that amount.

This throttle control sells for $90. I got lucky and won it for the opening bid of $9.99 + $10.50 shipping. That's pretty awesome!

It seems many of the arcade buttons with LEDs have LEDs that are 12 volts. I'll be running 5V so I think I'll pick up some "translucent" buttons and add my own lights.

2 comments:

  1. Daryl

    I bought a couple of arcade buttons a little while back. They are 12 Volt, but are easily taken apart and the resistor inside can be swapped to work with 5V. They use standard LEDs.

    Another (crazy) suggestion: You could buy a remote control plain transmitter (for example, ebay 'transmitter rc 6ch'). They tend to have fairly sensitive, balanced joystick handling. Around $30 shipped.

    ReplyDelete
  2. Thanks for the tips on the LED arcade buttons, I haven't ordered anything yet. That should save me a little work.

    On the RC controller, I considered it. I have a 6ch Futaba SkySport. I'm concerned about noise/interference but also I don't want the Arduino doing to much work decoding the PWM signals from the receiver. Plus I really like the arcade controls idea!

    ReplyDelete