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! > Machine Controllers Software and Solutions > LinuxCNC (formerly EMC2)


LinuxCNC (formerly EMC2) Discuss LinuxCNC (formerly EMC2) Controlers here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 05-12-2009, 07:09 AM
 
Join Date: Feb 2006
Location: usa
Posts: 33
greeder88 is on a distinguished road
Time delay command for tool changer?

Is there a time delay command in EMC2?
I would like to use time delay on a tool changer instead of limit switches.
Need to move pneumatic cylinders and if I can allow 3 seconds to complete the move before the next one starts I free up a lot of switches.

If there is how do I implement it?
Reply With Quote

  #2   Ban this user!
Old 05-12-2009, 09:49 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

How are you controlling the tool changer now? Classicladder , a HAL component , or a user M-code script? Classicladder has timers, HAL has a timedelay component . M-code scripts I'm sure can do a time delay or could even use G4 (dwell) as a time delay (not a very good final solution but an easy way to test.)
See the Manual (or man pages) for specific info.
Reply With Quote

  #3   Ban this user!
Old 05-13-2009, 05:00 AM
 
Join Date: Feb 2006
Location: usa
Posts: 33
greeder88 is on a distinguished road

I will use M code if I can get a handle on it. Chapter 12 in the manual is about as usefull as Custer saying "Go West Young Man". I sure could use an example of a simple custom M command. What to put and where? Say for example I have a solenoid wired to pin "X" and want to turn it on for 2 seconds and off. Anyone know how to do this? Where did you find the information? Do I put something in my hal file? Do I need something in my ini file before I put something in my hal file? Without examples I'm lost.
Reply With Quote

  #4   Ban this user!
Old 05-13-2009, 09:37 AM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

Here is the html manual (this is for EMC 2.3) entry about user M codes:
http://www.linuxcnc.org/docs/2.3/htm...:M100-to-M199:
I think It is actually in the user manual that comes with EMC.
Anyways I think that if you add 'wait 2' after the hal comand, then the BASH script will pause for 2 seconds (I will have to try this later gotta go to work!)
Did you thind this entry in the manual? Specific questions about the example?
Reply With Quote

  #5  
Old 05-13-2009, 10:20 AM
Switcher's Avatar
Moderator
 
Join Date: Apr 2005
Location: Vectorink.com
Posts: 3,660
Switcher is on a distinguished road

I don't run EMC2, will ( G04 P3000 ) or ( G04 F3000 ) work?
__________________
Free DXF Files - Vectorink.com - myDXF.blogspot.com
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 05-13-2009, 03:03 PM
 
Join Date: Feb 2006
Location: usa
Posts: 33
greeder88 is on a distinguished road

I have my tool changer designed but I need EMC2 to talk to it. Here is what I did:
Made the tool carousel the 4th axis. Basically a rotary table. I rotate to any tool I want.
The G code "G0A1.0" selects tool #1 on the carousel or "G0A8.0" selects tool #8.

I control the loader arm with 3 pneumatic cylinders in a series of 9 canned commands to load and 10 to remove a tool. I do this with 3 pins (On-Off). I need a delay to allow a move to finish before the next one starts. I am thinking two M codes. M101 to remove a tool and M102 to load a tool.

The M101 would power pin 1,2,&3///remove juice from pin1/// remove juice from pin 2///Power pin 1/// etc. The /// is a 2 second delay.
Reply With Quote

  #7  
Old 05-13-2009, 03:43 PM
Switcher's Avatar
Moderator
 
Join Date: Apr 2005
Location: Vectorink.com
Posts: 3,660
Switcher is on a distinguished road

Like I said before, sounds like you want to add some "Dwell Time", I don't run emc2 so all I can go by is whats on the .net.

Anyway, this link says emc2 Dwell Time works the same as most cnc controls I've used.

G4 P Dwell (no motion for P seconds)
So I'm thinking what you need is something like this:

( G04 P2000 ), for every one of your /// (The /// is a 2 second delay.)


.
__________________
Free DXF Files - Vectorink.com - myDXF.blogspot.com
Reply With Quote

  #8   Ban this user!
Old 05-13-2009, 05:08 PM
 
Join Date: May 2006
Location: UK
Posts: 85
kudos is on a distinguished road

if u want a delay in an m code u can do

sleep 2.0

this will sleep for 2 seconds but this is not in real time memory so it can be + or - a few hundred milliseconds depending on the computer etc
i would stay away from Mcode tool changer if this is a machine of any size/power etc use Mcode to test a changer or have a manual way to get out of it in MDI only if it gets stuck etc


so for exsample u could do this to turn a classicladder function input on and off with a 2second delay

say we want M101

make a file called M101 in NC_Files folder
make it executable (see EMC Gcode manual)
add these lines

Code:
#!/bin/bash

#tool changer Mcode functions
#turn a hal pin on and off

halcmd setp classicladder.0.in-26 True
sleep 2.0
halcmd setp classicladder.0.in-26 False

exit 0
u can change the classicladder.0.in-26 to any other pin u like or any otehr halcmd i belive too.

hope this helps

can you do a
G0 A1
M06

feed the M06 from HAL to classic ladder and back when tool is changed?

hope this helps
Reply With Quote

  #9   Ban this user!
Old 05-13-2009, 07:17 PM
 
Join Date: Feb 2006
Location: usa
Posts: 33
greeder88 is on a distinguished road

Just what I was looking for! Great examples! The G04P2000 is good but the sleep 2.0 is better. So I can make a file like this:

#!/bin/bash
#tool changer Mcode functions
#turn a hal pin on and off

halcmd setp classicladder.0.in-24 True
halcmd setp classicladder.0.in-25 True
halcmd setp classicladder.0.in-26 True
sleep 2.0
halcmd setp classicladder.0.in-24 False
sleep 2.0
halcmd setp classicladder.0.in-25 False

#on and on until complete

exit 0

Put it in the NC_Files folder , call it M101, make it executable, and it will
run any time I add a M101 to my cutter program?

Sounds too easy.
Reply With Quote

  #10   Ban this user!
Old 05-13-2009, 07:23 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

Originally Posted by greeder88 View Post
I have my tool changer designed but I need EMC2 to talk to it. Here is what I did:
Made the tool carousel the 4th axis. Basically a rotary table. I rotate to any tool I want.
The G code "G0A1.0" selects tool #1 on the carousel or "G0A8.0" selects tool #8.

I control the loader arm with 3 pneumatic cylinders in a series of 9 canned commands to load and 10 to remove a tool. I do this with 3 pins (On-Off). I need a delay to allow a move to finish before the next one starts. I am thinking two M codes. M101 to remove a tool and M102 to load a tool.

The M101 would power pin 1,2,&3///remove juice from pin1/// remove juice from pin 2///Power pin 1/// etc. The /// is a 2 second delay.
This is exactly what Classicladder was made for.
Personally i would have classicladder completely control the turret and cylinders. There is a sample idea on this page:
http://wiki.linuxcnc.org/cgi-bin/emc...er_tool_turret
Though that is for a stand alone program (doesn't use EMC) but could be the basis of what you want. It connects CL to a step generator and CL commands the positions directly. Then I would connect it to EMC so normal tool change (T and M06) calls talk to CL.
But if the M code works for you then thats all that matters!
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 05-14-2009, 02:05 AM
 
Join Date: May 2006
Location: UK
Posts: 85
kudos is on a distinguished road

justa ward of warning
as the file is pins 24, 25,26 will all turn on pritty much at the same time give or take a few nS so be carefull see ur feeding classicladder so maybe u have timers there

Once i have my Toolchanger working in classicladder i plan to add it to the emc wiki for others to reference as a starting point
Reply With Quote

  #12   Ban this user!
Old 05-14-2009, 03:58 AM
 
Join Date: Feb 2006
Location: usa
Posts: 33
greeder88 is on a distinguished road

Simplicity is my goal in life so M code is a winner. Now comes the problem of disaster planning. After the cycle is complete the machine needs to know that it all went well before it starts milling my $500.00 block of steel. How do I add a limit switch checker command? I need one switch to know that the cutter actually came out of the spindle and isn't still stuck before it starts cutting and I am in the house watching tv. It needs to go in the M command at the end before M3 spindle start.
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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hoss 16 Tool Automatic Tool Changer hoss2006 Benchtop Machines 316 03-03-2011 03:29 PM
TM3 tool changer delay hankster Haas Mills 8 11-02-2008 06:28 PM
Need Help!- Tool Changer picks up wrong Tool? KJ45 General Metal Working Machines 6 03-13-2008 06:51 AM
tool changer axkiker DIY-CNC Router Table Machines 13 03-09-2008 07:28 PM
640T Tool eye sensor delay time out Shotout Mazak, Mitsubishi, Mazatrol 2 07-03-2007 11:04 AM




All times are GMT -5. The time now is 05:36 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