2023-10-09 14:28:06 +13:00
|
|
|
; # MPCNC
|
|
|
|
M550 P"MPCNC"
|
|
|
|
|
|
|
|
; absolute coordiantes
|
|
|
|
G90
|
|
|
|
; relative tool moves
|
|
|
|
M83
|
|
|
|
|
|
|
|
; ## Kinematics/physical configuration
|
|
|
|
|
|
|
|
; MPCNC primo has dual-drive X and Y axis
|
|
|
|
; X Axis: drivers `0.0` and `0.1`
|
|
|
|
; Y Axis: drivers `0.2` and `0.3`
|
|
|
|
; Z Axis: driver `0.4`
|
|
|
|
; Force three cartesian axis
|
|
|
|
M584 X0.0:0.1 Y0.2:0.3 Z0.4 P3
|
|
|
|
|
|
|
|
; physical drive 0.0 goes backwards
|
|
|
|
; physical drive 0.1 goes backwards
|
|
|
|
; physical drive 0.2 goes backwards
|
|
|
|
; physical drive 0.3 goes backwards
|
|
|
|
; physical drive 0.4 goes backwards
|
2023-10-28 15:36:14 +13:00
|
|
|
M569 P0.0 S1
|
2023-10-09 14:28:06 +13:00
|
|
|
M569 P0.1 S0
|
|
|
|
M569 P0.2 S0
|
2023-10-28 15:36:14 +13:00
|
|
|
M569 P0.3 S1
|
|
|
|
M569 P0.4 S1
|
2023-10-09 14:28:06 +13:00
|
|
|
|
|
|
|
; configure microstepping with interpolation
|
|
|
|
M350 X16 Y16 Z16 I1
|
|
|
|
; set steps per mm
|
2023-10-28 15:36:14 +13:00
|
|
|
M92 X100.00 Y100.00 Z400.00
|
2023-10-09 14:28:06 +13:00
|
|
|
; set maximum instantaneous speed changes (mm/min)
|
|
|
|
M566 X180.00 Y180.00 Z80.00
|
|
|
|
; set maximum speeds (mm/min)
|
|
|
|
M203 X1800.00 Y1800.00 Z250.00
|
|
|
|
; set accelerations (mm/s^2)
|
|
|
|
M201 X850.00 Y180.00 Z80.00
|
|
|
|
; set motor currents (mA) and motor idle factor in per cent
|
|
|
|
; X and Y motors are RB 42SHDC4043Z-22B
|
|
|
|
; - Current/phase: 1.5A
|
|
|
|
; - Holding torque: 0.4M.m or 57oz-in.
|
|
|
|
; Z motor is Leadshine 42CM08
|
|
|
|
; - Current/phase: 2.5A
|
|
|
|
; - Holding torque: 0.8N.m or 113oz-in.
|
|
|
|
M906 X1500 Y1500 Z2500 I30
|
|
|
|
; Set idle timeout
|
|
|
|
M84 S30
|
|
|
|
|
|
|
|
; ### Axis Limits
|
|
|
|
; Build is 600x400mm but to shave 10mm off as a safety margin.
|
|
|
|
M208 X0 Y0 Z0 S1
|
|
|
|
M208 X590 Y490 Z80 S2
|
|
|
|
|
|
|
|
; ### Endstops
|
|
|
|
; There is an end-stop on each drive axis (ie 4, 2 x X and 2 x Y).
|
|
|
|
; They are configured as active-low with a pull-up resistor (ie they should
|
|
|
|
; always be high, which prevents possible failures where the end-stop isn't
|
|
|
|
; connected anymore).
|
|
|
|
; Pin mapping:
|
|
|
|
; - X0 `io0.in`
|
|
|
|
; - X1 `io1.in`
|
|
|
|
; - Y0 `in2.in`
|
|
|
|
; - Y1 `in3.in`
|
2023-10-28 15:36:14 +13:00
|
|
|
M574 X1 S1 P"io0.in+io1.in"
|
|
|
|
M574 Y1 S1 P"io2.in+io3.in"
|
2023-10-09 14:28:06 +13:00
|
|
|
|
|
|
|
; ### Z-Probe
|
|
|
|
; Unlike the end-stops the Z probe is a touch-off plate, so should be
|
|
|
|
; active-high.
|
2023-10-09 15:06:08 +13:00
|
|
|
M558 P8 C"!^io4.in" H10 F120 T3000
|
2023-10-28 15:36:14 +13:00
|
|
|
G31 Z0.5 X0 Y0
|
2023-10-09 14:28:06 +13:00
|
|
|
|
|
|
|
; ## Fans
|
|
|
|
; Fan 0 is connected to out4 as a 12V 2-pin PWM fan
|
|
|
|
; Sensor 0 is the temperature sensor on the Duet3 MCU
|
|
|
|
; Sensor 1 is the stepper driver temperature sensors
|
|
|
|
; Turn on the fans when the MCU reaches 40º and on max at 70º
|
|
|
|
; Also if the stepper drivers report over temp
|
|
|
|
M950 F0 C"out4"
|
|
|
|
M308 S0 Y"mcu-temp" A"MCU"
|
|
|
|
M308 S1 Y"drivers" A"Stepper Drivers"
|
|
|
|
M106 P0 B2.5 L0 X255 H0:1 T40:70
|
|
|
|
|
|
|
|
; ## Tools
|
|
|
|
; My system uses a simple relay to send mains power to a Makita trim router.
|
|
|
|
; That relay is connected to `out1`.
|
|
|
|
; M950 R0 C"nil+out1+nil"
|
|
|
|
; define tool 0
|
|
|
|
; M563 P0 R0 S"Router"
|
|
|
|
; set tool 0 axis offsets
|
|
|
|
; G10 P0 X0 Y0 Z0
|
|
|
|
; set initial tool 0 active and standby temperatures to 0C
|
|
|
|
; G10 P0 R0 S0
|
|
|
|
; Enable CNC mode
|
|
|
|
M453
|
|
|
|
|
|
|
|
; ## Pin mapping
|
|
|
|
; define relay for vacuum as pin 0 on out2
|
|
|
|
M950 P0 C"out2"
|
|
|
|
|
|
|
|
; define relay for for power on
|
|
|
|
M80 C"pson"
|
|
|
|
M81 C"pson"
|
|
|
|
|
|
|
|
; E-stop button active-low io6 with pull-up
|
2023-10-28 15:36:14 +13:00
|
|
|
M950 J0 C"^io6.in"
|
2023-10-09 14:28:06 +13:00
|
|
|
; Trigger E-stop on inactive-to-active at any time
|
|
|
|
M581 P0 T0 S1 R0
|
|
|
|
M582 T0
|
|
|
|
|
|
|
|
; Cycle start button
|
|
|
|
; active-high io7 with pull-up
|
2023-10-28 15:36:14 +13:00
|
|
|
M950 J1 C"!^io7.in"
|
2023-10-09 14:28:06 +13:00
|
|
|
; Trigger macro 2 on inactive-to-active at any time
|
2023-10-28 15:36:14 +13:00
|
|
|
M581 P1 T2 S1 R0
|
2023-10-09 14:28:06 +13:00
|
|
|
; status LED pin 1 on out7
|
2023-10-28 15:36:14 +13:00
|
|
|
M950 P1 C"out7"
|
2023-10-09 14:28:06 +13:00
|
|
|
|
|
|
|
; Feed hold button
|
|
|
|
; active-high on io8 with pull-up
|
2023-10-28 15:36:14 +13:00
|
|
|
M950 J2 C"!^io8.in"
|
2023-10-09 14:28:06 +13:00
|
|
|
; Trigger macro 3 on inactive-to-active at any time
|
2023-10-28 15:36:14 +13:00
|
|
|
M581 P2 T3 S1 R0
|
2023-10-09 14:28:06 +13:00
|
|
|
; status LED on pin 2 out8
|
2023-10-28 15:36:14 +13:00
|
|
|
M950 P2 C"out8"
|
2023-10-09 14:28:06 +13:00
|
|
|
|
|
|
|
; CNC setup
|
|
|
|
|
|
|
|
;Use Workspace coordinate system
|
|
|
|
G54
|
|
|
|
;Allow movement without homing (without axis maxima)
|
|
|
|
M564 S0 H0
|
|
|
|
|