MPCNC - Fusion360 CAM - XY axis go negative



  • Hi guys,

    I have a problem with Fusion 360. I use this postprocessor: https://github.com/guffy1234/mpcnc_posts_processor. Whenever I generate the gcode from fusion the x and y axis have negative values.

    Before I start the gcode, I position the tool head manually and home all axes with G92. Then I start the gcode and the machine instantly stops with the error "outside machine limits".

    Here's an example of the gcode:

    ;Fusion 360 CAM 2.0.8407
    ; Posts processor: DIYCNC_RepRapFW.cps
    ; Gcode generated: Sonntag, 31. Mai 2020 17:23:07 GMT
    ; Document: Unbenannt
    ; Setup: Setup1
    ; 
    ; Ranges table:
    ; X: Min=-372.45 Max=375.4 Size=747.85
    ; Y: Min=-357.948 Max=357.248 Size=715.196
    ; Z: Min=-2 Max=15 Size=17
    ; 
    ; Tools table:
    ; T1 D=16 CR=0 - ZMIN=-2 - Schaftfraser 
    
    ; *** START begin ***
    G90
    G21
    M84 S0
    G92 X0 Y0 Z0
    ; *** START end ***
    
    ; *** SECTION begin ***
    ;Planen1 - Milling - Tool: 1 -  Schaftfraser
    ; X Min: -372.45 - X Max: 375.4
    ; Y Min: -357.948 - Y Max: 357.248
    ; Z Min: -2 - Z Max: 15
    M453 P2 I0 R30000 F200
    ; COMMAND_START_SPINDLE
    ; COMMAND_SPINDLE_CLOCKWISE
    M291  P"Turn ON 5000RPM" R"Spindle" S3
    ; COMMAND_COOLANT_ON
    M117  Planen1
    G0 Z15 F300
    G0 X375.4 Y-357.948 F2500
    G0 Z5 F300
    ; MOVEMENT_LEAD_IN
    G1 Z-0.4 F1000
    G1 X375.396 Z-0.509 F1000
    G1 X375.385 Z-0.618 F1000
    G1 X375.367 Z-0.726 F1000
    G1 X375.341 Z-0.832 F1000
    G1 X375.308 Z-0.936 F1000
    G1 X375.268 Z-1.037 F1000
    G1 X375.221 Z-1.136 F1000
    G1 X375.167 Z-1.231 F1000
    G1 X375.107 Z-1.323 F1000
    G1 X375.041 Z-1.41 F1000
    G1 X374.969 Z-1.492 F1000
    G1 X374.892 Z-1.569 F1000
    G1 X374.81 Z-1.641 F1000
    G1 X374.723 Z-1.707 F1000
    G1 X374.631 Z-1.767 F1000
    G1 X374.536 Z-1.821 F1000
    G1 X374.437 Z-1.868 F1000
    G1 X374.336 Z-1.908 F1000
    G1 X374.232 Z-1.941 F1000
    G1 X374.126 Z-1.967 F1000
    G1 X374.018 Z-1.985 F1000
    G1 X373.909 Z-1.996 F1000
    G1 X373.8 Z-2 F1000
    G1 X365 F1000
    

  • Moderator

    Moved to CNC forum.



  • How are your machine configured?

    How are you doing the setup in Fusion?

    Typically in CNC we make use of Work Coordinate Systems (M54 to M59), which are different from Absolute Coordinates (M53; aka Machine Coordinates), in that they can offset from the Absolute coordinates (they start at 0 offset). This allows us to place the stock material anywhere in the machine, and tell the machine at run-time where the stock origin is.

    On my machine, I home to the left and front of machine, and Z homes up (Z is allowed to move well into the wasteboard). I then jog the spindle to the position on the stock which I selected as origin (in Fusion, usually front left, unless circular where I would rather use the center).
    Using the following command, I set it as the origin for the second coordinate system G10 L20 P2 X0 Y0 - this tells the machine that the current position is XY origin for the 2nd coordinate system. In my macro this is followed by G55 which in turn switch to the newly defined coordinate system (any XY movements after this, is then in relation to this position, and can be negative, as long as there are space in the positive Machine Coordinates).

    In my Fusion post for my machine, I have a tool-change script, which does the 2nd part of determining origin. First it allows me to change the tool (and displays the selected tool from the library), and then it performs a probe onto a metal disk (normally open switch type probe) - this tells it where the material starts. When this is done, it sets the Z origin for the coordinate system. Since I probe above the stock, all cuts are in negative values, but since absolute system is still positive, it works as expected.

    If you need to make changes to the axis max travel (M208 in your config.g), you can give axis a negative limit for the Minimum. For example: M208 X-100 Y-100 Z-100 S1 will set all your axis to be able to go 100mm into the negative (just be sure that the machine will not be damaged if it does - this is why I use endstops). Negative values here will be allowed even in the Machine Coordinates.


Log in to reply