Thanks a lot. I will try it and report back. As for EXTRUDERS=[????????????], this would be the number of extruders defined in machine settings, so I think EXTRUDERS={extruders_enabled_count} would work.
GregValiant 1,359
"extruders_enabled_count" is one of the new ones and it works.
5.9.0 will have more flexibility. It will allow something like this:
{if initial_extruder_nr==0}
EXTRUDER_TEMP={material_print_temperature_layer_0,0}
EXTRUDER_TEMP1=175
{else}
EXTRUDER_TEMP=175
EXTRUDER_TEMP1={material_print_temperature_layer_0,1}
{endif}
Edited by GregValiant- 1
I can report your suggestions worked for me. This is my current start gcode including one of your conditional gcode following an example you posted:
{'M605 S2' if 'COPY' in machine_name else ';M605 S2'}
{'M605 S3' if 'MIRROR' in machine_name else ';M605 S3'}
{'M605 S1' if 'DUAL' in machine_name else ';M605 S1'}
START_PRINT EXTRUDER_TEMP={material_print_temperature_layer_0,0} EXTRUDER1_TEMP={material_print_temperature_layer_0,1} BED_TEMP={material_bed_temperature_layer_0} EXTRUDER={initial_extruder_nr} EXTRUDERS={extruders_enabled_count} RETRACT={retraction_amount,0} RETRACT1={retraction_amount,1}
And gets translated in the gcode file to:
;M605 S2
;M605 S3
M605 S1
START_PRINT EXTRUDER_TEMP=210 EXTRUDER1_TEMP=210 BED_TEMP=60 EXTRUDER=1 EXTRUDERS=2 RETRACT=0.8 RETRACT1=0.8
Now if there was a way to change the build plate size from the print profile for MIRROR and COPY modes, as I just wish to use the same machine for everything.
GregValiant 1,359
I thought about the build plate problem as well. As far as I know there isn't a way to change the build plate on-the-fly and it involves other machine settings as well.
A second problem would be that setting the M605 mode is currently dependent on the "machine_name" so it is necessary to change printers to change the mode.
It's been a while and I'd have to look at it again, but I scribbled up a plugin for the SOVOL SV04. It has an "automatic" function that looks at the machine_name to determine the M605 mode, and it has a manual function where the user picks the mode from a dropdown list. The "manual" function is therefore independent of the machine_name.
In regards to the SV04 - it doesn't have a custom "platform" that shows in Cura. If there was a 302 x 302 platform for the printer a user could etch a line at the 115 mark (platforms are just models that are displayed differently) and the same platform could be used for all 5 possible modes. The user would then select the mode from the dropdown, and place the model within the 115mm wide portion of the build plate. It does require that the user "remember" what to do, but it gets rid of 4 printer definitions.
This is how I thought it could be handled. I don't have one of those printers to debug with and Virtual Debugging never works out well.
If you were to make a platform like this for your printer you might be able to use a single definition file and handle the modes with a plugin/post-processor. You can see that I've subtracted a wedge from the top of this platform at the 115mm mark. In Mirror or Copy, the model would need to be in that narrow strip on the left. That's the plan anyway but I'm back to Virtual Debugging here. If your printer is an "Origin at Center" machine then the Mirror/Copy model area might have to be in the middle of the platform.
Edited by GregValiant
So far the most elegant solution regarding mirror and copy modes is on Ideamaker. It auto calculates the printable area from the machine and head definitions, and even renders the duplicate or mirror object:
My printer started as a Sovol SV04, although all that is left of the original machine is the chasis and heated bed, the rest has been redesigned or replaced.
I have the Printer Settings plugin and machine_name is being taken from Machine Type, so I have created 3 printing profiles: DUAL, COPY, MIRROR and the appropriate M605 is obtained. My heads have to be 67mm from each other to avoid colliding, so in copy mode my usable bed would be half of total width, and in mirror mode, half - (67/2). The proposed platform model solution would seem to work if I greyed out the area for mirror and copy modes. The problem here is I am using a Custom FFF machine profile and AFAIK it doesn't allow custom platforms, so I would need to modify an existing printer with a platform.
I wish I could test your plugin, but since I am on Klipper with custom macros, I don't think it works the same as the stock Marlin.
GregValiant 1,359
Sovol went the same direction as Raise3D did. The M605 is taken care of natively. A big part of that is IdeaMaker is the Raise3D slicer and so supports their printers very well.
Cura doesn't directly support IDEX printers. UltiMaker doesn't make one and originally, the slicing software had to account for the A and B axes (sometimes V and W). There were no real standards and each manufacturer came up with their own solution. Flash Forge is still an oddball and a post-processor must re-write much of a Cura gcode to make it acceptable to a Flash Forge IDEX machine.
But the Sovol can be made to work with Cura. I know it's clumsy to have to pick from 5 printers depending on the mode you want but the upside is that it actually works quite well.
Here is the plugin. Unzip it and place the main folder into your Configuration Folder and the "plugins" sub-folder. When you start Cura you will find the plugin settings in the "Dual Extruder" settings. It will be available even if you are in a single extruder mode. There are double folders with the same name and that's how it should be set up in Cura.
Mine looks like this:
C:\Users\grego\AppData\Roaming\cura\5.8\plugins\SovolSV04_IDEX_Plugin\SovolSV04_IDEX_Plugin
Rather than go through things here I'll let you figure it out. If you don't like it, or something in the code is broken, you can uncheck the "Enable Sovol IDEX" checkbox and it won't run. You can also simply delete the folder from the plugins folder.
As a plugin in works just like a post-processor and it runs after any other post-processors you might have active.
I'll be gone until October 5 so if you have questions or comments you will have to wait till I get back.
Edited by GregValiantThanks. I will try it and report back.
Recommended Posts
GregValiant 1,359
Starting with Cura 5.9 this will get an upgrade. Right now it's a little tough in some situations. For example: There is no way to really call the extruder that is not the "Initial Extruder". If your print were to start with T1 it creates a clumsy situation when trying to NOT heat T0.
You will have to translate this but if it was just for Cura:
M104 S{material_print_temperature_layer_0,0} T0
M104 S{material_print_temperature_layer_0,1} T1
G1 F{retraction_retract_speed*60,0} E-{retraction_amount,0} T0
G1 F{retraction_retract_speed*60,1} E-{retraction_amount,1} T1
Cura stores the variables in "Stacks". Calling for items from the Global Stack is doable but when you need to call something from the "Extruder Stack" it's either clumsy or impossible. This is being worked on and some additional items from AHoeben's list will be useable in the StartUp.
If you go through and search the "fdmprinter.def.json" file for a particular setting you will see it's attributes. If the setting is marked '"settable_per_extruder": = true' then it's stored in the extruder stack.
Below is my attempt at a translation. Don't count on this working the first try.
(You cannot get the extruder_count from the Extruder Stack as it also relates to "extruders_enabled" which requires stepping through the extruders to see which are and which aren't. It might be available in 5.9 when it comes out.)
One of the possible problems I see here is that "START PRINT EXTRUDER_TEMP" will be set whether or not Extruder 0 is enabled/used. This is the sort of thing that post-processing would fix.
START_PRINT EXTRUDER_TEMP={material_print_temperature_layer_0,0} EXTRUDER1_TEMP={material_print_temperature_layer_0,1} BED_TEMP=[material_bed_temperature_layer_0] EXTRUDER=[initial_extruder_nr] EXTRUDERS=[????????????] RETRACT={retraction_amount,0} RETRACT1={retraction_amount,1}
Edited by GregValiantLink to post
Share on other sites