Unexpected start Gcode behaviour
-
I have a strange problem with my start Gcode when starting a new print after the previous print has finished.
Parts of the Gcode are calibrating Z0 via G30 S-1 and the other one is doing the bed mesh.
If the printer or software was freshly restarted everything is working as expected. Once a print was finished and I start another one, I get the "setting Z0" message on Paneldue but the printer continues to do the bed mesh. After the bed mesh is done I can set Z0. Furthermore both heaters will be turned off and the printer then needs to wait for the heater to reach their temperature.
I hope I explained the problem understandable Cannot figure out what the cause for this behaviour.
Any ideas please?
Duet 3 6HC, Duet 3HC Expansion, Duet 3 1LC, RRF 3.3
start gcode M104 S[first_layer_temperature_[current_extruder]] M140 S[first_layer_bed_temperature] M109 S[first_layer_temperature_[current_extruder]] M190 S[first_layer_bed_temperature] M83 ;relative extrusion G21 ; metric values M290 R0 S0 ; reset baby stepping M220 S100 ; reset speed M106 S0 ; turn off fan 0 M561 ; Disable any current bed compensation G32 G90 ; set absolute positioning G1 X82 Y347 Z4.50 F9000 G1 X122 F6000 G1 X82 F6000 G1 X122 F6000 G1 X82 F6000 G1 X122 F6000 M564 S0 ; disable axis limits G1 X177 Y166 F9000 G90 G1 Z3 F400 M400 G92 Z4 ; Reset z to 8 to allow jogging up to touch bed to nozzle M291 P"Jog the Z Axis until the bed and nozzle are touching and click OK" R"Setting Z=0" Z1 S3 M400 G92 Z0 ; Set z = 0 G90 G1 Z3 F400 M400 G1 Z5 M400 G30 S-1 M400 G1 Z5 M400 G30 S-1 M400 G1 Z5 M400 G30 S-1 M400 G1 Z5 M400 G30 S-1 M400 G1 Z5 M400 G30 S-3 ; measure probe height and set it. M400 M500 P31 ; save trigger height to config-override.g G1 Z5 M400 M564 S1 ; enable axis limits M557 X20:335 Y20:300 P5:5 ; mesh grid dummy G29 ; mesh bed leveling G29 S1 ; load bed mesh G92 E0 ; reset extrusion distance G90 ; set absolute positioning G1 X45 Y347 Z4.50 F9000 G1 E10 F300 G92 E0 ; reset extrusion distance G1 X82 F9000 G1 X122 F6000 G1 X82 F6000 G1 X122 F6000 G1 X82 F6000 G1 X122 F6000 G1 X82 F6000 G1 X177 Y166 Z8 F9000
end gcode G92 E0 ; reset extrusion distance G1 E-2 F3000 M400 G92 E0 ; reset extrusion distance G91 ; relative positioning G1 Z10 F3000 ; move Z up 10mm G90 ; absolute positioning G1 X-6 Y295 F6000 ; move to left rear corner of bed M106 S0 ; turn off cooling fan M104 S0 ; turn off extruder M140 S0 ; turn off bed M84 ; disable motors ;G10 P0 R70 S70 ;M116 ;M7722
bed.g ; bed.g ; called to perform automatic bed compensation via G32 M561 ; clear any bed transform G28 ; home M558 K0 H10 F1200 ; increase the depth range, gets the gantry mostly level immediately M558 K0 H5 F240 ; reduce depth range, probe slower for better repeatability while iterations <=1 ; Perform 2 passes. G30 P0 X20 Y25 Z-99999 F9000 ; probe Z left front G30 P1 X20 Y320 Z-99999 F9000 ; probe Z left rear G30 P2 X330 Y320 Z-99999 F9000 ; probe Z right rear G30 P3 X330 Y25 Z-99999 S4 F9000 ; probe Z right front G1 H2 Z8 F2600 ; raise head 4mm to ensure it is above the Z probe trigger height M400 ; finish move, clear buffer while move.calibration.initial.deviation >= 0.003 ; Perform additional leveling if previous deviation was over 0.01mm. G30 P0 X20 Y25 Z-99999 F9000 ; probe Z left front G30 P1 X20 Y320 Z-99999 F9000 ; probe Z left rear G30 P2 X330 Y320 Z-99999 F9000 ; probe Z right rear G30 P3 X330 Y25 Z-99999 S4 F9000 ; probe Z right front G1 H2 Z8 F2600 ; raise head 4mm to ensure it is above the Z probe trigger height M400 ; finish move, clear buffer echo "Gantry deviation of " ^ move.calibration.initial.deviation ^ "mm obtained." G1 Z10 ; Raise nozzle 8mm to ensure it is above the Z probe trigger height. G28 ; Homing again for accurate Z offset
homeall.g ; homeall.g ; called to home all axes M913 X70 Y70 Z100 ; set X Y Z motors to 70% of their normal current G91 ; relative positioning G1 Z8 F800 H2 ; lift Z relative to current position ; Homing Moves G1 H1 X999 F6000 ; move quickly to X axis endstops and stop there (first pass) G1 H1 Y999 F6000 ; move quickly to Y axis endstops and stop there (first pass) G90 ; back to absolute mode ;Homing Z M913 Z65 ; Z Motor current 70% G1 X230.5 Y344 F3600 ;position of Z swtich G1 H1 Z-200 F360 ; move Z down until the switch triggers M400 ; Z Offset ;G92 Z0.375 ; Z position of switch / offset. Lower numbers = higher Z | Higher numbers = lower Z | PEI Side ;G92 Z2.053 ; Z position of switch / offset. Lower numbers = higher Z | Higher numbers = lower Z | PEI Side ; Parking Position G1 Z10 F6000 G1 X177 Y166 F6000 ; put head over the centre of the bed M913 X100 Y100 Z100 ; set X Y Z motors to 100% of their normal current
-
First off please post your config.g file - that might help explain things.
There is a lot there I do not understand why you are doing it.
For examples in your start code you have this:
G1 X82 Y347 Z4.50 F9000 G1 X122 F6000 G1 X82 F6000 G1 X122 F6000 G1 X82 F6000 G1 X122 F6000
and then this:
M400 G92 Z0 ; Set z = 0 G90 G1 Z3 F400 M400 G1 Z5 M400 G30 S-1 M400 G1 Z5 M400 G30 S-1 M400 G1 Z5 M400 G30 S-1 M400 G1 Z5 M400 G30 S-1 M400 G1 Z5 M400 G30 S-3 ; measure probe height and set it. M400
There are other things but perhaps you can explain what those two are for.
Thanks.
-
First one is to clean the nozzle and second one to set and calibrate the Z offset
config.g # # # G4 S1 ;wait for expansion boards to start ; General preferences M111 S0 ; Debugging off G21 ; Work in millimetres G90 ; Send absolute coordinates... M83 ; ...but relative extruder moves M669 K1 ; Select CoreXY mode M564 S1 H1 ; Forbid axis movements when not homed ; --- Z Drive map --- ; _______ ; | 3 | 4 | ; | ----- | ; | 2 | 5 | ; ------- ; front ; ; Drive directions M569 P0 S1 ; A (X) M569 P1 S1 ; B (Y) M569 P2 S1 ; Z1 M569 P3 S0 ; Z2 M569 P4 S1 ; Z3 M569 P5 S0 ; Z4 M569 P121.0 S0 ; E ; Motor mapping and steps per mm M584 X1 Y0 Z2:3:4:5 E121.0 M350 X16 Y16 Z16 E16 I1 ; Use 1/16 microstepping with interpolation everywhere M92 X80 Y80 Z400 E431.55 ; Set XYZE steps per mm (1.8deg motors) ; Drive currents M906 X1500 Y1500 Z1500 E750 ; XYZ and E current M906 I30 ; Idle current percentage M84 S120 ; Idle timeout ; Accelerations and speed ;M566 X1000 Y1000 Z60 E10000 ; Set maximum instantaneous speed changes (mm/min) M566 X600 Y600 Z60 E8000 ; Set maximum instantaneous speed changes (mm/min) M203 X18000 Y18000 Z3000 E15000 ; Set maximum speeds (mm/min) ;M201 X2000 Y2000 Z250 E1800 ; Set maximum accelerations (mm/s^2) M201 X5000 Y5000 Z250 E1800 ; Set maximum accelerations (mm/s^2) ;M204 P1500 T2000 ; Set printing acceleration and travel accelerations ; PA, DAA M572 D0 S0.026 ; Pressure Advance ;M593 P"daa" F81 ; use DAA to cancel ringing ;M593 F46.75 S0.2 M593 F32.5 S0.2 ;M593 F42.5 ; Accelerometer ;M955 P121.0 I05 ; Axis travel limits M208 X5 Y-5 Z0 S1 ; Set axis minima M208 X350 Y350 Z375 S0 ; Set axis maxima ; Endstops M574 X2 S1 P"^io1.in" ; Xmax endstop on hall effect board M574 Y2 S1 P"^io2.in" ; Ymax endstop on hall effect board M574 Z1 S1 P"^io3.in" ; Z endstop switch ; Z probes M558 P8 C"^121.io0.in" T18000 F120 H5 A5 S0.01 R0.2 G31 K0 P500 X0 Y25 Z0 ; Don't really care about inductive probe Z offset ; Bed leveling M671 X-53:-53:400:400 Y-5:420:420:-5 S20 ; Define Z belts locations (Front_Left, Back_Left, Back_Right, Front_Right) M557 X20:335 Y20:300 P5:5 ; Define bed mesh grid (inductive probe, positions include the Y offset!) ; Bed heater (dual thermistor setup) M308 S0 P"temp0" Y"thermistor" T100000 B3950 ; configure sensor 0 as thermistor on pin temp1 M950 H0 C"out1" T0 ; create bed heater output on out1 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 S120 ; set temperature limit for heater 0 to 120C ; Hotend heater M308 S1 P"121.temp1" Y"pt1000" M950 H1 C"121.out0" 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 S350 ; Set temperature limit for heater 1 to 350C ; Chamber Thermistor M308 S2 P"temp1" A"Chamber" Y"thermistor" T100000 B3950 ; MCU sensors M308 S3 Y"mcu-temp" A"MCU" M308 S4 Y"drivers" A"Drivers" M912 P0 S-13 ; MCU temp calibration ; Fans M950 F0 C"121.out1" Q10 ; create fan 1 on pin out5 and set its frequency M106 P0 C"Bed" S0 H-1 B0.2 M950 F1 C"121.out2" ; create fan 1 on pin out5 and set its frequency M106 P1 C"Hotend" L0.80 X0.80 H1 T70 S0.80 M950 F2 C"out7" ; create fan 1 on pin out5 and set its frequency M106 P2 C"Filter" S0 H-1 M950 F3 C"out4" Q24000 ; create fan 2 on pin out6 and set its frequency M106 P3 S0.5 H-1 B1 C"Bay" ; set fan 2 value. Thermostatic control is turned off M950 F4 C"out5" ; create fan 3 on pin out7 and set its frequency M106 P4 S0.5 H-1 C"SBC" M950 F5 C"out6" ; create fan 2 on pin fan2 M106 P5 S1 H-1 C"Light" ; Tools M563 P0 S"Hotend" D0 H1 F0 ; 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 ; Enable debugging via USB M111 S1 P0 ; Platform ;M111 S1 P1 ; Network ;M111 S1 P2 ; Webserver ;M111 S1 P3 ; GCodes ;M111 S1 P4 ; Move ;M111 S1 P5 ; Heat M111 S1 P6 ; DAA M111 S1 P7 ; Roland M111 S1 P8 ; Scanner ;M111 S1 P9 ; PrintMonitor ;M111 S1 P10 ; Storage ;M111 S1 P11 ; PortControl ;M111 S1 P12 ; DuetExpansion ;M111 S1 P13 ; FilamentSensor ;M111 S1 P14 ; Wifi M111 S1 P15 ; Display ;M111 S1 P16 ; LinuxInterface ;M111 S1 P17 ; CAN M575 P1 S1 B115200 ; enable support for PanelDue M501 ; load config-override.g T0 ; select tool 0
-
Calibrating the Z offset during a print?
Did this work previous to 3.3? Are you using an SBC?
I wonder if it's the same issue as here: https://forum.duet3d.com/topic/22667/m291-messages-ignored-by-paneldue/9
What PanelDue firmware version are you running?
-
OK the nozzle cleaning I get.
But the second batch I don't get.
You seem to be executing the Z probe calibration procedure at the start of every print when you ask the user to move the nozzle until it is just touching the bed.
Assuming the user does the calibration procedure correctly the G30 S-3 makes sense but all those G30 S-1 and M400 commands, what are they there for? They really accomplish nothing that I can think of.
One other issue related to this Z probe calibration is that before you do it you call G32 to level the bed. Typically you do that with a Z probe that is already calibrated. What is your thinking here?
Thanks.
I have other questions but they can wait.
Frederick
-
You guys are right, the multiple "G30 S-1" doesn't makes sense. BUT...... this is not my question.
I would like to know why the start code will be executed properly at the first print after a clean start of RRF and beginning with the second print it does the following:
- heating up the bed and extruder
- clean the nozzle
- display the "set z=0 message on gthe PanelDue but don't wait for the user input and directly go to mesh bed leveling
- after bed mesh is done print head is going home again and then waits for the user input for z=0 from the previous step. furthermore both bed and nozzle are turned off at this point.
I just don't get it.
Thanks for you jelp guys!
-
@martinnyhc said in Unexpected start Gcode behaviour:
You guys are right, the multiple "G30 S-1" doesn't makes sense. BUT...... this is not my question.
Yes I know but I looked at all of your code checking for problems and possible "side effects".
I would like to know why the start code will be executed properly at the first print after a clean start of RRF and beginning with the second print it does the following:
You may not like this but I think calibrating the printer at the start of each print is:
- a bad idea as you cannot control if the calibration is done correctly
- it should not be necessary as a calibration should be good unless something is changing the nozzle/probe relationship
Since the problem you are having relates to M291 behaving oddly if you make calibrating the probe a standalone macro the problem will not occur.
And your bed.g can be simplified to use just one while loop - if you wish.
Frederick
-
@phaedrux said in Unexpected start Gcode behaviour:
Calibrating the Z offset during a print?
Did this work previous to 3.3? Are you using an SBC?
I wonder if it's the same issue as here: https://forum.duet3d.com/topic/22667/m291-messages-ignored-by-paneldue/9
What PanelDue firmware version are you running?
These questions remain.