586,556 active members*
3,368 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Fanuc > adding code to move near home(0) and waite
Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2007
    Posts
    26

    adding code to move near home(0) and waite

    I have more than 100 programs created with alphaCam,
    Each of them perform a routine twice, once on each side of table.
    This allows operator to remove and replace stock on one side while otherside is being cut.
    I now need to edit each by adding code after the first operation that;
    1) raises the head? (may not be correct term)
    2)moves the head to a specified location like X10,y20,z0
    3) turns off spindle and wait for input to repeat first operation.

    Due to changes in our process we are now using just one side of table and operator stops the machine by breaking light curtain, turns machine to manual, raises spindle, turns it off and moves head out of the way to remove and replace stock. hits reset on the consol for the program then starts the routine over.

    I would like to have this done automatically and just have the machine wait for operator to change stock and press the cycle start button.

    I did not see a way to post attachment and was not sure if I should post code in this block

    advice please.

  2. #2
    Join Date
    Aug 2011
    Posts
    2517
    Can't you just add something like this to the end of the program?

    G0 Z20.0 (RAISE HEAD)
    G0 X0 Y20.0 (MOVE TO A SPECIFIC LOCATION)
    M5 (SPINDLE OFF)
    M0 (WAIT)
    M99 (REPEATS THIS PROGRAM FROM THE BEGINNING)
    M30 (WILL NEVER REACH THIS)

  3. #3
    Join Date
    Jan 2007
    Posts
    26
    yes yes yes, I am sure this is what I am looking for. just one issue I can not find. There is another vertical movement other than the z axis that must be made before I cross the center of the table where there is fixturing that will be hit by tool. On the operator control panel (Andi Machine) there are two buttons one turns spindle off, the other raises the whole head where motor and spindle are mounted. I found from your code and looking at mine and the book that My spindle off is M15 because I have two spindles and spindle one is the only one we use, just like tools are refferenced T15 spindle one tool 5.
    But that looks like 99.9 percent of what I need.

  4. #4
    Join Date
    Oct 2012
    Posts
    0
    with turning, you can use

    G30 U0.0 W0.0

    this is a pre defined safe position for the axes like the reference postion (dont actually know if it goes to the reference) , if you write all the axes in the one G30 line it will move them all together which may collide with a job etc so you'd write it as

    G30 U0.0
    G30 W0.0

    That way it would return the X axis first, then the Z axis, depending on which axis you want to move first just enter that one before the other. Once returned you can use what fordav11 said,

    M5; ( Depending on which spindle)
    M0;
    M99;

    Hope this helps

  5. #5
    Join Date
    Dec 2008
    Posts
    3110
    You can modify fordav's code


    G0 G28 G91 Z0. (RAISE HEAD to Z HOME REFERENCE POSITION)
    G0 G28 G91 Y0. ( Move table to Y HOME REFERENCE POSITION )
    G90 ( switch back to absolute mode )
    G0 Xxx.xx M9 (Move to a specific X location in the active co-ordinate system, turn coolant OFF )
    M5 (SPINDLE OFF)
    M00 ( program stop, PRESS cycle start to continue )
    M99 (REPEATS THIS PROGRAM FROM THE BEGINNING)
    M30 (WILL NEVER REACH THIS)

  6. #6
    Join Date
    Jan 2007
    Posts
    26
    Thanks everyone, with your help I learned enough to find the rest in manual. FYI the movement I was looking for was listed as M-Code, spindle function; 1--spindle down, 2-spindle up 3-spindle on and as listed already 5-spindle off. So I just need to insert M12 to rease spindle one up, I suppose I will put it at the beginning. thanks everyone again.

  7. #7
    Join Date
    Jan 2005
    Posts
    15362
    jrick

    G0 Z20.0 (RAISE HEAD)
    G0 X0 Y20.0 (MOVE TO A SPECIFIC LOCATION)
    M5 (SPINDLE OFF)
    M9 (if you are using coolant)
    M30 (Program rewind) waits for you to press start)

    This is all you need nothing else is needed
    Mactec54

  8. #8
    Join Date
    Jan 2007
    Posts
    26
    SORRY MACTEC54 GO Z20.0 YIELDS AN OVERTRAVEL ALARM ON Z AXIS.
    TRIED YOUR CODE. i ADDED M12 THIS RAISED THE HEAD AS I NEED
    BUT THEN IT DID NOT MOVE TO X OR Y LOCATIONS.

  9. #9
    Join Date
    Jan 2005
    Posts
    15362
    jrick

    If it gives you an over travel you just ajust the numbers to suit your machine
    Like G0 Z3. or Z0.0

    If your machine does not have 20.00in of travel in the Z axes it sure is going to alarm out

    What control do you have, & are you using metric or Inch
    Mactec54

  10. #10
    Join Date
    Aug 2011
    Posts
    2517
    hmmm yes. the X Y Z numbers we are giving you are just examples.
    you are supposed to change them to suit your situation....

Similar Threads

  1. G-code start move
    By Spencer myers in forum SheetCam
    Replies: 1
    Last Post: 05-17-2012, 12:04 PM
  2. Tombstone move to home gives weird result
    By MIKEL12 in forum EdgeCam
    Replies: 3
    Last Post: 06-09-2010, 10:51 PM
  3. Adding a manual pulse generator to my home CNC
    By glentner in forum CNC Machine Related Electronics
    Replies: 1
    Last Post: 10-01-2007, 03:30 PM
  4. Adding Comments to G-code Programs
    By bill south in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 1
    Last Post: 04-20-2007, 02:51 PM
  5. Will Jog but not Move Correctly in G code
    By dafowfidy in forum Mach Software (ArtSoft software)
    Replies: 5
    Last Post: 03-30-2007, 04:27 AM

Posting Permissions

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