585,886 active members*
6,247 visitors online*
Register for free
Login
Results 1 to 19 of 19
  1. #1
    Join Date
    Feb 2006
    Posts
    40

    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?

  2. #2
    Join Date
    Nov 2005
    Posts
    496
    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.

  3. #3
    Join Date
    Feb 2006
    Posts
    40
    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.

  4. #4
    Join Date
    Nov 2005
    Posts
    496
    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?

  5. #5
    Join Date
    Apr 2005
    Posts
    3634
    I don't run EMC2, will ( G04 P3000 ) or ( G04 F3000 ) work?
    Free DXF - vectorink.com

  6. #6
    Join Date
    Feb 2006
    Posts
    40
    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.

  7. #7
    Join Date
    Apr 2005
    Posts
    3634
    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 - vectorink.com

  8. #8
    Join Date
    May 2006
    Posts
    107
    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

  9. #9
    Join Date
    Feb 2006
    Posts
    40
    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.

  10. #10
    Join Date
    Nov 2005
    Posts
    496
    Quote 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!

  11. #11
    Join Date
    May 2006
    Posts
    107
    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

  12. #12
    Join Date
    Feb 2006
    Posts
    40
    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.

  13. #13
    Join Date
    May 2006
    Posts
    107
    i dont realy understand how you are putting it all together, but EMC when u issue a M06 outputs a tool change command and pauses all motion untill the m06 gets ok signal back then EMC will continue

    look at signals
    iocontrol.0.tool-change
    iocontrol.0.tool-changed

    to change tool i dont know how u relase the tool etc, so cant give any real hints here, if its a draw bolt type or what?
    realy this is where a classicladder toolchanger comes in that is interlocked etc.

  14. #14
    Join Date
    Feb 2006
    Posts
    40
    I just need a signal from a switch to be detected by EMC2. Like a limit switch. It should wait for it to continue. I assume this can be done. If no switch signal nothing happens next.
    Here are the fake commands I am looking for only I need ones that really work:
    If pin 10 true //@ continue on
    If pin 10 false //@ stop
    I can wire a switch to the arm so when it returns to home position it gives the go ahead.

  15. #15
    Join Date
    Feb 2006
    Posts
    40

  16. #16
    Join Date
    May 2006
    Posts
    107
    how about the feedhold,
    when switch is broken machine is in feedhold
    when it is made/on all is ok emc will not be in feeedhold

    the pin u need to address is
    motion.feed-hold

    rob

  17. #17
    Join Date
    Nov 2005
    Posts
    496
    Just remember feed hold can be masked by the user. Other wise it would work. connect it to a parport pin.
    Using the tool changing commands T and M06 is a better way and more work

  18. #18
    Join Date
    Feb 2006
    Posts
    40
    Now that the examples are missing I am getting confused again. How do I use "motion.feed-hold"?

    T and M06 are hard coded aren't they? How would I put any commands in there?

  19. #19
    Join Date
    May 2006
    Posts
    107
    all the info is in the integrator manual P43
    motion.feed-hold (bit, in) When Feed Stop Control is enabled with M53 P1, and this bit is TRUE, the feed rate is set to 0.

    as has veen said it should all be interlocked into the Txx and M06 commands so if M06 does nto complete the machine will just wait untill it does,

    when Txx is issued this puts out the tool number value onto pin
    iocontrol.0.tool-prep-number (s32, out) The number of the next tool, from the RS274NGC T-word
    & inables this bit
    iocontrol.0.tool-prepare (bit, out) TRUE when a tool prepare is requested

    and waits for a
    iocontrol.0.tool-prepared (bit, in) Should be driven TRUE when a tool prepare is completed
    so say tool is in position

    the M06 command outputs
    iocontrol.0.tool-change (bit, out) TRUE when a tool change is requested
    & waits for
    iocontrol.0.tool-changed (bit, in) Should be driven TRUE when a tool change is completed

    I belive u need to complite iocontrol.0.tool-prepared before emc will go into M06 command. becasue as it is i belive its gear more towards random changer , IE u can index to a tool have it facing the spindle, where u can take tool from spindle and pocket at the same time and swop them around.

Similar Threads

  1. Hoss 16 Tool Automatic Tool Changer
    By hoss2006 in forum Benchtop Machines
    Replies: 316
    Last Post: 03-03-2011, 10:29 PM
  2. TM3 tool changer delay
    By hankster in forum Haas Mills
    Replies: 8
    Last Post: 11-03-2008, 01:28 AM
  3. Tool Changer picks up wrong Tool?
    By KJ45 in forum Uncategorised MetalWorking Machines
    Replies: 6
    Last Post: 03-13-2008, 12:51 PM
  4. tool changer
    By axkiker in forum DIY CNC Router Table Machines
    Replies: 13
    Last Post: 03-10-2008, 01:28 AM
  5. 640T Tool eye sensor delay time out
    By Shotout in forum Mazak, Mitsubishi, Mazatrol
    Replies: 2
    Last Post: 07-03-2007, 05:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •