Skip to content

Instantly share code, notes, and snippets.

@juanqui
Last active August 26, 2021 16:14
Show Gist options
  • Save juanqui/59dd993682fbca209963854e0ba88cc3 to your computer and use it in GitHub Desktop.
Save juanqui/59dd993682fbca209963854e0ba88cc3 to your computer and use it in GitHub Desktop.
CR-10 S4 Duet2Wifi Config w/ BLTouch and AC Heated Bed
M561 ; clear any bed transform
G29 S2 ; Clear bed height map
; Probe 2-points
M401 ; Deploy probe - deployprobe.g
G30 P0 X20 Y200 Z-9999 ; Center Left
G30 P1 X340 Y200 Z-9999 S2 ; Center Right
M402 ; Retract Probe - retractprobe.g
; Configuration file for Duet WiFi (RepRapFirmware for Duet 2 WiFi/Ethernet 2.05.1 (2020-02-09b1))
; executed by the firmware on start-up
; General preferences
G90 ; Send absolute coordinates...
M83 ; ...but relative extruder moves
M564 H0 ; Allow movement without homing
; Network
M550 CR10S 400 Organic Handmade ; Set machine name
M552 S1 ; Enable network
M587 S"ssid" P"password" ; 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 S0 ; Drive 2 goes backwards
M569 P3 S0 ; Drive 3 goes backwards
M569 P4 S0 ; Drive 4 goes backwards
M584 X0 Y1 Z2:4 E3 ; Two Z motors connected to driver outputs 2 and 4
M671 X-29.9:428.2 Y200.0:200.0 S2 ; Lead screw offsets from home
M350 X16 Y16 Z16 E16 I1 ; Configure micro-stepping with interpolation
M92 X80 Y80 Z400 E415 ; Set steps per mm
M566 X720 Y720 Z18 E600 ; Set maximum instantaneous speed changes (mm/min)
M203 X6000 Y6000 Z180 E3000 ; Set maximum speeds (mm/min)
M201 X750 Y750 Z100 E5000 ; Set accelerations (mm/s^2)
M906 X1000 Y1000 Z800 E800 I30 ; Set motor currents (mA) and motor idle factor in percent
M84 S30 ; Set idle timeout
; Axis Limits
M208 X0 Y0 Z0 S1 ; Set axis minima
M208 X410 Y410 Z400 S0 ; Set axis maxima
; Endstops
M574 Z1 S0 ; Set active low end-stops
M574 X1 Y1 S1 ; Set active high end-stops
; Z-Probe
; https://duet3d.dozuki.com/Wiki/BLTouch_Troubleshooting
M307 H7 A-1 C-1 D-1 ; Disable heater on PWM channel for BLTouch
M558 P9 F100 H5 R0.2 T6000 A5 B1 ; Set Z probe type to bltouch and the dive height + speeds
G31 P25 X-59.9 Y-7.2 Z1.558 ; Set Z probe trigger value/sensitivity, offset and trigger height
M557 X40:340 Y40:340 S50 ; Define mesh grid
M376 H10 ; Taper compensation at Z=10mm
; Heaters
M307 H0 B0 S1.00 ; Disable bang-bang mode for the bed heater and set PWM limit
M305 P0 T100000 B4138 C0 R4700 ; Set thermistor + ADC parameters for heater 0
M143 H0 S120 ; Set temperature limit for heater 0 to 120C
M305 P1 X200 R397.5 ; Set PT100 + ADC parameters for heater 1 (BROKE, USING THERMISTER BELOW)
;M305 P1 T100000 B4388 R4700 ; Set thermistor + ADC parameters for heater 1
M143 H1 S320 ; Set temperature limit for heater 1 to 280C
M570 H0 P5 T15 S10 ; Set heat fault to 5 sec +/- 15C and save state for 10 minutes
; Fans
M106 P0 S1.0 I0 F500 H1 T50 ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned on
M106 P1 S0.0 I0 F500 H-1 ; Set fan 1 value, PWM signal inversion and frequency. Thermostatic control is turned off
M106 P2 S0.0 I0 F500 H-1 ; Set fan 2 value, PWM signal inversion and frequency. Thermostatic control is turned off
; Tools
M563 P0 D0 H1 F1:2 ; Define tool 0 - use extruder 0, heater 1, fan 1, and fan 2
G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets
G10 P0 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C
; Automatic power saving
M911 S21 R23 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; Set voltage thresholds and actions to run on power loss
; Default firmware retraction configuration
M207 S3.2 R-0.1 F3600 T1200 Z0 ; Set 3.2mm retraction, -0.1 restart, 3600 mm/min feed rate, 1200 mm/min restart feed rate, no z change
; Other settings
G29 S1 ; Enable automatic bed mesh compensation
M572 D0 S0.16 ; Enable pressure-advance
M915 X Y S10 F1 R1 ; Enable stall detection for X and Y axis with a sensitivity of 10 and report only
M915 Z S0 F1 R1 ; Enable stall detection for Z axis with a sensitivity of 10 and report only
; Miscellaneous
M501 ; Load saved parameters from non-volatile memory
G91 ; relative positioning
G1 Z10 F6000 S2 ; lift Z relative to current position
G1 S1 X-415 Y-415 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)
G1 X5 Y5 F6000 ; go back a few mm
G1 S1 X-415 Y-415 F360 ; move slowly to X and Y axis endstops once more (second pass)
G1 X250 Y200 F6000 ; move X and Y to the bottom left corner of the bed
G30 ; Do a single probe to home our Z axis
G90 ; Make sure we are in absolute mode
G1 X200 Y200 Z5 F6000 ; Move to parked position
G91 ; relative positioning
G1 Z10 F6000 S2 ; lift Z relative to current position
G30 ; Do a single probe to home our Z axis
G90 ; Make sure we are in absolute mode
G1 Z10 F6000 ; Rapidly move the Z axis to Z=10.
@RBTData
Copy link

RBTData commented Sep 22, 2018

thanks for getting back to me, there's my problem, on the schematics for the Duet2 wifi it says the external PSU is optional, i knew the heat bed and hot end needed external power, i though the usb would power the steppers as it said optional. if i use the PSU that came with the cr-10s, would i need to connect the mosfet(i think its called in the cr-10 box) that goes to input voltage(green connectors) and to mobo(green connector), or can i connect the heat bed directly to the mobo?

@juanqui
Copy link
Author

juanqui commented Sep 24, 2018

The PSU that comes with the CR10S is a 12V PSU, which is compatible with the Duet2Wifi board. Also, the Duet2Wifi board already has a built-in MOSFET on the board used to switch the heater bed on and off. All you need to do is connect the PSU to the Duet2Wifi (make sure the polarity is right! also, confirm voltage with volt meter before connecting... just in case). Then you can connect the heat bed to the Duet2Wifi (also keeping polarity correct!). The CR10S heat bed (300, 400, or 500) is compatible with the power that the Duet2Wifi MOSFET can handle. Make sure you are careful when working with electronics btw! The PSU needs 110/220V AC main power (which is very dangerous if you don't take proper precautions).

@juanqui
Copy link
Author

juanqui commented Apr 12, 2020

A few updates since this all started :)

  • Changed my extruder to a Bondtech BMG (Bowden configuration)
  • Configured retractions with firmware (using PrusaSlicer mostly with firmware retractions enabled)
  • Updated for latest v2 Duet2 firmware (will upgrade to v3 soon -- lots of config changes with this one!)

@WhiskeyTang0F0xtr0t
Copy link

This is great. I'm considering the Duet 2 WiFi for my S5 with a Bondtech DDS and BLTouch. Did you have to use the adapter board for your hot end temp sensor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment