Arduino controlled tube bending controller

Hi all, I've been trying to work out the details for a controller for a tube bending machine. The type of machine I'm talking about can be seen here

I have the basic idea of how I need to break down this project.

Part1
The bender currently runs on twelve 120vac hydraulic valves that are controlled by solid state relays. I'm wondering is there anything out there like a 2n2222 transistor bank?

Part2
The bend arm position is located by a 3600 count quadrature encoder. I don't know the best way to retrieve the output from the encoder and not loose a bunch of data in the meantime.

Part3
Operator controls, this will just be approximately eight or nine digital inputs Manual/Auto, Reverse, Forward, CD Clamp, CD Unclamp, Mandrel Ext, Mandrel Fwd, and PDA.

Part4
Display interface, they currently use a 2X20 display it's the expensive vacuum tube style. I'm thinking I want a standard LCD.

There are a few other proximity sensors for the home switch, mandrel back, clamp die in, and pressure die in, that I can worry about once I get past the more elaborate sections of the project.

Oh, anyone have any recommendations for drawing up prototype PCB?

I think this is fairly doable any ideas, questions, or input would be most appreciated. Thanks.

I'm wondering is there anything out there like a 2n2222 transistor bank?

A transistor array like the ULN2803 is like a "transistor bank".

The bend arm position is located by a 3600 count quadrature encoder. I don't know the best way to retrieve the output from the encoder and not loose a bunch of data in the meantime.

It all depends on how fast the encoder value changes. As long as it's not "too fast" (I'd say nothing more than 10000 pulses per second) then your Arduino should be able to keep up just by getting an interrupt on each change.

Oh, anyone have any recommendations for drawing up prototype PCB?

Draw up a block diagram first of all your components, how they interact, where power is coming from/going to, etc. before even starting to think about the PCB. Just my recommendation.

--
The DIN Rail Mount kit for Arduino: quickly attach your Arduino to standard DIN rail

If it has solid state relays then they are optoisolated already.. Can't you just control them directly with Arduino?? Why the transistors?

Google (arduino "quadrature encoder") gets lots of ideas....

You can always use good old relays (maybe optically isolated ones like these) http://arduino-direct.com/sunshop/index.php?l=product_detail&p=156 if you don't want direct wiring to the machine..

Let us know how you progress!

DISCLAIMER: I mentioned stuff from my own Shop...

That's all quite doable.

  1. A relay or IO board like Terry suggested.
  2. You need to see if you can get access to the outputs of this encoder.
  3. All simple.
  4. Yep, an LCD.

Two things to think about.

Getting inputs from sensors/switches on the machine, that's a longish cable run in a noisy environment, I would not run Arduino inputs directly. Maybe isolate with opto couplers or at least harden them with a series resistor and clamping diodes.

The two safety mechanisms (SICK and palm buttons), try not to implement that functionality with the Arduino but rather leave them as is. I'm not sure how OH&S will view an non-certified program handling these functions. I'd hate the thing to fire up at the wrong time because your code has & instead of &&.

As for doing a PCB, there are many free PCB design packages, Eagle is probably the most common but you can only do boards up to (I think) 60x100mm with the free version.


Rob

I forgot to mention that the bender in the video isn't the exact one, it's the same style but we have a different controller on it and no SICK safety sensor. Link to the controller we have on it now.

RuggedCircuits:
A transistor array like the ULN2803 is like a "transistor bank".

Thanks for the info on the array this should come in useful.

The encoder it self is mounted directly on the pivot point on the arm, so it never actually makes it more than 3/4 of a revolution and that's in at least 3-4 seconds. So maybe 900 counts per second.

I haven't done a lot of research into it yet but I'm thinking what I read on count loss had to do more with the high RPM than anything else. I'll have to do some testing.

Just for reference
Accu-coder 702-30-S-3600-Q-HV-5-K-2-SY-N-N

It currently has a rack of opto 22 G4 OAC5 for the outputs and G4 IAC5 for the inputs they all mount to an interface board similar to the one I linked below, the specs are in the links

http://www.opto22.com/site/pr_details.aspx?cid=4&item=G4OAC5
http://www.opto22.com/site/pr_details.aspx?cid=4&item=G4IAC5
http://www.opto22.com/site/pr_details.aspx?cid=4&item=G4PB16H

I could be wrong but even at 5 volts I didn't think the small power supply would be able to handle the current needed to turn them on or off. If I am wrong that would be nice to take that out of the equation.

Graynomad:
Getting inputs from sensors/switches on the machine, that's a longish cable run in a noisy environment, I would not run Arduino inputs directly. Maybe isolate with opto couplers or at least harden them with a series resistor and clamping diodes.

The two safety mechanisms (SICK and palm buttons), try not to implement that functionality with the Arduino but rather leave them as is. I'm not sure how OH&S will view an non-certified program handling these functions. I'd hate the thing to fire up at the wrong time because your code has & instead of &&.

As you've read the input are isolated the only inputs that I was contemplating on wiring directly would be the selector switches on the control panel.

We usually have a safety mat connected to a safety relay and the hand palms go throw another relay with timing logic. This make sure the operator can't tape one of the buttons down and try to operate it.

Both of these would be separate from the arduino. The mat cuts the power directly to the clamping cylinders and hand palms I believe go to an opto input. Ill have to check that last one.

I have some parts coming and need to gather the rest from the bender. Thanks for all the posts and advice.

I just slapped on the encoder to see how well it worked. I'm not positive that I will even need all the channels on the encoder. It looked fairly accurate from what I could see using a marker and my fingers. It will be a lot more noticeable when there is a 600LBS four food door hanging off of it.

I grabbed the code from Karl and bluemarble

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1185064568/0

Hi,
About the OPto22's...
---------------------( COPY )--------------------------
It currently has a rack of opto 22 G4 OAC5 for the outputs and G4 IAC5 for the inputs they all mount to an interface board similar to the one I linked below, the specs are in the links

http://www.opto22.com/site/pr_details.aspx?cid=4&item=G4OAC5
http://www.opto22.com/site/pr_details.aspx?cid=4&item=G4IAC5
http://www.opto22.com/site/pr_details.aspx?cid=4&item=G4PB16H

I could be wrong but even at 5 volts I didn't think the small power supply would be able to handle the current needed to turn them on or off. If I am wrong that would be nice to take that out of the equation.
-----------------( END COPY )----------------------
I have run lots of Opto22 stuff for years (my house in Vermont runs on them).. Plain TTL (Arduino) levels will drive them with no problem.. they only take 12mA. You are in great shape if all that I/O is Opto22, for running with Arduino.

The OPto22 rack itself needs a 5V supply separate from Arduino.. But it probably already has that, right??

Grab a spare OPto22 module or two and run them with Arduino to be sure you see how it works...

This is great news! This makes me upset that I didn't actually look at the datasheet and just read what was on the side of the module. I will let you know how it works out.

Thanks

You've might have to be careful how many you drive at the same time. The absolute max for each VCC and GND pin is 200mA, but given that there's 4 or 5 of each on a Mega I don't know if that means 4 or 5x 200mA or not.


Rob

Graynomad:
You've might have to be careful how many you drive at the same time. The absolute max for each VCC and GND pin is 200mA, but given that there's 4 or 5 of each on a Mega I don't know if that means 4 or 5x 200mA or not.

Thanks for the info. No better way to find out than smoke test. There will never be more than four outputs on and I think 4 inputs. Might as well try running all 16 at once for a few hours to see how it holds up. If it catches fire I'll send pics.

Graynomad:
You've might have to be careful how many you drive at the same time. The absolute max for each VCC and GND pin is 200mA, but given that there's 4 or 5 of each on a Mega I don't know if that means 4 or 5x 200mA or not.


Rob

Yes, it would be good to do the numbers.. But it looks pretty good.. All 12 valves probably not on at once, right?? How many do you thinK? Still that's 144mA total. The operator buttons could go into 1 or 2 Analog inputs for almost zero.

Use an I2C LCD display like this: http://arduino-direct.com/sunshop/index.php?l=product_detail&p=170 for 18 bucks and that's only 2 more Analog pins and almost no current..

Bet it can fly.... You could almost fit it in a UNO...

DISCLAIMER: I mentioned stuff from my own Shop...

Well I only had 9 spare opto22 outputs laying around, but they have been running a 10 sec off 30 sec on interval for about an hour or so. I'll probably let it run over the weekend to see if my office burns down.

I Found "DC Current per I/O Pin 40 mA" on the arduino mega spec sheet, so I think it should be fine.

Thanks for the link, but unfortunately I already had a serial and parallel screen in the mail.

Thats the MAX spec, and the 200mA is the total for the chip the separate Vcc and Gnd connections in the carrier is just to spread the power supply across the die, push it more than 200mA and you will have some nice smoke, if you need current just buffer it with some transistors.

Hi,
From another discussion on Arduino Current limitations.. take a look at: http://arduino-info.wikispaces.com/ArduinoPinCurrent

...for the details...

So I didn't burn my office down yet. I cam in to the office and they where still going.

Once the screens show in the mail I'll probably start working on the menu system. One of the problems that I have to deal with is the saving of variables for the timing and probably parts data. I have a micro sd card interface on its way. http://www.gravitech.us/micaad.html

Is there a more permanent solution that micro SD. I didn't want to use the arduino itself, but maybe a secondary EEPROM of some sorts.

If anyone has personal experience with Flash VS EEPROM let me know.