CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > MetalWorking > Bending, Forging,Extrusion...


Bending, Forging,Extrusion... Discuss Bending, Forging, Extrusion technique's here.


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 11-06-2008, 06:13 AM
 
Join Date: Jun 2005
Location: Indianapolis, IN, USA
Age: 26
Posts: 86
supahonkey is on a distinguished road
CNC Tube Bender with Mach3 Question

I am almost done making my tube bender. The last part that I have to complete is the CNC control. I have a Vickers directional control valve that is currently controlled by a foot switch. I am buying a breakout board and a relay board from CNC4PC.com to control the valve. I have programming experience in Visual Basic, but know nothing of programming in Mach 3.

I know this is a general question, but how difficult would it be to program Mach 3 to send a 5v signal to a pin? This pin would then energize a relay, which energizes a coil and causes the cylinder to extend?

I would want it to send power to that pin until a specified position is reached. This will be determined by user input. Die position will be read from a rotary encoder. Lastly, I would like Mach3 to send 5v to another relay (my relay board has two relays on it) to energize the opposite coil, causing the cylinder to retract.

I would like two fields in Mach3: one for degrees of bend and one for spring back. I would like to hit enter and have the PC control the valve. Is this something most easily achieved with Mach3?
Reply With Quote

  #2   Ban this user!
Old 11-06-2008, 06:41 AM
 
Join Date: Dec 2004
Location: usa
Posts: 1,665
TOTALLYRC is on a distinguished road

Originally Posted by supahonkey View Post
I am almost done making my tube bender. The last part that I have to complete is the CNC control. I have a Vickers directional control valve that is currently controlled by a foot switch. I am buying a breakout board and a relay board from CNC4PC.com to control the valve. I have programming experience in Visual Basic, but know nothing of programming in Mach 3.

I know this is a general question, but how difficult would it be to program Mach 3 to send a 5v signal to a pin? This pin would then energize a relay, which energizes a coil and causes the cylinder to extend?

I would want it to send power to that pin until a specified position is reached. This will be determined by user input. Die position will be read from a rotary encoder. Lastly, I would like Mach3 to send 5v to another relay (my relay board has two relays on it) to energize the opposite coil, causing the cylinder to retract.

I would like two fields in Mach3: one for degrees of bend and one for spring back. I would like to hit enter and have the PC control the valve. Is this something most easily achieved with Mach3?
To turn the pins on and off, all you would have to do is is incorporate it into the g code.
Use m03 to start the movement and m04 to cause it to retract. M05 to turn both of these off. You will set up which pin does what under the ports and pins page. This is why you bought the breakout board.

Mach3 doesn't read encoders directly, but some of the motion control boards do. The more knowledgable amongst us will help out here.

Here is the edit.
As long as the speed of the bender is not stupid fast, you could possibly hook the a and b from the encoder to 2 inputs and then count these inputs until they get to the right amount and then sent it back the other way.

You could even hardwire a switch from the breakout board to a control box and not even need to use a keyboard. You would set this input to activate the cycle start.
It would be very possible to reduce the keys needed to just a few and use keygrabber to work with a number pad only.
You would also want to check the box under the general set up tab to have it rewind the gcode when it is at the end of cycle. This way it is always ready to go.
The hard parts are going to get the readngs from the encoder in to mach3 and to be able to get it to handle the changes in angles.

If you can break it down to a half dozen angles and then select them from a list it might make it easier

Depending on your budget, you just might be better off buying an inexpensive plc and touchpanel.
I would just make sure that the plc in question can take encoder inputs. If so the writing of the ladder logic wouldn't be tough.
The operator enters the desired value on the screen and it gets entered into a register. Hit start. The 1st valve opens until the encoder counts agree with the register value and then the other valve opens until it hits a return limit switch then it stops. All ready to go again. If you wanted really basic, you could just use some wheels with numbers to write directly to the registers, I can't remember what they are called. No computer or display needed.


Mike
__________________
Warning: DIY CNC may cause extreme hair loss due to you pulling your hair out.
Reply With Quote

  #3   Ban this user!
Old 11-06-2008, 07:49 AM
 
Join Date: Jun 2005
Location: Indianapolis, IN, USA
Age: 26
Posts: 86
supahonkey is on a distinguished road

I would appreciate it if anyone could lead me in the right direction regarding motion control boards that can read rotary encoders.

I am stuck on using a PC. I just built one and am very close to purchasing Mach3. I like the idea of hooking my tube bender to my wireless network and doing the programming from my laptop on my couch.

I have absolutely no clue about G-Code. What do you mean when you say m03, m04, etc. Is that the designation that Mach3 uses to refer to pin numbers?

Thanks for your help, I greatly appreciate it.

Brenton

