Skip to content

Instantly share code, notes, and snippets.

@keyz182
Last active July 26, 2018 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keyz182/c6cd29cfe5df174e5bfc668920355732 to your computer and use it in GitHub Desktop.
Save keyz182/c6cd29cfe5df174e5bfc668920355732 to your computer and use it in GitHub Desktop.
DuetConfigHevoPiezoSensorlessHoming
; General preferences
G90 ; Send absolute coordinates...
M83 ; ...but relative extruder moves
M667 S1 ; Select CoreXY mode
; Network
M550 P******** ; Set machine name
M552 S1 ; Enable network
M587 S"********" P""********"" ; Configure access point. You can delete this line once connected
M586 P0 S1 ; Enable HTTP
M586 P1 S0 ; Disable FTP
M586 P2 S0 ; Disable Telnet
; Drives
M569 P0 S1 ; Drive 0 goes forwards
M569 P1 S1 ; Drive 1 goes forwards
M569 P2 S1 ; Drive 2 goes forwards
M569 P3 S0 ; Drive 3 goes forwards
M569 P4 S1 ; Drive 4 goes backwards
M350 X16 Y16 Z16 E16:16 I1 ; Configure microstepping with interpolation
;M92 X80 Y80 Z400 E418.5:837 ; Set steps per mm
M92 X80 Y80 Z400 E414.8:402.4 ; Set steps per mm
M566 X500 Y500 Z50 ; Set maximum instantaneous speed changes (mm/min)
M203 X18000 Y18000 Z1800 E3600:3600 ; Set maximum speeds (mm/min)
M201 X15000 Y15000 Z600 ; Set accelerations (mm/s^2)
M906 X1600 Y1600 Z1200 E1100:1100 I30 ; Set motor currents (mA) and motor idle factor in per cent
M84 S30 ; Set idle timeout
; Retraction Settings
M207 S4.5 F6500 T3500 R0.025 Z0.4 ; Distance 4.5mm, Speed 6500, de-retract 3500, extra distance 0.025, zhop 0.4
M204 T7500 ; Set Travel Accel
M566 E4000:4000 ; Set Extruder Jerk
M201 E6600:6600 ; Set Extruder Accel
; Axis Limits
M208 X0 Y-15 Z0 S1 ; Set axis minima
M208 X300 Y295 Z290 S0 ; Set axis maxima
; Stall Detection
;M915 X Y S-60 F0 H200 R1
; Endstops
M574 Z1 S2 ; Set Z-Probe at low end
M574 X1 Y1 S3 ; Set active high endstops
; Z-Probe
M558 P8 F250 T600 I1 R0.5 A3 Z1 A0.09 H3
;M558 P8 F350 T750 I1 R0.4 A5 Z1 A0.05 H7.5 ; Piezo Z probe
G31 P100 X0 Y0 Z-0.1 ; Set Z probe trigger value, offset and trigger height
M557 X20:280 Y20:280 S52 ; Define mesh grid
; Bed Heater
;M305 P0 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 0
M305 P0 T100000 B4725 C7.060000e-8 R4700
M143 H0 S120
; Extruder Heaters
M305 P1 T100000 B4725 C7.060000e-8 R4700 ; Set thermistor + ADC parameters for heater 1
M143 H1 S285 ; Set temperature limit for heater 1 to 280C
M305 P2 T100000 B4725 C7.060000e-8 R4700 ; Set thermistor + ADC parameters for heater 2
M143 H2 S285 ; Set temperature limit for heater 2 to 280C
; Tools
M563 P0 D0 H1 S"RightNozzle" ; Define tool 0
G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets
G10 P0 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C
M563 P1 D1 H2 S"LeftNozzle" ; Define tool 0
G10 P1 X-20 Y0 Z0 ; Set tool 1 axis offsets
G10 P1 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C
; Tools - Swapped
;M563 P0 D1 H2 S"RightNozzle" ; Define tool 0
;G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets
;G10 P0 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C
;M563 P1 D0 H1 S"LeftNozzle" ; Define tool 0
;G10 P1 X20 Y0 Z0 ; Set tool 1 axis offsets
;G10 P1 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C
; Fans
M106 P0 S0 I0 F75 H-1 C"PartFan" ; Set fan 2 value, PWM signal inversion and frequency. Thermostatic control is turned off
M106 P1 S1 I0 F75 H1:2 T45 C"ExtruderFan" ; Set fan 1 value, PWM signal inversion and frequency. Thermostatic control is turned on
M106 P2 S1 I0 F75 H100 T45 C"DuetCooling" ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned off
; Automatic power saving
M911 S22 R23 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; Set voltage thresholds and actions to run on power loss
; Pressure Advance
M572 D0 S0.02
; Heater 3 LEDs
M307 H3 A-1 C-1 D-1
M42 P3 S0
; Heater 4 Servo
M307 H4 A-1 C-1 D-1
M42 P4 S0
; Filament out
M591 D0 P1 C3 S1
; Load override
M501
G91 ; use relative positioning
;Here I set motor settings before homing, it makes sure they are consistent even if I change settings for my motors for regular printing, it wont break my homing (the settings are corrected at the end of homing)
M203 X8000 Y8000 ; Set maximum speeds (mm/min)
M906 X900 Y900 ; Set motor currents (mA) and motor idle factor in percent
M201 X200 Y200 ; Set accelerations (mm/s^2)
M913 X70 Y70 ; drop motor currents to 50%
M915 X Y S4 R0 F0 ; set X and Y to sensitivity 2, do nothing when stall, unfiltered
M574 X1 Y1 S3 ; set endstops to use motor stall
; Initial homing for X/Y
G1 Z10 F1200 S2 ; lift Z
G4 P100
G1 S1 X-325 Y-325 F3600 ; move right/back 325mm, stopping at the endstop
G4 P100
G1 X5 Y5 ; move away from home
G4 P100
; X or Y is homed at this point, now home the other axis
G1 S1 X-325 F3600 ; move towards axis minimum
G4 P100
G1 S1 Y-325 F3600 ; move towards axis minimum
G4 P100
G1 X5 Y5 ; move away from home
G4 P100
M400 ; make sure everything has stopped before we reset the motor currents
M913 X100 Y100 ; motor currents back to 100%
M574 X1 Y1 S1 ; define active low microswitches
; Home Z
G90 ; back to absolute positioning
G1 X10 Y10 F3600 ; Move to bed
G4 P500 ; pause
G91 ; relative positioning
G1 S1 Z-305 F420 ; move Z down until the switch triggers
G90 ; absolute positioning
G1 Z7.5 F100 ; lift Z relative to current position
G1 X150 Y150 F3600 ; Move to bed
G4 P500 ; pause
G91 ; relative positioning
G1 S1 Z-305 F420 ; move Z down until the switch triggers
G90 ; absolute positioning
G92 Z-0.10 ; set Z position to trigger height for buildtak
G1 Z5 F100 ; lift Z relative to current position
M98 Pmotorspeeds.g ;I moved all motor settings from config.g into motorspeeds.g file so that I can set the back to normal after any changes during homing.
M400 ; make sure everything has stopped before we make changes
;Here I set motor settings before homing, it makes sure they are consistent even if I change settings for my motors for regular printing, it wont break my homing (the settings are corrected at the end of homing)
M203 X8000 ; Set maximum speeds (mm/min)
M906 X900 ; Set motor currents (mA) and motor idle factor in percent
M201 X200 ; Set accelerations (mm/s^2)
M913 X70 ; drop motor currents to 50%
M915 X S5 R0 F0 ; set X to sensitivity 2, do nothing when stall, unfiltered
M574 X1 S3 ; set endstops to use motor stall
G91 ; use relative positioning
G1 Z10 F1200 ; lift Z
G4 P100
G1 S1 X-325 F3600 ; move right/back 325mm, stopping at the endstop
G4 P100
G1 Z-10 X5 F1200 ; lower Z
M400 ; make sure everything has stopped before we reset the motor currents
M913 X100 ; motor currents back to 100%
G90 ; back to absolute positioning
M574 X1 S1 ; define active low microswitches
M98 Pmotorspeeds.g ;I moved all motor settings from config.g into motorspeeds.g file so that I can set the back to normal after any changes during homing.
; homez.g
; called to home the Z axis
G91 ; relative positioning
G1 Z7.5 F6000 S2 ; lift Z relative to current position
G90 ; absolute positioning
G1 X10 Y10 F3600 ; Move to bed
G4 P750 ; pause
G91 ; relative positioning
G1 S1 Z-305 F420 ; move Z down until the switch triggers z
G90 ; absolute positioning
G1 Z7.5 F100 ; lift Z relative to current position
G1 X150 Y150 F3600 ; Move to bed
G4 P750 ; pause
G91 ; relative positioning
G1 S1 Z-305 F420 ; move Z down until the switch triggers z
G90 ; absolute positioning
G92 Z-0.10 ; set Z position to trigger height for buildtak
G1 Z5 F100 ; lift Z relative to current position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment