transfer custom gcode in Prusaslicer?
hi all, simple question here:
I am trying to setup my own custom profile for an anycubic kobra plus, and need to know if I can just copy-paste the start and end codes that I use in Cura into Prusaslicer? Will there be any issues with that?
Best Answer by Neophyl:
To add to Diem's reply, generally no. While the structure of gcode is the same Cura has its own placeholders that are not the same in PS. You would need to substitute for the equivalent PS ones.
If you do paste in then when slicing you will get errors, you can use the errors returned to debug where they are.
Also you could install a profile for a similar printer that is available in both Cura and PS and do a comparison of the start/end gcodes to get an idea of where they differ too.
And lastly you could just post the Cura start gcode here and ask if anyone knows how to convert it to the PS compatible version.
The principle is sound but you will need to go through the resulting gcode and check that PS is not performing a similar setup in a different sequence so trampling on your code. You may be writing some complex conditionals.
Cheerio,
RE: transfer custom gcode in Prusaslicer?
To add to Diem's reply, generally no. While the structure of gcode is the same Cura has its own placeholders that are not the same in PS. You would need to substitute for the equivalent PS ones.
If you do paste in then when slicing you will get errors, you can use the errors returned to debug where they are.
Also you could install a profile for a similar printer that is available in both Cura and PS and do a comparison of the start/end gcodes to get an idea of where they differ too.
And lastly you could just post the Cura start gcode here and ask if anyone knows how to convert it to the PS compatible version.
RE: transfer custom gcode in Prusaslicer?
Wow, that would be incredibly helpful, I would love to have something left around for others searching for an way into PS with the newer Kobra models, it's very barren out there looking for resources at the moment. Would you suggest I make a new post or try that here? Thanks again for the help all.
RE: transfer custom gcode in Prusaslicer?
Might as well post it here then when/if it gets sorted and tested by yourself then you could post it in the appropriate Kobra thread. Ideally you would work out a decent printer profile and then the entire profile can be posted in the other thread for everyone to try.
RE:
Ok here are they are: (kobra max/plus)
Start G-code
G21 ;metric values
G90 ;absolute positioning
M82 ;set extruder to absolute mode
G28 ; Home all axes
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X2 Y20 Z0.3 F5000.0 ; Move to start position
G1 X2 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X2.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X2.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 F2400 E-1
G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish
End G-code
M400 ; Wait for current moves to finish
M220 S100 ; Reset Speed factor override percentage to default (100%)
M221 S100 ; Reset Extrude factor override percentage to default (100%)
G91 ; Set coordinates to relative
G1 F2400 E-3 ; Retract filament 5mm at 40mm/s to prevent stringing
G0 F5000 Z20 ; Move Z Axis up 20mm to allow filament ooze freely
G90 ; Set coordinates to absolute
G0 X0 Y400 F5000 ; Move Heat Bed to the front for easy print removal
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
M84 ; Disable stepper motors
I have a humble request if someone does decide to sort these out to work in PS, can you alter the end code to raise the hotend up high enough in its final resting position to make it easier to clean and inspect the nozzle post printing? Currently it's set too low to check and I have to manually raise it after each print.
I am also working on a profile in both Cura 5.1 and PS for the Kobra Plus which should be identical minus a few things to the Max model. I believe there are some bugs in the newest Cura after testing with a mk3s+ to make sure it wasn't the anycubic printer itself. The ultimaker forum hasn't been much help at all when I raised these issues, nor has anycubic's aftersales support or the reddit subforums. I know that anyone working with a kobra plus and max currently will be doing a lot of adjustments and testing to find the right gcode and profile for themselves. I unfortunately am still learning the ins-and outs of 3d printing basics and am by no means an expert. I believe by A-B ing the Prusaslicer mk3s+ profiles to a custom Kobra plus profile I will be able to get near identical results. I am lucky enough to be sharing a space currently with someone who is letting me use their mk3s+ for these comparative tests. So far, printing the same calibration stl's, swapping filaments between printers, and even running each others slicers has shown that prusaslicer is set up near perfectly, and hopefully a foreign printer using the software will yield as close to identical results. I even have the same nozzle coming in tomorrow to install on my KP that my uncles mk3s+ has to make sure as many variables are taken into account.
Best of luck to all the Anycubic folks out there, the aftersales support is the worst and Ultimakers forum is a bit silent in these regards.
Cross check with this thread:
https://forum.prusa3d.com/forum/prusaslicer/profile-for-anycubic-kobra/
Cheerio,
RE: transfer custom gcode in Prusaslicer?
Start G-code
G21 ;metric values
G90 ;absolute positioningM82 ;set extruder to absolute mode - if using M82 make bloody sure that the Use Relative E distances is UNTICKED in Printer Settings>General> Advanced
M220 S100 ; Reset Speed factor override percentage to default (100%)
M221 S100 ; Reset Extrude factor override percentage to default (100%)
; Set initial warmup temps
M117 Nozzle preheat
M104 S160 ; set extruder no-ooze temp
M140 S[first_layer_bed_temperature] ; set bed temp
M190 S[first_layer_bed_temperature] ; wait for bed temp
M117 Homing X/Y
G28 X0 Y0 ;move X/Y to min endstops
M117 Homing Z
G28 Z0 ;move Z to min endstops
M117 Heat to Printing Temp
M104 S[first_layer_temperature] ; set extruder temp
M109 S[first_layer_temperature] ; wait for extruder temp
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X2 Y20 Z0.3 F5000.0 ; Move to start position
M117 Printing prime line
G1 X2 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X2.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X2.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 F2400 E-1
G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish
M117 Printing
End G-code
M400 ; Wait for current moves to finish
M220 S100 ;Reset Speed factor override percentage to default (100%)
M221 S100 ; Reset Extrude factor override percentage to default (100%)
G91 ; Set coordinates to relative
G1 F2400 E-3 ; Retract filament 5mm at 40mm/s to prevent stringing
G0 F5000 Z20 ; Move Z Axis up 20mm to allow filament ooze freely
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
M107 ; turn off fan
G90 ; Set coordinates to absolute
;move up 50mm limited for max configured printer height
{if max_layer_z < max_print_height}G1 Z{z_offset+min(max_layer_z+50, max_print_height)} F720 ; Move print head further up {endif}
G0 X0 Y400 F5000 ; Move Heat Bed to the front for easy print removal
M84 ; Disable stepper motors
Personally I think the extruder should be using relative addressing and should be M83 instead of M82. Along with setting the extruder to use relative mode in Printer Settings>General> Advanced. Like the Anycubic Kossel profiles.If doing that then you also need a "G92 E0" in the Before layer change gcode section. If you are using M82 absolute extrusion then you need to remove any G92 from the before/between layers areas.
Other areas to check the settings of - General - Make sure your bed size and Max print height are set correctly. Make sure the correct gcode flavour is selected. If in doubt first select Marlin(Legacy). The other Anycubic printers seem to use that.
Machine Limits - probably want to make sure the dropdown at the top is set for Use for time estimate, if set to emit to gcode those values will be included and over ride your firmware. Its always best to read the values from your firmware and put them in those fields anyway as the time estimate will then be more accurate and if they do get included then the over ride will be setting it to the correct value.
Notes - As the machine is an Anycubic I would add in the "PRINTER_VENDOR_ANYCUBIC" at least. Normally there is also a model specific line that is used for matching compatible profiles. If you wanted this one to have the same matching as say the Mega then you could add in "PRINTER_MODEL_MEGA0" too if needed.
Configuring your Extruder settings is probably going to be the most work with tweaking and testing. I's start with copying the settings from a printer with a similar extruder setup and go from there.
Finally one resource that is very good and should be used is Bob's page located at https://projects.ttlexceeded.com/3dprinting_prusaslicer.html Further info if you want to customise things more, or just want more understanding of how it all works.