I like your idea about using two inputs from the encoder, counting them with the computer, then sending a stop signal once the number of counts is correct. I will investigate the logic behind this if I can't find a board that can receieve rotary encoder input.
Reply With Quote

  #4   Ban this user!
Old 11-06-2008, 09:44 AM
 
Join Date: Dec 2004
Location: usa
Posts: 1,665
TOTALLYRC is on a distinguished road
Talking Time to read 'till your eyes bleed

Originally Posted by supahonkey View Post
I would appreciate it if anyone could lead me in the right direction regarding motion control boards that can read rotary encoders.

I am stuck on using a PC. I just built one and am very close to purchasing Mach3. I like the idea of hooking my tube bender to my wireless network and doing the programming from my laptop on my couch.

I have absolutely no clue about G-Code. What do you mean when you say m03, m04, etc. Is that the designation that Mach3 uses to refer to pin numbers?

Thanks for your help, I greatly appreciate it.

Brenton

I like your idea about using two inputs from the encoder, counting them with the computer, then sending a stop signal once the number of counts is correct. I will investigate the logic behind this if I can't find a board that can receieve rotary encoder input.
Go here and download the trial version.

http://www.machsupport.com/downloads.php

Install it on a computer and start the program. On the first page of the program, bottom left is a button labeld g codes and one labeled m codes.
Click them and see what all the fun is.
They will give you a basic rundown of the gcodes involved.

G and M codes are text files that are read by an interpreter in the program itself. The are easily edited in notepad or other basic editor. You don't want fancy formating to mess things up.


M03 is the code to turn the spindle clockwise and M04 is ccw. M05 is to shut the spindle down or in you case cut input to both valves.

http://www.machsupport.com/videos/

Go here and watch a few of the begining vidoes with an adult beverage in one hand and some nice homemade pizza in the other. I find it slows me down enough to watch videos.

http://www.machsupport.com/downloads.php

Go here and read the documents. Even thought they are a little old they are still very good to get you going.
I just used them to get my bridgeport going with analog servo amps and I will be integrating the 24 position tool changer this winter.



Thinking out loud here. If you use a 500 ppr encoder in quad it will give you 2000 counts per revolution. Since your tubing bender will only turn about 3/4 of a revolution in 20 secs, your counting speed should be well within the capabilities of the pport and will save you real money.
I would try to get an encoder that is a multiple of 360. That way you get and even number of encoder counts per degree. Makes it easier to figure out where you are. It might be possible to use an encoder with an index pulse and have the index pulse act as a home.

I think it is very doable. Learning Mach3 will open the way for the milling machine and lathe in your future.


When you are all done let me know if you have any other questions.


Mike
__________________
Warning: DIY CNC may cause extreme hair loss due to you pulling your hair out.
Reply With Quote

  #5  
Old 11-06-2008, 10:06 AM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,533
Al_The_Man is on a distinguished road
Buy me a Beer?

I built a similar system using a Galil Card, these are motion cards that will output a ±10vdc analogue (or stepper-signal) with encoder feedback.
I used a simple off the shelf National Linear IC to output the analogue drive to control the directional servo valve.
The cards I buy are the legacy DMC-1000 series off ebay usually get these for cheap, especially if you only need one axis.
If you wanted to make up a VB interface instead of using native commands they have a VB library.
I also have a DOS based program that operator screens can be made up in minutes, if interested.
The beauty of these cards is you a have a closed loop system.
For this type of application you do not really need G/M codes. just bend information.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 11-06-2008, 12:38 PM
 
Join Date: Jun 2005
Location: Indianapolis, IN, USA
Age: 26
Posts: 86
supahonkey is on a distinguished road

There is already a great deal of information here, thanks a lot guys!

Al - Why would I benefit from getting a Galil card, even if it is cheap, when I can buy Mach3 for $140 and a breakout board with a relay board for $50? It seems as though Mach3 would be easier. Correct me if I am wrong.

It just hit me that the power from the Parallel port will be sent as DC, correct? If this is correct then I must have a way to convert to AC. The power in from the Relay will need to be 120V AC.
Reply With Quote

  #7   Ban this user!
Old 11-06-2008, 12:44 PM
 
Join Date: Dec 2004
Location: usa
Posts: 1,665
TOTALLYRC is on a distinguished road

Originally Posted by supahonkey View Post
There is already a great deal of information here, thanks a lot guys!

Al - Why would I benefit from getting a Galil card, even if it is cheap, when I can buy Mach3 for $140 and a breakout board with a relay board for $50? It seems as though Mach3 would be easier. Correct me if I am wrong.

It just hit me that the power from the Parallel port will be sent as DC, correct? If this is correct then I must have a way to convert to AC. The power in from the Relay will need to be 120V AC.
Just use a 5v relay with 120v contacts.
__________________
Warning: DIY CNC may cause extreme hair loss due to you pulling your hair out.
Reply With Quote

  #8  
Old 11-06-2008, 12:47 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,533
Al_The_Man is on a distinguished road
Buy me a Beer?

You can drive a relay or SSR direct from the parallel port with a 2n7000, a search here will bring many results.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #9  
Old 11-06-2008, 01:02 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,533
Al_The_Man is on a distinguished road
Buy me a Beer?

Originally Posted by supahonkey View Post

Al - Why would I benefit from getting a Galil card, even if it is cheap, when I can buy Mach3 for $140 and a breakout board with a relay board for $50? It seems as though Mach3 would be easier. Correct me if I am wrong.
I did it with the following
1 Axis Galil Card $50.00 Ebay.
DOS Operator interface Key $200.00
ISA bus PC $20.00, (re-cycler).
I encoder $50.00 ebay NOS
1 National Semi $7.00 Servo valve drive.
Power supplies.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #10   Ban this user!
Old 11-06-2008, 06:31 PM
 
Join Date: Jun 2005
Location: Indianapolis, IN, USA
Age: 26
Posts: 86
supahonkey is on a distinguished road

Excuse my limited knowledge on electricity, but won't a PC output DC? Can a relay receive 5V DC, but have 120V AC contacts? That doesn't sound right!

Al, I will definitely have a look at your ideas. I am rather stuck on the breakout board/relay board even though it may cost more. I have a Bridgeport Series II Prototrak mill. The mill was in a fire. Most of the Prototrak electronics are fried (pieces of burning insulation fell from the wood ceiling) but the mill is in great shape. Once the tube bender is complete, I will be working on replacing the burnt servo motors with stepper motors. I want to use the same system (breakout board, Mach3, etc) as my tube bender. If I can become familiar with that setup on my tube bender, the mill will be easier.
Reply With Quote

Sponsored Links
  #11  
Old 11-06-2008, 07:16 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,533
Al_The_Man is on a distinguished road
Buy me a Beer?

Originally Posted by supahonkey View Post
Excuse my limited knowledge on electricity, but won't a PC output DC? Can a relay receive 5V DC, but have 120V AC contacts? That doesn't sound right!

.
That is the main reason for a relay, for one signal voltage to switch a completely different one, as long as the relay is rated to switch the higher voltage there will be isolation, the same with a SSR or solid state relay.
See post #3 for one of the posts I meant for 2n7000 drive.
http://www.cnczone.com/forums/showth...ghlight=2n7000
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #12   Ban this user!
Old 11-06-2008, 10:27 PM
 
Join Date: Dec 2004
Location: usa
Posts: 1,665
TOTALLYRC is on a distinguished road
Relay capabilities.

Originally Posted by supahonkey View Post
Excuse my limited knowledge on electricity, but won't a PC output DC? Can a relay receive 5V DC, but have 120V AC contacts? That doesn't sound right!

Al, I will definitely have a look at your ideas. I am rather stuck on the breakout board/relay board even though it may cost more. I have a Bridgeport Series II Prototrak mill. The mill was in a fire. Most of the Prototrak electronics are fried (pieces of burning insulation fell from the wood ceiling) but the mill is in great shape. Once the tube bender is complete, I will be working on replacing the burnt servo motors with stepper motors. I want to use the same system (breakout board, Mach3, etc) as my tube bender. If I can become familiar with that setup on my tube bender, the mill will be easier.
I have some really nice ssr's (solid state relay) that take 3 to 30v dc on the control terminals and will switch 240v on the switched terminals.
Do a search on ebay and you will see a fine selection.
If you bought a breakout board and a relay board from a cnc supplier, such as candcnc or cnc4pc or one of the others that advertise here, you just might have what you need sitting on your desk.
Let us know what you have or will purchase.

Take a look at my retrofit log here.
http://www.cnczone.com/forums/showthread.php?t=66994
for ideas on how to do something like what you are planning on doing to your bridgeport.

Mike
__________________
Warning: DIY CNC may cause extreme hair loss due to you pulling your hair out.
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does Anyone Have Old Pines #4 Tube Bender For Sale? morribi Bending, Forging,Extrusion... 1 10-02-2008 04:57 PM
Leonard tube bender collet lazerracing Bending, Forging,Extrusion... 0 12-16-2007 07:37 PM
DIY Tube Bender Sperstad Bending, Forging,Extrusion... 1 10-11-2007 08:13 AM
Tube bender controller PSIman General Electronics Discussion 2 01-18-2006 03:07 AM
Help Building Tube bender Fabric8r General Electronics Discussion 1 10-09-2004 12:45 AM




All times are GMT -5. The time now is 07:26 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361