[3.4-b5] bug - initial config not running correctly
I saw some movement issues on my printer the last few days. Turns out that some/all settings that should be loaded in config.g via macro call M98 P"config_defaults.g" are not being applied.
For that reason the printer tried to use way off acceleration and velocity values.
I guess it likely is the call of the macro that doesn't work like before.
Using 3.4 b5 in SBC mode.
G90 ; send absolute coordinates... M83 ; ...but relative extruder moves ; M550 P"V-Core 3" ; set printer name -- only for standalone use with network M669 K1 ; CoreXY G29 S1 ; Set Units to Millimeters ; mainboard ; OUT4-6 @ 12V ; OUT 7-9 @ 24V ; 0.DRIVER_0 => Z ; 0.DRIVER_1 => Z ; 0.DRIVER_2 => Z ; 0.DRIVER_3 => Y ; 0.DRIVER_4 => X ; 0.DRIVER_5 => Extruder ; 0.IO_0 => X Endstop ; 0.IO_1 => Y Endstop ; 0.IO_5 => Z Probe BLtouch ; 0.TEMP_0 => Bed Temp ; 0.OUT_1 => Bed Heater ; 0.OUT_2 => Hotend Heater ; 0.OUT_4 => Duet/Raspi Fan (Fan10) ; 0.OUT_7 => Hotend Fan (Fan0) (2pin) ; 0.OUT_8 => Layer Fan (Fan1) (2pin) ; 0.TEMP_1 => Hotend Temp ; OUT9 5V/PWM is used for powering relay ; toolboard uses default CAN address #121 ; 121.IO_0 => Z Probe BLtouch ; 121.IO_1 => (Filament Monitor) ; 121.IO_2 => X Endstop ; 121.TEMP_0 => Hotend Temp ; 121.OUT_0 => Heater ; 121.OUT_1 => Hotend Fan 4-pin ; 121.OUT_2 => Layer Fan 3-pin ; 121.DRIVER_0 => Extruder G4 S1 ; wait for expansion boards to start ; Define Motors ===================================================================== M569 P0.0 S0 D3 ; Z motors run backwards M569 P0.1 S0 D3 ; Z motors run backwards M569 P0.2 S0 D3 ; Z motors run backwards M569 P0.3 S1 D3 ; Y goes forwards M569 P0.4 S1 D3 ; X goes forwards M569 P121.0 S1 D3 ; Ext goes forwards M584 X0.4 Y0.3 Z0.0:0.1:0.2 E121.0 ; assign drives to axes M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation ;Step sizes M92 X80.00 Y80.00 Z800.00 ; set steps per mm M906 X1000 Y1000 Z800 I30 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout ; Define Axes and endstops ===================================================================== ; define axis limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X310 Y287 Z300 S0 ; set axis maxima ; define endstops ;M574 X1 S1 P"io0.in" ; configure active high endstops M574 X1 S1 P"121.IO_2.in" ; configure active high endstops M574 Y2 S1 P"0.IO_1.in" ; configure active high endstops M574 Z1 S2 ; configure Z-probe endstop for low end on Z ; Define Bed ===================================================================== ; Lead screw positions ; this defines the position of the SCREWS! ; to configurate measurement points, check bed.g ; Y axis is reduced to 287 [13-300], adapted Y position of Z screws accordingly! M671 X-3:150:306.5 Y-16:292:-16 S2 ; define positions of Z leadscrews or bed levelling screws | ideal: X-4.5:150:304.5 Y-4.52:305:-4.52 S5 M557 X10:275 Y10:262 P5 ; define 5x5 mesh grid -- Y is limited to 287, update Y range accordingly! ; configurate heat bed M308 S0 P"temp0" Y"thermistor" T100000 B3950 A"Bed" ; configure sensor 0 as thermistor on pin temp0 M950 H0 C"out1" T0 ; create bed heater output on out5 and map it to sensor 0 M307 H0 B0 S1.00 ; disable bang-bang mode for the bed heater and set PWM limit M140 H0 ; map heated bed to heater 0 M143 H0 S110 ; set temperature limit for heater 0 to 110C ; Set the Bed PID values - gathered from PID tune M307 H0 B0 R0.435 C373.3 D1.30 S1.00 V23.9 ; Define BLTouch Sensor ===================================================================== M950 S0 C"121.IO_0.out" ; Create servo pin 0 on io5 M558 P9 C"121.IO_0.in" H8 F320 T18000 A5 ; set Z probe type to unmodulated - dive height increased from 5mm, Feed rate increased from 240. P9 = type bltouch ; Z offset calibrated using guide https://betrue3d.dk/bltouch-on-duet-wifi-configuratio-and-usage/#testandcalibrate ; Z3 means: Set Z=3mm when probe is triggered. So a smaller value will set the minimum Z further away from the head. ; Calibrate Z so that a piece of paper does only move with friction between nozzle and bed. Babystepping adds a senseful offset for printing. G31 P25 X-28.00 Y-23.00 Z4.21 ; set Z probe trigger value, offset and trigger height, more Z means closer to the bed ; Define Tool 0 ===================================================================== M563 P0 D0 H1 F1 ; 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 ; hotend heater and temperature sensor M308 S1 P"121.TEMP_0" Y"pt1000" A"Hotend" ; register hotend temperature sensor M950 H1 C"121.OUT_0" T1 ; create nozzle heater output on out2 and map it to sensor 1 M307 H1 B0 S1.00 ; disable bang-bang mode for heater and set PWM limit M143 H1 S290 ; set the maximum temperature in C for heater ; Set the Hotend PID values - gathered from PID tune ;M307 H1 B0 R1.989 C208.6 D6.92 S1.00 V23.9 M307 H1 B0 R1.926 C77.3 D5.96 S1.00 V24.2 ; define extruder / hotend M92 E830 ; set extruder steps per mm, 0.9 angle/step (LDO Pancake) M906 E800 ; set extruder motor current (mA) and idle factor in per cent M302 S150 R110 ; Allow extrusion starting at 150°C and retractions starting at 110°C M207 S4.0 F1600 Z0.1 ; configurate G10/G11 extruder retraction, move 4mm, also move bed 0.1mm ; Define Fans ===================================================================== ; Hotend Fan - sunon fan needs high PWM, foun in an amazon review M950 F0 C"121.OUT_1" Q31400 ; create fan on pin out7 and set frequency to 31 kHz M106 P0 C"Hotend Fan" S0 H1 L0 X0.5 T60:250 ; configurate fan. H1 = Thermostatic control ON , -1 = OFF | L/X = min/max Speed | T = temperature range ; Layer Fan M950 F1 C"121.OUT_2" Q500 ; create fan on pin out8 and set its frequency M106 P1 C"Layer Fan" S0 H-1 L0.5 ; configurate fan. Thermostatic control is turned off ; back CPU/PSU fans M308 S10 Y"mcu-temp" A"MCU" ; configure sensor 10 to represent MCU temp M308 S11 Y"drivers" A"Drivers" ; configure sensor 11 to represent Drivers temp M950 F10 C"!out4+^out4.tach" Q100 ; create fan 10 on out4 (1st PWM slot) M106 P10 C"Duet/RasPi Fan" H10:11 L0.3 X1 B0.3 T35:70 ; assign fan 10 to sensors 10 and 11 | B = run x seconds on full power | L + X = min/max bounds ; setup Accelerometer ===================================================================== ; First digit: orientation of accelerometer Z axis ; second digit: orientation of acc. X axis ; 0 = +X, 1 = +Y, 2 = +Z, 4 = -X, 5 = -Y, 6 = -Z. M955 P121.0 I24 ; use accelerometer @ 121.0, axis config 2,4 ; set defaults ===================================================================== ; contains default movement and acceleration speeds ; as well as things like speed / eextrusion factor, microstepping etc ; nozzle / filament diameter M98 P"config_defaults.g" ; for unknown reasons this does not work in config.g but in homeall.g. ; toggle the ATX relay once to let duet know we use one. THis will show the ATX power widget in DWC ;M80 ;G4 P1000 ; need a short pause ;M81 S0
; (re)set defaults M566 X400.00 Y400.00 Z6.00 E120.00 P1 ; set maximum instantaneous speed changes (mm/min) // same as M205 but with mm/min M201 X6000 Y6000 Z50 E3600 ; set accelerations (mm/s^2) M203 X10800.00 Y10800.00 Z600.00 E3600.00 ; set maximum speeds (mm/min) M204 P6000 T6000 ; Set printing and travel accelerations M205 X8 Y8 Z8 ; custom jerk - A M593 P"zvd" F44.3 ; Input shaping T0 ; Select tool 0 M220 S100 ; Set speed factor to 100% M221 S100 ; Set extrusion factor to 100% M290 R0 Z0.25 ; babystepping 0 , R0 = absolute mode R1 = relative, add to configurated babystepping offset ;G10 P0 R0 S80 ; Set extruder to 80 and release M404 N1.75 D0.4 ; Filament width and nozzle diameter
@jbjhjm I have added a test call to M98 P"config_defaults.g" on my SBC connected Duet in config.g I had it set one setting and then echo that it had run successfully.
On restarting the duet (Emergency stop in DWC) I see that the setting has been applied so "its working for me" in b5 is SBC mode.
That you tried running M98 P"config.g" to see if any errors are thrown by either config.g or the config_defaults.g ?
@t3p3tony weird, I just powered up to check on any errors as you suggested, but this time everything was initialized correctly.
I'll let you know here in case it happens again.
gloomyandy last edited by
@jbjhjm If you hit the problem again, it may be worth changing the logging mode of DWC to be debug and taking a look to see if there are any messages in the log that are relevant. I had a similar issue with an earlier beta release in which some code in a macro was being skipped. @chrishamm took a look at it and came up with the following fix: https://github.com/Duet3D/DuetSoftwareFramework/commit/372bbc38093312d55caf3063850ed1a116693890#diff-25a6634263c1b1f6fc4697a04e2b9904ea4b042a89af59dc93ec1f5d44848a26
ah yes this makes sense thanks @gloomyandy !