Stock crash - gcode analysis and postproc modification


Results 1 to 8 of 8

Thread: Stock crash - gcode analysis and postproc modification

  1. #1
    Member jstal's Avatar
    Join Date
    May 2020
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Stock crash - gcode analysis and postproc modification

    Hello,

    I'm using linuxcnc-mill postproc and planet-cnc hardware. The working reference is at the top of stock. NC planes at 10/5mm from to of stock.

    I would expect all rapid X-Y movements are >=10mm from stock and that the tool goes from 5mm to top of stock at feed rate. Am I ok ?

    After stating the program the tool go to G28 (0-0-0) and then go in a straight line to the start of the feature but at Z0.

    I think I had aldready experienced that a long time ago, with a Z working reference at *bottom* of stock, the first movement was G28 to XY of the first feature and Z0 in one-step at 3200mm/min causing a local big-bang.

    Below is Gcode -- with my own comments (they may be wrong):

    G21 G17 -- G21:mm G17:XY plane
    G91 G28 Z0 -- [G91:increment mode : Z+0 (useless?)] [goto G28]
    G28 X0 Y0
    (F4 Z2 L14)
    N1 T41 M06 -- tool change
    S19894 M03 -- spindle on, clockwise
    M08 -- coolant

    G90 G54 G00 X17.5 Y-3. -- [G90 use working reference] [G54 reference part 1] [G00 rapid move to X17.5 Y-3.]
    -- *** FAIL *** WTF WHY Z IS MOVING ??????????

    G43 Z5. H41 -- [G43 tool lenght comp.] [5mm defined in camworks]
    G01 Z-1.6 F1989.437 -- start milling


    According to my comprehension of g-code, Z axis should not move when executing the G90 line. Am I right?

    => If yes, so the software/hardware that I use is faulty, but I can't do anything to solve that.
    => Otherwise, things are getting better when specifying Z, e.g. "G90 G54 G00 X17.5 Y-3. Z10"

    I successfully opened the postproc in UPG... How to properly modify it, for:
    - Not hard-coding the Z10 but using the camworks rapid place (using OPR_Z_RAPID_PLANE ?)
    - Using it tool-compensated (I suppose that my Z10 in "G90 G54 G00 X17.5 Y-3. Z10" is dangerous because not tool-lenght copensated).


    They is probably something to do with:

    :SECTION=RAPID_FROM_TOOL_CHANGE_MILL
    :T:<G!:ABSINC><G!:work_coord><G!:00><X!><Y!><attri butes><EOL>
    *
    :SECTION=RAPID_LEADIN_FROM_TOOL_CHANGE_MILL
    :T:<G!:ABSINC><G!:work_coord><G!:00><X!><Y!><attri butes><EOL>


    Thank you very much for your help



  2. #2
    Member
    Join Date
    May 2016
    Location
    United States
    Posts
    471
    Downloads
    0
    Uploads
    0

    Default Re: Stock crash - gcode analysis and postproc modification

    Quote Originally Posted by jstal View Post
    Hello,

    G21 G17 -- G21:mm G17:XY plane
    G91 G28 Z0 -- [G91:increment mode : Z+0 (useless?)] [goto G28]
    G28 X0 Y0
    (F4 Z2 L14)
    N1 T41 M06 -- tool change
    S19894 M03 -- spindle on, clockwise
    M08 -- coolant

    G90 G54 G00 X17.5 Y-3. -- [G90 use working reference] [G54 reference part 1] [G00 rapid move to X17.5 Y-3.]
    -- *** FAIL *** WTF WHY Z IS MOVING ??????????

    G43 Z5. H41 -- [G43 tool lenght comp.] [5mm defined in camworks]
    G01 Z-1.6 F1989.437 -- start milling


    According to my comprehension of g-code, Z axis should not move when executing the G90 line. Am I right?

    => If yes, so the software/hardware that I use is faulty, but I can't do anything to solve that.
    => Otherwise, things are getting better when specifying Z, e.g. "G90 G54 G00 X17.5 Y-3. Z10"
    I'm not familiar with your control or system so I'll keep this simple.

    G90 is Absolute Positioning Mode in most milling machines. You will likely do 90% of your work in that mode. Those absolute coordinates are referenced from your Work Offset G54, which is itself referenced off of Machine Zero.

    You're right, there is no reason with the programming you supplied that the Z axis should move at that point. There must be some wires crossed. Somewhere you have a physical, electro-mechanical problem, or incorrect setting in your control. Controls will not make up stuff upon their own. Like a Z move that was as yet not asked for. Maybe try putting G90 and G54 in the line before the move. Not likely to help but give it a try. Are you positive this code you're sharing is exactly what was run on the machine?

    Unless your Toll Change functionality is limited, there is little use for all that G28 stuff at the head of your program. All the needed positioning to Home-For-Tool-Change should be built into the tool change functionality called by M6. I've programmed for a couple decades without ever calling G28. It's seldom needed. G53 is a better bet, but that's a different story.



  3. #3
    Member
    Join Date
    May 2005
    Location
    canada
    Posts
    1662
    Downloads
    0
    Uploads
    0

    Default Re: Stock crash - gcode analysis and postproc modification

    G90 G54 G00 X17.5 Y-3. -- [G90 use working reference] [G54 reference part 1] [G00 rapid move to X17.5 Y-3.]
    -- *** FAIL *** WTF WHY Z IS MOVING ??????????
    If the Z moves on that line it truly is a mystery.
    Are you testing with single-block active?

    Anyone who says "It only goes together one way" has no imagination.


  4. #4
    Member jstal's Avatar
    Join Date
    May 2020
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Re: Stock crash - gcode analysis and postproc modification

    1/ Split it on 2 lines:
    G90 G54
    G00 X17.5 Y-3.
    I'm going to test that on the machine, but my first impression (on the software view, disconnected from the machine) is that it don't change anything

    2/ Yes, this is exactly the code running on the machine

    3/ I think G28 is just a way to go home (used only at the start, next tool changes are only using M06)

    4/ Single block inactive (actually my hardware don't support it - damn)



  5. #5
    Member
    Join Date
    Jan 2018
    Location
    United Kingdom
    Posts
    1516
    Downloads
    0
    Uploads
    0

    Default Re: Stock crash - gcode analysis and postproc modification

    Well this is my take on it.
    I have that line when posting Gcode G28 G91 Z0.
    I've always edited the code, deleted it and put a G0 Z... move and that's that.
    As long as you've homed the machine at the start of the day there's no point in it and can cause problems like ypu've found out.

    Then when the day is done run a G28 to send it home and switch off.
    Next day just hit ref all home and ready to go again as long as you haven't moved machine since doing the last G28 the night before.
    Again there is now no need for the first stupid line.
    If you see what I mean.



  6. #6
    Member
    Join Date
    May 2016
    Location
    United States
    Posts
    471
    Downloads
    0
    Uploads
    0

    Default Re: Stock crash - gcode analysis and postproc modification

    Quote Originally Posted by dazp1976 View Post
    Then when the day is done run a G28 to send it home and switch off.
    Next day just hit ref all home and ready to go again as long as you haven't moved machine since doing the last G28 the night before.
    It is usually not advised to turn off a machine with the machine at home position. Especially a machine with Incremental Encoders that needs to be homed each time it's turned off and on. On machines with Absolute Encoders (battery backup) which don't need to be homed each day this is less of a concern. Incremental machines will need to pass over their Deceleration Dogs to set off the Grid Shift counting in order to find home. This is impossible if the machine is already at the perceived Home Position. Besides... many machines move slightly when you turn them off, Especially machines that have heavy Z axis with brakes. So when you turn them back on they're not exactly at Home Position. If you try to Home Return them when they're at or near home, you will get a + Over-travel Alarm or something close to it.

    This may be different on small, light hobby machines using hobby and semi-pro controllers. I have no experience with them so can not say for sure.



  7. #7
    Member jstal's Avatar
    Join Date
    May 2020
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default Re: Stock crash - gcode analysis and postproc modification

    When I start a program the machine is systematically homed before (I do it manually before offsets settings).

    What would be the ideal boot sequence ?

    I modified the postproc using UPG :

    The 2 sections "rapid from tool change" / "rapid leadin from tool change" where identical:
    :T:<G!:ABSINC><G!:work_coord><G!:00><X!><Y!><attri butes><EOL>
    generating:
    G90 G54 G00 X17.5 Y-3

    Now I have:
    :T:<G!:ABSINC><G!:work_coord><EOL>
    :T:<G:43> H<"%2LT":TOOL><EOL>
    :T:<G!:00><X!><Y!><Z!><attributes><EOL> => G90 G54 G00 X17.5 Y-3
    Generating:
    G90 G54
    G43 H41
    G00 X89.5 Y-3. Z15.

    So now the Z-move is controlled and not random (Z15 is the rapid plane).
    Any comment/suggestion appreciated.

    Code tested on a batch on 9 identical parts, 5 tools on the top side and 2 tools on reverse side. Nothing goes wrong.



  8. #8
    Member
    Join Date
    May 2016
    Location
    United States
    Posts
    471
    Downloads
    0
    Uploads
    0

    Default Re: Stock crash - gcode analysis and postproc modification

    Just a note. Homing a machine with G28 is not the same as Zero Returning the machine at startup. Zero Return will be Mode that's switched to at the control of the machine. Typically followed by presses of Z+X+Y+a buttons on the control panel. Homing with G28 is something you program.

    I'm glad your system seems to be working now. Here's just a suggestion on how to start up tools. To each there own of course, but I'll try to explain why I do it like this.

    SAMPLE: (Fanuc Based)

    T1M6 (SPOT DRILL) (Basic tool call)
    G17G21G40G49G54G80G90G98 (Safety line that positively sets up machine and makes sure all things are canceled. Plus Work Offset Call.)

    G0X4.325Y-0.387 -(Initial position move - head is still up at the tool change position. Nothing can go wrong here. If the table goes somewhere you weren't expecting you'll know while Z is still home.)
    G43Z3.H1S5924M3T12 -(Take care of many needed functions at once while heading to your initial plane. Assign tool offset / spindle on at speed / call next tool to ready position)
    M8 - (Turns on coolant while head is down at work. No shooting coolant all over the place.)
    G99G82Z-1.R3.P75F500. (Spot Drill cycle)
    BLAH_BLAH
    G80
    M9

    T12M6 (M3 DRILL)
    G17G20G40G49G54G80G90G98

    G0X4.325Y-0.3875
    G43Z0.1H12S5924M3T9
    M8
    BLAH_BLAH
    G80
    M9
    G53Z0.Y0.M5 (Send head safely home and table forward for reload)
    M30

    Of course take it or leave it. Good luck!



Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Stock crash - gcode analysis and postproc modification

Stock crash - gcode analysis and postproc modification