Welcome to Our Community

Some features disabled for guests. Register Today.

Post processor causes Z-Axis crash

Discussion in 'OpenBuilds Forum Help' started by Cor053, Feb 18, 2025 at 1:49 PM.

  1. Cor053

    Cor053 New
    Builder

    Joined:
    Oct 21, 2022
    Messages:
    5
    Likes Received:
    1
    I am using a Blackbox X32.

    Generating the gcode, using Fusion 360 and the appropriate post processor from OB, for my first CNC plasma cutter project gave me a surprise. It generated the following gcode:

    G90 G94 G17 ; Set absolute positioning, feed rate mode, and XY plane
    G21 ; Set units to mm

    G54 ; Set Work Coordinate 1 system (Needs homing before starting this gcode!!!)

    G53 G0 Z-10 ; Move Z to -10 in machine coordinates, just shy of the lower limit switch
    G0 X5.776 Y190.319 F2000 ; Move XY in WCS 1 coordinates
    G0 X5.776 Y190.319 Z13 ; Move Z to clearance height in WCS 1 coordinates!!!

    My interpretation:
    The last line in bold contains the surprise. Because it causes hitting my lower Z-axis limit switch which is at this point at the WCS 1 position zero. Therefore the positive Z13 coordinate does not exist for my Z-axis. Actually my Z-axis ranges from 0 down to -170. So sending it upwards to coordinate 13 feels like an error in the code generation.

    My desired fix:
    I suspect that 13 is the clearance height. If so, the clearance height is derived from the setup data I entered in Fusion 360 when specifying my setup. This number on itself is correct, but it is only valid after executing a probing action using the line of code below.
    G38.2 Z-170 F200 ; Initiates the probing action
    G10 L10 Z-3 ; Projects a new Z0 at the probe position minus "top stock" height (being 3mmm)
    G0 X5.776 Y190.319 Z13 ; Positioning to the correct clearance height

    However I do not know if there is a way to pull this off. I looked for a way to configure this somehow, but did not succeed.

    My current solution:
    Editing the generated gcode by hand, which is sub-optimal.

    Hence my question:
    "How do I solve this in a proper way"?



    I Hope someone can enlighten me.
     
    #1 Cor053, Feb 18, 2025 at 1:49 PM
    Last edited: Feb 18, 2025 at 2:06 PM
  2. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,520
    Likes Received:
    1,933
  3. Cor053

    Cor053 New
    Builder

    Joined:
    Oct 21, 2022
    Messages:
    5
    Likes Received:
    1
    Hello David,
    Thanks for your reaction.

    I had a look at the README-plasma.md and followed the steps in there.
    There is one odd thing. I do not have the "Inside computer" option in the Passes tab. I remember seeing it in previous attempts. So I screwed something up, but do not know what.
    I added screenshots of my Setup, 2d Profile and Post Processing settings. If you want to be so kind as to review them.
    I also added a screenshot of the start of the generated gcode. There is no change in the generated gcode. So it stil results in a Z-axis crash.

    Screenshot 2D Profile Tab 1.png Screenshot 2D Profile Tab 2.png Screenshot 2D Profile Tab 3.png Screenshot 2D Profile Tab 4.png Screenshot 2D Profile Tab 5.png Screenshot Post Processing Bottom Part.png Screenshot Post Processing Middle Part.png Screenshot Post Processing Top part.png Screenshot Resulting GCode.png Screenshot Setup Tab 1.png Screenshot Setup Tab 2.png Screenshot Setup Tab 3.png Screenshot Setup Tab 4.png
     
  4. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,520
    Likes Received:
    1,933
    nothing obviosuly wrong except the 'safety: check Z tool length', turn it off, it does not apply to plasma.

    Assuming you have homed the machien after switch on, after you place the material on the machine,
    you must jog the tool to the XY position where your Setup has the XY zero point and then click the 'setZeroX/Y' buttons.
    After that you jog Z so the nozzle it just touching the material and click the setZeroZ button.
    Alternatively if you have a probe switch on the tool (and a sprung nozzle) you can use the probe to probe Z, this will set the Work Coordinate offset just like the setZeroZ button.

    Now you can run the Gcode and the
    G53 G0 Z-10
    will raise Z to 10mm short of the top of the Z axis
    then G0 X9... Y189... will move safely to the cut start point
    then G0 Z13 will actually move the Z DOWN to 13mm above the material, then the probe move after that will probe the surface ready to cut.

    IF you have an extremely short Z range, ie shorter than 23mm in this case, then there is no room between G53 Z-10 and G0 Z13 since Z13 will be above Z-10 and you will have to adjust your clearance and retract heights so it all fits between top of Z travel and the surface of the material. This is hard to explain without drawings and handwaving (-: Let me try drawing....
    plasmaheights.png
    so, working from the top down
    1 - the top line is the machine Z home, the highest Z can go. Z=0 for Machine Coordinate System. Going there with trip the Z limit switch and cause an alarm!
    2 - next down is 10mm below that, that is where the Gocde 'G53 G0 Z-10' moves the nozzle to. this is a safety move, raise Z as high as it can safely so it can move to the cut start point.
    3 - then we have 13mm above the material, that is where 'G0 .... Z13' moves to, coming down from the G53 move in this case, after follwing cuts it will move UP to this level.
    4 - then surface of the material, this is where you set or probe the Work Cordinate system Z=0, which will be reset each time the gcode probes Z before each cut starts. This is an attempt to cater for warped material.
     
  5. Cor053

    Cor053 New
    Builder

    Joined:
    Oct 21, 2022
    Messages:
    5
    Likes Received:
    1
    Thanks again David :)

    The part I missed is jogging to the Z position.
    I already jog to a X and Y position. Now I know, it seems obvious I should also jog to the Z-position as well.
    I will try this, this evening and let you know.

    Another thought...
    In theory, maybe establishing the WCS 0 Z-position could be automated by an initial probing action? Since I have a probing switch for that purpose.
    That could initially probe and then set WCS zero automatically using the G10 L20 Z<top stock offset>. Or am I abusing the G10 L10 instructions now?
    It would need modifications in the post processor and add a postprocessing check box for enabling this initial probing.
    I could try this out as well, modifying the gcode by hand first. I will let you know this as well.

    And one additional question, if you permit.
    Where do the X and Y coordinates () come from in de gcode line:
    G0 X9.212 Y189.724 F1000
    They seem to come out of the blue. Or wait, is it the location of the first cut?
    Thinking about it and looking a bit further in the gcode, it is indeed the first position where first cut must be made.
     
  6. Cor053

    Cor053 New
    Builder

    Joined:
    Oct 21, 2022
    Messages:
    5
    Likes Received:
    1
    Hi David,

    I tested your suggestion, jogging the Z-axis down to the stock top position and the zeroing X, Y and Z.
    That works perfectly. So thanks a lot for your help.

    I also tested my idea of using probing to initialize the WCS Z=0 position. That worked as well.
    Note that I homed the machine before running the gcode.
    So instead of the normal Gcode sequence I manually modified the gcode to use the following code...

    G53 G0 Z-10 ; position to Z-10 in MCS
    G0 X9.212 Y189.724 F1000 ; Position to the initial work position in WCS
    G38.2 Z-170 F200 ; Do the probing of the Z-axis
    G10 L20 Z-3 ; Zero the probed Z position for WCS
    G0 X9.212 Y189.724 ; Move the initial work position, which is probably obsolete
    G0 X9.212 Y189.724 Z13 ; Move to the correct clearance height at Z13 WCS

    The effect is a bit odd, because visually it probes twice at the same position, but it works perfectly.

    Thanks again for your help.
     
  7. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,520
    Likes Received:
    1,933
    while that works it is not the normal process, one would normally either jog and setZero or use the 'probe' menu to probe Z, then run the Gcode.
    Probe | Z Zero | confirm probe position| probe

    Doing this is part of the setup process and forces the user to check that the material and nozzle are indeed in the right places and the area is clear of clamps etc before stating the cut.
    Industry norms arise out of injuries (-: (and expensive crashes)
     
    Peter Van Der Walt likes this.
  8. Cor053

    Cor053 New
    Builder

    Joined:
    Oct 21, 2022
    Messages:
    5
    Likes Received:
    1
    I understand that the current approach of jogging to the correct position, inclusief the Z-axis as well, is an industrie wide best practice.
    So, point taken.
    And thanks again.
     
    David the swarfer likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice