Confused on G-code header
Hi - I just converted my Ender 5 from a Bigtree SKR 1.2 running Marlin over to a Duet 3 Mini 5+.
My Cura set up for the Marlin had a bunch of stuff in the G-code header (or start G-Code) which was placed into the top of the G-code after slicing.
I pulled most of that stuff out so that my header just has the following.
However, I'm getting a temperature fault right off the bat when I try to print.
So I'm confused about what should go into the G-code header in Cura (Preferences -> Printer -> Machine config -> Start G-Code)
Looking at the Marlin header, it had a bunch of temperature commands in there. However, shouldn't the temperature commands NOT be in the header and shouldn't they be automatically generated by the slicer since temps may change based on filament?
Current start G-Code in Cura:
G28 ;Home G29 ;Automatic bed leveling G92 E0 ;Reset Extruder G1 Z2.0 F3000 ;Move Z Axis up G1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position G1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line G1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little G1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line G92 E0 ;Reset Extruder G1 Z2.0 F3000 ;Move Z Axis up
Config.g file for Duet-based system
; Configuration file for Duet 3 Mini 5+ (firmware version 3.3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.3.2 on Sat Sep 04 2021 23:23:30 GMT-0400 (Eastern Daylight Time) ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"Clinton3DPrinter" ; set printer name ; Network M552 S1 ; enable network M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; Drives M569 P0.0 S1 ; physical drive 0.0 goes forwards M569 P0.1 S1 ; physical drive 0.1 goes forwards M569 P0.2 S0 ; physical drive 0.2 goes backwards M569 P0.3 S1 ; physical drive 0.3 goes forwards M584 X0.0 Y0.1 Z0.2 E0.3 ; set drive mapping M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation M92 X80.00 Y80.00 Z800.00 E415.00 ; set steps per mm M566 X900.00 Y900.00 Z60.00 E300.00 ; set maximum instantaneous speed changes (mm/min) M203 X6000.00 Y6000.00 Z600.00 E3600.00 ; set maximum speeds (mm/min) M201 X500.00 Y500.00 Z20.00 E2500.00 ; set accelerations (mm/s^2) M906 X600 Y600 Z600 E900 I30 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X235 Y235 Z300 S0 ; set axis maxima ; Endstops M574 X1 S1 P"io5.in" ; configure active-high endstop for low end on X via pin io5.in M574 Y1 S1 P"io6.in" ; configure active-high endstop for low end on Y via pin io6.in M574 Z1 S2 ; configure Z-probe endstop for low end on Z ; Z-Probe M950 S0 C"io3.out" ; create servo pin 0 for BLTouch M558 P9 C"^io3.in" H5 F120 T6000 ; set Z probe type to bltouch and the dive height + speeds G31 P500 X-42 Y-14 Z2 ; set Z probe trigger value, offset and trigger height M557 X0:100 Y0:100 S50 ; define mesh grid ; Heaters M308 S0 P"temp0" Y"thermistor" T98801 B4185 ; configure sensor 0 as thermistor on pin temp0 M950 H0 C"out0" T0 ; create bed heater output on out0 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 M308 S1 P"temp1" Y"thermistor" T98801 B4185 ; configure sensor 1 as thermistor on pin temp1 M950 H1 C"out1" T1 ; create nozzle heater output on out1 and map it to sensor 1 M307 H1 B0 S1.00 ; disable bang-bang mode for heater and set PWM limit M143 H1 S240 ; set temperature limit for heater 1 to 240C ; Fans M950 F0 C"out3" Q500 ; create fan 0 on pin out3 and set its frequency M106 P0 C"PartCool" S0 H-1 ; set fan 0 name and value. Thermostatic control is turned off M950 F1 C"out4" Q500 ; create fan 1 on pin out4 and set its frequency M106 P1 C"HotEnd" S1 H1 T45 ; set fan 1 name and value. Thermostatic control is turned on M950 F2 C"out5" Q500 ; create fan 2 on pin out5 and set its frequency M106 P2 C"CaseFan" S1 H-1 ; set fan 2 name and value. Thermostatic control is turned off M950 F3 C"out6" Q500 ; create fan 3 on pin out6 and set its frequency M106 P3 C"LEDs" S1 H-1 ; set fan 3 name and value. Thermostatic control is turned off ; 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 ; Custom settings are not defined ; Miscellaneous M501 ; load saved parameters from non-volatile memory M911 S22 R23 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set voltage thresholds and actions to run on power loss T0 ; select first tool
; config-override.g file generated in response to M500 at 2021-09-04 21:40 ; This is a system-generated file - do not edit ; Heater model parameters M307 H0 R2.429 C140.000:140.000 D5.50 S1.00 V0.0 B0 I0 M307 H1 R2.756 C128.561:121.058 D4.69 S1.00 V23.8 B0 I0 ; Workplace coordinates G10 L2 P1 X0.00 Y0.00 Z0.00 G10 L2 P2 X0.00 Y0.00 Z0.00 G10 L2 P3 X0.00 Y0.00 Z0.00 G10 L2 P4 X0.00 Y0.00 Z0.00 G10 L2 P5 X0.00 Y0.00 Z0.00 G10 L2 P6 X0.00 Y0.00 Z0.00 G10 L2 P7 X0.00 Y0.00 Z0.00 G10 L2 P8 X0.00 Y0.00 Z0.00 G10 L2 P9 X0.00 Y0.00 Z0.00
However, shouldn't the temperature commands NOT be in the header and shouldn't they be automatically generated by the slicer since temps may change based on filament?
I'm not quite sure what you mean.
The commands are generated by the slicer which is why they appear at the start of the file.
You can, if you wish, set the temps of the extruder/bed using the DWC before uploading the file to be printed. But I don't think that is a common approach.
Sorry - I was confused as well and I think I'm getting the temperature fault because I need to re-tune the bed - apparently it didn't save correctly when I tuned it yesterday.
Should I keep the stuff that circled in red in my Start G-code that is part of my Cura settings for the Ender 5 or should I remove that because it looks like some of those commands will override things that are in the Duet config.g and may not be correct.
jay_s_uk last edited by
@charlesmc remove it. it'll override the speeds and you'll end up printing very slowly
thank you! will do
I don't let the slicer generate any code that changes any of the settings set in config.g related to the steppers.
Cura 4.10.0 has a setting for "G-code flavor" for RepRep - which you may wish to use.
Now this is just food for thought.
I don't like having a bunch of code in the slicer.
So what I have is just M98 P"print_begin.g" and M98 P"print_end.g".
I create those files via the DWC and enter into them the code I want.
I can use, as I choose, Simplify3D, Cura, Prusa or ideaMaker and they all run those files.
Which simplifies things for me.
@fcwilt That's a good suggestion - will implement!
@fcwilt That's a good suggestion - will implement!
Just remember that each slicer generates code based on the "G-code Flavor" setting and other settingsundefined such as extruder/bed temps.
On some slicers you can complete prevent any code from being generated, on others you can control it to some degree and on others you can use a feature which allows you to make "automatic edits" to the generated code.
And each slicer may generate code before and after the M98 call to your code.
If you ever try this approach and have problem just let me know.