Duet Wifi/Duex5 bed compensation
-
I am trying to build a script where I can; ask the Duet to probe the 4 corners of the bed, do the auto compensation. Finally, do change and report what the difference was.
Here is a macro I just wrote up but It probes but does not do any changes. I am trying to avoid having to run an entire G29 every time I want to check that the bed is level.
;Probe 4-point tilt calibration
G1 X0 Y0 Z30
M561 ; clear any bed transform
G29 S2 ; Clear bed height map
G1 X0 Y0 F4000G30 P0 X20 Y20 Z-9999 ; Back Left
G30 P1 X20 Y480 Z-9999 ; Front Left
G30 P2 X480 Y480 Z-9999 ; Front Right
G30 P3 X480 Y20 Z-9999 S4; Back RightGuess the question is; is this the best way to do what I'm looking for or is there a better way?
I am using version 3 of the firmware
; bed.g
; called to perform automatic bed compensation via G32
;
; generated by RepRapFirmware Configuration Tool v3.3.0 on Tue Aug 10 2021 15:48:47 GMT-0400 (Eastern Daylight Time)
M561 ; clear any bed transform
G29 ; probe the bed and enable compensation; Configuration file for Duet WiFi (firmware version 3)
; executed by the firmware on start-up
;
; generated by RepRapFirmware Configuration Tool v3.3.0 on Tue Aug 10 2021 15:48:47 GMT-0400 (Eastern Daylight Time)
; Z axis motors are plugged into the Duex contoller numbers 5-8
M569 P5 S1 ; Physical Drive 5 goes forward (Z-LR)
M569 P6 S1 ; Physical Drive 6 goes forward (Z-LF)
M569 P7 S1 ; Physical Drive 7 goes forward (Z-LF)
M569 P8 S1 ; Physical Drive 8 goes forward (Z-LF)M584 X2 Y0:1 Z5:6:7:8 E3:4 ; set drive mapping
; Axis Limits
M208 X0 Y0 Z0 S1 ; set axis minima
M208 X500 Y500 Z500 S0 ; set axis maxima; Endstops
M574 X1 S1 P"xstop" ; configure active-high endstop for low end on X via pin xstop
M574 Y1 S1 P"ystop+zstop" ; configure active-high duel endstops for low end on Y via pins (ystop(L))(zstop(R)
;M574 Y2 S1 P"zstop" ; configure active-high endstop for low end on Y(R) via pin zstop
M574 Z1 S1 ; configure Z-probe endstop for low end on Z; Z-Probe
M950 S0 C"duex.pwm5" ; create servo pin 0 for BLTouch
M558 P9 C"^zprobe.in" H5 F120 T6000 ; set Z probe type to bltouch and the dive height + speeds
;M558 H30 ;*** Remove this line after delta calibration has been done and new delta parameters have been saved
G31 P500 X5 Y0 Z2.3 ; set Z probe trigger value, offset and trigger height
M557 X15:485 Y15:485 S47 ; define mesh grid -
@macgyver best way is using iterations.
make sure you're on 3.3 for that
something like this https://teamgloomy.github.io/useful_macros.html#bedg-file-for-g32 -
@macgyver I did verify the wiring and order of the motors are good.
I wrote up this one to verify where I think the motor is plugged in is actually where it is plugged in
M280 P7 S60 ; reset bltouch error state
G28 ; Home all axis on Printer
M300 S555 P666 ; Beep, starting procedure
M561 ; disable bed levelingM291 S3 P" Press OK the rear left leadscrew will move down by 1mm"
M584 X0:1 Y5 Z5 U1 E3:4 P3 ; Driver remapping
G91
G1 Z-1 F200 ; lower rear left will move down by 1mmM291 S3 P"Press OK, the front left leadscrew will move down 1mm"
M584 X0:1 Y5 Z6 U1 E3:4 P3 ; Driver mapping
G91
G1 Z-1 F200 ; lower front left down by 1mmM291 S3 P" Press OK, front right leadscrew will move down 1mm"
M584 X0:1 Y5 Z7 U1 E3:4 P3 ; Driver mapping
G91
G1 Z-1 F200 ; lower front right down by 1mmM291 S3 P"Press OK, the rear right leadscrew will move down 1mm"
M584 X0:1 Y5 Z8 U1 E3:4 P3 ; Driver mapping
G91
G1 Z-1 F200 ; lower rear left down by 1mmM584 X2 Y0:1 Z5:6:7:8 E3:4 ; reset Driver mapping
M300 S555 P666 ; Beep , procedure complete
G28 ; home again preparing to produce report -
@macgyver do you have an M671 in your config?
-
M122
=== Diagnostics ===
RepRapFirmware for Duet 2 WiFi/Ethernet version 3.2.2 running on Duet WiFi 1.02 or later + DueX5
Board ID: 0JD0M-9P6M2-NW4SD-6JKFA-3S86S-1APBM
Used output buffers: 3 of 24 (19 max)Well that's problem number 1, looks like I'm on 3.2.2 not 3.3
-
@macgyver worth an upgrade. but post your config.g if you can
-
Jay_s_uk hit it right on the head, I was missing the M671.
Here is the config with the 671 configured, It's a long one but it works.
; generated by RepRapFirmware Configuration Tool v3.3.0 on Tue Aug 10 2021 15:48:47 GMT-0400 (Eastern Daylight Time)
; General preferences
M575 P1 S1 B57600 ; enable support for PanelDue
G90 ; send absolute coordinates...
M83 ; ...but relative extruder moves; Network
M552 S1 ; enable network
M586 P0 S1 ; enable HTTP
M586 P1 S0 ; disable FTP
M586 P2 S0 ; disable Telnet; Drives
M569 P0 S1 ; physical drive 0 goes forward (Y)
M569 P1 S0 ; physical drive 1 goes backward (Y)
M569 P2 S0 ; physical drive 2 goes backward (X)
M569 P3 S1 ; physical drive 3 goes forward (E0)
M569 P4 S1 ; Physical Drive 4 goes forward (E1); Z axis motors are plugged into the Duex contoller numbers 5-8
M569 P5 S1 ; Physical Drive 5 goes forward (Z-LR)
M569 P6 S1 ; Physical Drive 6 goes forward (Z-LF)
M569 P7 S1 ; Physical Drive 7 goes forward (Z-LF)
M569 P8 S1 ; Physical Drive 8 goes forward (Z-LF)M584 X2 Y0:1 Z5:6:7:8 E3:4 ; set drive mapping
;Z axis leadscrew locations
M671 X-70.0:-70.0:570.0:570.0 Y40.0:520.0:520.0:40.0 S5 ; Z leadscrews are at (-70,40)LR #5, (-70,520)LF #6, (570,520)RF #7 and (570,40)RR #8 , 5mm max correctionM350 X16 Y16 Z16 E16:16 I1 ; configure microstepping with interpolation
M92 X160.00 Y80.00 Z400.00 E695.00:695.00 ; set steps per mm
M566 X900.00 Y900.00 Z60.00 E120.00:120.00 ; set maximum instantaneous speed changes (mm/min)
M203 X6000.00 Y6000.00 Z500.00 E1200.00:1200.00 ; set maximum speeds (mm/min)
M201 X500.00 Y500.00 Z20.00 E250.00:250.00 ; set accelerations (mm/s^2)
M906 X800 Y800 Z800 E450:450 I30 ; set motor currents (mA) and motor idle factor in per cent
M84 S180 ; Set idle timeout; Axis Limits
M208 X0 Y0 Z0 S1 ; set axis minima
M208 X500 Y500 Z500 S0 ; set axis maxima; Endstops
M574 X1 S1 P"xstop" ; configure active-high endstop for low end on X via pin xstop
M574 Y1 S1 P"ystop+zstop" ; configure active-high duel endstops for low end on Y via pins (ystop(L))(zstop(R)
;M574 Y2 S1 P"zstop" ; configure active-high endstop for low end on Y(R) via pin zstop
M574 Z1 S1 ; configure Z-probe endstop for low end on Z; Z-Probe
M950 S0 C"duex.pwm5" ; create servo pin 0 for BLTouch
M558 P9 C"^zprobe.in" H5 F120 T6000 ; set Z probe type to bltouch and the dive height + speeds
;M558 H30 ;*** Remove this line after delta calibration has been done and new delta parameters have been saved
G31 P500 X5 Y0 Z2.3 ; set Z probe trigger value, offset and trigger height
M557 X15:485 Y15:485 S47 ; define mesh grid -
@macgyver Glad you got it all sorted