Skip to content

Repository files navigation

DIY CNC Fusion 360 CAM posts processor

This is modified fork of https://github.com/martindb/mpcnc_posts_processor

CAM posts processor for use with Fusion 360 and MPCNC with RAMPS or any 3-axis DIY CNC. Supported firmwares:

  • Marlin 2.0
  • Repetier firmware 1.0.3 (not tested. gcode is same as for Marlin)
  • GRBL 1.1
  • RepRap firmware (Duet3d)

Some design points:

  • Setup operation types: Milling, Water/Laser/Plasma
  • Support MM and Inches units (but all properties MUST be set in MM)
  • XY and Z independent travel speeds. Rapids are done with G0.
  • Arcs support on XY plane (Marlin/Repetier/RepRap) or all panes (Grbl)
  • Tested with LCD display and SD card (built in tool change require printing from SD and LCD to restart)
  • Support for 3 different laser power using "cutting modes" (through, etch, vaporize)
  • Support 2 coolant channels. You may attach relays to control external devices - as example air jet valve.
  • Customizable level of verbosity of comments
  • Support line numbers
  • Support GRBL laser mode (be noted that you probably to have enabled laser mode $32=1)

screenshot

User Properties

Group 1: Job propertyes

TitleDescriptionDefault
Job: FirmwareTarget firmware (marlin 2.0 or Repetir 1.0.3 / GRBL 1.1) / RepRap Firmware.Marlin
Job: Travel Speed XYHigh speed for travel movements X & Y (mm/min).2500 mm/min
Job: Travel Speed ZHigh speed for travel movements Z (mm/min).300 mm/min
Job: Marlin: Manual Spindle On/OffSet it to true when the motor of your spindle is controlled by manual switch. So the preprocessor will issue additional pauses for TURN ON/TURN OFF the motor.true
Job: Marlin: Enforce feedrateAdd feedrate to each movement g-code.false
Job: Use ArcsUse G2/G3 g-codes fo circular movements.true
Job: Reset on start (G92)Set origin when gcode start (G92 X0 Y0 Z0). Only apply if not using gcodeStartFile.true
Job: Goto 0 at endGo X0 Y0 at gcode end. Useful to find if your machine loss steeps or have any other mechanic issue (like loose pulleys). Also useful for repetitive jobs. Only apply if not using gcodeStopFile.true
Job: Use ArcsUse G2/G3 g-codes fo circular movements.true
Job: Line numbersShow sequence numbers.false
Job: Line startFirst sequence number.10
Job: Line incrementIncrement for sequence numbers.1
Job: Separate wordsSpecifies that the words should be separated with a white space.true
Job: Duet: Milling ModeGCode command to setup Duet3d milling mode."M453 P2 I0 R30000 F200"
Job: Duet: Laser ModeGCode command to setup Duet3d laser mode."M452 P2 I0 R255 F200"

Group 2: Tool change

TitleDescriptionDefault
Change: EnabledEnable tool change code (bultin tool change requires LCD display)true
Change: XX position for builtin tool change0
Change: YY position for builtin tool change0
Change: ZZ position for builtin tool change40
Change: Make Z ProbeZ probe after tool changetrue
Change: Disable Z stepperDisable Z stepper when change a toolfalse

Group 3: Z Probe

TitleDescriptionDefault
Probe: On job startExecute probe gcode on job starttrue
Probe: Plate thicknessPlate thickness0.8
Probe: Use Home ZUse G28 or G38 for probingtrue
Probe: G38 targetProbing up to Z position-10
Probe: G38 speedProbing with speed30

Group 4: Laser/Plasma related

TitleDescriptionDefaultValues
Laser: On - VaporizePersent of power to turn on the laser/plasma cutter in vaporize mode100
Laser: On - ThroughPersent of power to turn on the laser/plasma cutter in through mode80
Laser: On - EtchPersent of power to turn on the laser/plasma cutter in etch mode40
Laser: Marlin modeMarlin mode of the laser/plasma cutter ()M106M106 S{PWM}/M107 = 0; M3 O{PWM}/M5 = 1; M42 P{pin} S{PWM} = 2;
Laser: Marlin pinMarlin custom pin number for the laser/plasma cutter4
Laser: GRBL modeGRBL mode of the laser/plasma cutterM4M4 S{PWM}/M5 dynamic power = 4; M3 S{PWM}/M5 static power = 3;

Group 5: Override behaviour by external files

TitleDescriptionDefault
Extern: Start FileFile with custom Gcode for header/start (in nc folder)
Extern: Stop FileFile with custom Gcode for footer/end (in nc folder)
Extern: Tool FileFile with custom Gcode for tool change (in nc folder)
Extern: Probe FileFile with custom Gcode for tool probe (in nc folder)

Group 6: Manage coolant control pins

TitleDescriptionDefaultValues
Coolant: A ModeEnable issuing g-codes for control Coolant channel A0off=0; flood=1; mist=2; throughTool=3; air=4; airThroughTool=5; suction=6; floodMist=7; floodThroughTool=8
Coolant: A Marlin On commandGCode command to turn on Coolant channel AM42 P11 S255
Coolant: A Marlin Off commandGcode command to turn off Coolant AM42 P11 S0
Coolant: A GRBLGRBL g-codes for control Coolant channel AM7M7 flood = 7; M8 mist = 8
Coolant: B ModeEnable issuing g-codes for control Coolant channel B0off=0; flood=1; mist=2; throughTool=3; air=4; airThroughTool=5; suction=6; floodMist=7; floodThroughTool=8
Coolant: B Marlin On commandGCode command to turn on Coolant channel BM42 P6 S255
Coolant: B Marlin Off commandGcode command to turn off Coolant channel BM42 P6 S0
Coolant: B GRBLGRBL g-codes for control Coolant channel BM8M7 flood = 7; M8 mist = 8

Group 7: Write comments into g-code

TitleDescriptionDefault
Comment: Write ToolsWrite table of used tools in job headertrue
Comment: SectionsWrite header of every sectiontrue
Comment: ActivitiesWrite comments which somehow helps to understand current piece of g-codetrue
Comment: Trace CommandsWrite stringified commands called by CAMtrue
Comment: Trace MovementsWrite stringified movements called by CAMtrue

Sample of issued code blocks

Gcode of milling with manually control spindel

;Fusion 360 CAM 2.0.4860; Posts processor: MPCNC_Mill_Laser.cps; Gcode generated: Sunday, December 2, 2018 1:57:21 PM GMT; Document: cam_testpp v5; Setup: Setup1; ; Ranges table:; X: Min=2.588 Max=36 Size=33.412; Y: Min=2.588 Max=36 Size=33.412; Z: Min=-1 Max=15 Size=16; ; Tools table:; T1 D=3.175 CR=0 - ZMIN=-1 - flat end mill; T2 D=1.5 CR=0 - ZMIN=-1 - flat end mill; *** START begin ***G90G21M84S0G92X0Y0 Z0
; COMMAND_TOOL_MEASURE; --- PROBE TOOL begin ---M0 Attach ZProbe
G28 Z
G92 Z0.8
G0 Z50 F300M0 Detach ZProbe
; --- PROBE TOOL end ---; *** START end ***; *** SECTION begin ***;2D Contour1 - Milling - Tool: 1 - 1/8inch flat end mill; X Min: 2.588 - X Max: 49.412; Y Min: 2.588 - Y Max: 49.412; Z Min: -1 - Z Max: 15M400; COMMAND_START_SPINDLE; COMMAND_SPINDLE_CLOCKWISEM0 Turn ON spindle; COMMAND_COOLANT_ONM117 2D Contour1G0 Z15
G0X49.412Y26F2500G0 Z5 F300; MOVEMENT_PLUNGEG1 Z1 F100G1 Z-1
; 14G1Y49.412F300G1X2.588G1Y2.588G1X49.412G1Y26; MOVEMENT_RAPIDG0 Z15
; *** SECTION end ***; *** SECTION begin ***;2D Contour2 - Milling - Tool: 1 - 1/8inch flat end mill; X Min: 9.587 - X Max: 42.412; Y Min: 9.587 - Y Max: 42.412; Z Min: -1 - Z Max: 15M400; COMMAND_START_SPINDLE; COMMAND_SPINDLE_CLOCKWISE; COMMAND_COOLANT_ONM117 2D Contour2G0 Z15 F300G0X42.412Y26F2500G0 Z5 F300; MOVEMENT_PLUNGEG1 Z1 F100G1 Z-1
; 14G1Y42.412F300G1X9.587G1Y9.587G1X42.412G1Y26; MOVEMENT_RAPIDG0 Z15
; *** SECTION end ***; *** SECTION begin ***; --- CHANGE TOOL begin ---; COMMAND_COOLANT_OFFM400M300S400P2000G0 Z50 F300G0X0Y0F2500; COMMAND_STOP_SPINDLEM0 Turn OFF spindleM0 Put tool 2 - 1.5mm
; COMMAND_TOOL_MEASURE; --- PROBE TOOL begin ---M0 Attach ZProbe
G28 Z
G92 Z0.8
G0 Z50 F300M0 Detach ZProbe
; --- PROBE TOOL end ---; --- CHANGE TOOL end ---;Trace1 - Milling - Tool: 2 - 1.5mm flat end mill; X Min: 16 - X Max: 36; Y Min: 16 - Y Max: 36; Z Min: -1 - Z Max: 15M400; COMMAND_START_SPINDLE; COMMAND_SPINDLE_CLOCKWISEM0 Turn ON spindle; COMMAND_COOLANT_ONM117 Trace1G0 Z15
G0X36Y36F2500G0 Z4 F300; MOVEMENT_LEAD_ING1 Z-1 F300; MOVEMENT_CUTTINGG1Y16G1X16G1Y36G1X36; MOVEMENT_LEAD_OUTG1 Z4
; MOVEMENT_RAPIDG0 Z15
; *** SECTION end ***; *** STOP begin ***M400; COMMAND_COOLANT_OFF; COMMAND_STOP_SPINDLEM0 Turn OFF spindleG0X0Y0F2500M117 Job end; *** STOP end ***

Gcode of milling with spindel controlled by M3/M4/M5

;Fusion 360 CAM 2.0.4860; Posts processor: MPCNC_Mill_Laser.cps; Gcode generated: Sunday, December 2, 2018 1:56:26 PM GMT; Document: cam_testpp v5; Setup: Setup1; ; Ranges table:; X: Min=2.588 Max=36 Size=33.412; Y: Min=2.588 Max=36 Size=33.412; Z: Min=-1 Max=15 Size=16; ; Tools table:; T1 D=3.175 CR=0 - ZMIN=-1 - flat end mill; T2 D=1.5 CR=0 - ZMIN=-1 - flat end mill; *** START begin ***G90G21M84S0G92X0Y0 Z0
; COMMAND_TOOL_MEASURE; --- PROBE TOOL begin ---M0 Attach ZProbe
G28 Z
G92 Z0.8
G0 Z50 F300M0 Detach ZProbe
; --- PROBE TOOL end ---; *** START end ***; *** SECTION begin ***;2D Contour1 - Milling - Tool: 1 - 1/8inch flat end mill; X Min: 2.588 - X Max: 49.412; Y Min: 2.588 - Y Max: 49.412; Z Min: -1 - Z Max: 15M400; COMMAND_START_SPINDLE; COMMAND_SPINDLE_CLOCKWISE; >>> Spindle Speed 21000M3S21000; COMMAND_COOLANT_ONM117 2D Contour1G0 Z15
G0X49.412Y26F2500G0 Z5 F300; MOVEMENT_PLUNGEG1 Z1 F100G1 Z-1
; 14G1Y49.412F300G1X2.588G1Y2.588G1X49.412G1Y26; MOVEMENT_RAPIDG0 Z15
; *** SECTION end ***; *** SECTION begin ***;2D Contour2 - Milling - Tool: 1 - 1/8inch flat end mill; X Min: 9.587 - X Max: 42.412; Y Min: 9.587 - Y Max: 42.412; Z Min: -1 - Z Max: 15M400; COMMAND_START_SPINDLE; COMMAND_SPINDLE_CLOCKWISE; >>> Spindle Speed 20000M3S20000; COMMAND_COOLANT_ONM117 2D Contour2G0 Z15 F300G0X42.412Y26F2500G0 Z5 F300; MOVEMENT_PLUNGEG1 Z1 F100G1 Z-1
; 14G1Y42.412F300G1X9.587G1Y9.587G1X42.412G1Y26; MOVEMENT_RAPIDG0 Z15
; *** SECTION end ***; *** SECTION begin ***; --- CHANGE TOOL begin ---; COMMAND_COOLANT_OFFM400M300S400P2000G0 Z50 F300G0X0Y0F2500; COMMAND_STOP_SPINDLEM5M0 Put tool 2 - 1.5mm
; COMMAND_TOOL_MEASURE; --- PROBE TOOL begin ---M0 Attach ZProbe
G28 Z
G92 Z0.8
G0 Z50 F300M0 Detach ZProbe
; --- PROBE TOOL end ---; --- CHANGE TOOL end ---;Trace1 - Milling - Tool: 2 - 1.5mm flat end mill; X Min: 16 - X Max: 36; Y Min: 16 - Y Max: 36; Z Min: -1 - Z Max: 15M400; COMMAND_START_SPINDLE; COMMAND_SPINDLE_CLOCKWISE; >>> Spindle Speed 21000M3S21000; COMMAND_COOLANT_ONM117 Trace1G0 Z15
G0X36Y36F2500G0 Z4 F300; MOVEMENT_LEAD_ING1 Z-1 F300; MOVEMENT_CUTTINGG1Y16G1X16G1Y36G1X36; MOVEMENT_LEAD_OUTG1 Z4
; MOVEMENT_RAPIDG0 Z15
; *** SECTION end ***; *** STOP begin ***M400; COMMAND_COOLANT_OFF; COMMAND_STOP_SPINDLEM5G0X0Y0F2500M117 Job end; *** STOP end ***

Gcode of milling with spindel controlled by M3/M4/M5 with using Coolants (both A and B channels)

;Fusion 360 CAM 2.0.4860; Posts processor: MPCNC_Mill_Laser.cps; Gcode generated: Sunday, December 2, 2018 2:06:54 PM GMT; Document: cam_testpp v5; Setup: Setup1; ; Ranges table:; X: Min=2.588 Max=36 Size=33.412; Y: Min=2.588 Max=36 Size=33.412; Z: Min=-1 Max=15 Size=16; ; Tools table:; T1 D=3.175 CR=0 - ZMIN=-1 - flat end mill; T2 D=1.5 CR=0 - ZMIN=-1 - flat end mill; *** START begin ***G90G21M84S0G92X0Y0 Z0
; COMMAND_TOOL_MEASURE; --- PROBE TOOL begin ---M0 Attach ZProbe
G28 Z
G92 Z0.8
G0 Z50 F300M0 Detach ZProbe
; --- PROBE TOOL end ---; *** START end ***; *** SECTION begin ***;2D Contour1 - Milling - Tool: 1 - 1/8inch flat end mill; X Min: 2.588 - X Max: 49.412; Y Min: 2.588 - Y Max: 49.412; Z Min: -1 - Z Max: 15M400; COMMAND_START_SPINDLE; COMMAND_SPINDLE_CLOCKWISE; >>> Spindle Speed 21000M3S21000; COMMAND_COOLANT_ON; >>> Coolant A ONM42P11S255M117 2D Contour1G0 Z15
G0X49.412Y26F2500G0 Z5 F300; MOVEMENT_PLUNGEG1 Z1 F100G1 Z-1
; 14G1Y49.412F300G1X2.588G1Y2.588G1X49.412G1Y26; MOVEMENT_RAPIDG0 Z15
; *** SECTION end ***; *** SECTION begin ***;2D Contour2 - Milling - Tool: 1 - 1/8inch flat end mill; X Min: 9.587 - X Max: 42.412; Y Min: 9.587 - Y Max: 42.412; Z Min: -1 - Z Max: 15M400; COMMAND_START_SPINDLE; COMMAND_SPINDLE_CLOCKWISE; >>> Spindle Speed 20000M3S20000; COMMAND_COOLANT_ON; >>> Coolant A OFFM42P11S0; >>> Coolant B ONM42P6S255M117 2D Contour2G0 Z15 F300G0X42.412Y26F2500G0 Z5 F300; MOVEMENT_PLUNGEG1 Z1 F100G1 Z-1
; 14G1Y42.412F300G1X9.587G1Y9.587G1X42.412G1Y26; MOVEMENT_RAPIDG0 Z15
; *** SECTION end ***; *** SECTION begin ***; --- CHANGE TOOL begin ---M400G0 Z50 F300G0X0Y0F2500; COMMAND_COOLANT_OFF; >>> Coolant B OFFM42P6S0; COMMAND_STOP_SPINDLEM5M300S400P2000M0 Put tool 2 - 1.5mm
; COMMAND_TOOL_MEASURE; --- PROBE TOOL begin ---M0 Attach ZProbe
G28 Z
G92 Z0.8
G0 Z50 F300M0 Detach ZProbe
; --- PROBE TOOL end ---; --- CHANGE TOOL end ---;Trace1 - Milling - Tool: 2 - 1.5mm flat end mill; X Min: 16 - X Max: 36; Y Min: 16 - Y Max: 36; Z Min: -1 - Z Max: 15M400; COMMAND_START_SPINDLE; COMMAND_SPINDLE_CLOCKWISE; >>> Spindle Speed 21000M3S21000; COMMAND_COOLANT_ONM117 Trace1G0 Z15
G0X36Y36F2500G0 Z4 F300; MOVEMENT_LEAD_ING1 Z-1 F300; MOVEMENT_CUTTINGG1Y16G1X16G1Y36G1X36; MOVEMENT_LEAD_OUTG1 Z4
; MOVEMENT_RAPIDG0 Z15
; *** SECTION end ***; *** STOP begin ***M400; COMMAND_COOLANT_OFF; COMMAND_STOP_SPINDLEM5G0X0Y0F2500M117 Job end; *** STOP end ***

Gcode of laser cutting

;Fusion 360 CAM 2.0.4860; Posts processor: MPCNC_Mill_Laser.cps; Gcode generated: Sunday, December 2, 2018 2:07:32 PM GMT; Document: cam_testpp v5; Setup: Setup2; ; Ranges table:; X: Min=-25 Max=25 Size=50; Y: Min=-25.5 Max=25 Size=50.5; Z: Min=0 Max=15 Size=15; ; Tools table:; T1 D=0 CR=0 - ZMIN=0 - laser cutter; *** START begin ***G90G21M84S0G92X0Y0 Z0
; COMMAND_TOOL_MEASURE; *** START end ***; *** SECTION begin ***;2D Profile1 - Laser/Plasma - Cutting mode: auto; X Min: -25 - X Max: 25; Y Min: -25.5 - Y Max: 25; Z Min: 0 - Z Max: 15M400; COMMAND_START_SPINDLE; COMMAND_SPINDLE_COUNTERCLOCKWISE; COMMAND_COOLANT_ONM117 2D Profile1
G0 Z15 F300G0X-9.94Y-10.5F2500G0 Z0 F300; >>> LASER Power ONM106S200; COMMAND_POWER_ON; MOVEMENT_LEAD_ING1Y-10F1000G1X-9.95; MOVEMENT_CUTTINGG1X-10G1Y10G1X10G1Y-10G1X-9.95; MOVEMENT_LEAD_OUTG1X-9.96G1Y-10.5; >>> LASER Power OFFM107; COMMAND_POWER_OFF; MOVEMENT_RAPIDG0 Z5 F300G0X-9.99Y-25.5F2500G0 Z0 F300; >>> LASER Power ONM106S200; COMMAND_POWER_ON; MOVEMENT_LEAD_ING1Y-25F1000G1X-10; MOVEMENT_CUTTINGG1X-25G1Y25G1X25G1Y-25G1X-10; MOVEMENT_LEAD_OUTG1X-10.01G1Y-25.5; >>> LASER Power OFFM107; COMMAND_POWER_OFF; MOVEMENT_RAPIDG0 Z15 F300; *** SECTION end ***; *** STOP begin ***M400; COMMAND_COOLANT_OFF; COMMAND_STOP_SPINDLEG0X0Y0F2500M117 Job end; *** STOP end ***

Resorces

Marlin G-codes

PostProcessor Class Reference

Post Processor Training Guide (PDF document)

Enhancements to the post processor property definitions

Dumper PostProcessor

Library of exist post processors

Post processors forum

How to set up a 4/5 axis machine configuration

Beginners Guide to Editing Post Processors in Fusion 360! FF121 (Youtube video)

About

MPCNC posts processor for Fusion 360 and Marlin

Resources

Stars

68 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages