Cura work-around
-
@jens55 said in Cura work-around:
The reason I am reluctant to set default temperatures is because those change. PLA and PETG could be covered with 210C but what about higher melting filaments?
That issue is one of the reasons for the approach that I use.
Frederick
-
OK so I am still screwing around with this and trying to find the best solution ..... with questionable luck
To recap one of the issues, Cura uses the T(n) command to change tools followed by a separate temperature command. Duet takes the T(n) command and runs the various tool changing routines. I had tried to issue an M116 in the tpost routine followed by a purge to prime the tool. Well since temperature had not been initially specified, the waiting doesn't happen and the purge doesn't happen but it would seem the purge happens at a later, less convenient time) after Cura has specified the temperature and it is reached.
Taking some of the earlier suggestions, I decided to try a post-process search and replace. I replaced T(n) with G10 P{extruder_nr} S{material_print_temperature}.
Cura uses the variables in curly brackets as place holders and when it generates the gcode file it replaces those values in the place holder with actual values. Alas, post processing happens AFTER Cura has generated the gcode file so even though I had found a way to trick Cura, Cura decided to barf on me instead.
I am back to having no clue on how to do this in an intelligent way that does not require me to interact with Cura on the gcode level as a 'user' .... all I want to do is to hit the 'slice' button and get correct code generated.
<sigh>Yes I tried setting default temperatures in start.g and that does work but I don't like that I have to change the settings for different filament. This is not a user friendly approach. Further, it would seem (please correct me if I am wrong !!!!) that I can not call a purge routine in tpost.g because the underlying gcode that caused tpost.g to run did not specify an extruder temperature but instead relies on the extruder having been turned on during start.g. Problem with that is that if the extruder is called for the first time, it is still cold causing the purge to fail at the commanded time and inserting a blob at a later time when the tool happens to have finished warming up.
I still haven't wrapped my mind around the whole filament system in DWC .... something still to do.
I find it odd that other people that are using Cura on tool changers have not run into that issue ...
Lastly, I have not yet tried to set up a separate purge station to use for all the tools - I don't like the concept of introducing the extra time and motion required rather than doing the purge as the tool is withdrawn from the parking position. This is something that I might be forced into but it's pretty much my least liked approach at the moment.
-
I figured it out! Using the search and Replace script
Use this as the search field:
;Generated with Cura_SteamEngine.* T[0-9]
and this as the replace field:
;Generated with Cura_SteamEngine
And ensure you have checked the box to use regular expresions.
It should work, even after cura updates, as long as the formatting of that generated by message stays the same.
(edit: you have to copy and paste the two lines above, so that cura properly recognizes the invisible newline character. Be careful that after you paste it into curea, there is an invisible newline character between
.*
andT0
)The T[0-9] will replace any tool number from 0-9. If you have more than 9, you'll have to make a regex that searches for more than one digit after T.
-
@bot, can you explain your thinking please? This looks to me like you are just deleting the T(0-9) field
Wouldn't that just kill the gfile as no tools are selected?
Colour me very confused ... -
@jens55 you include both lines from the first "search" field that I wrote up there. Copy and paste those two lines and put them in as the search field.
Then, it will only replace the one Tn command that comes immediately after the words
;Generated by...
-
@bot, I understand that .... but you haven't 'replaced' the T0 with anything. How will Cura handle a gcode file that has no tool selection commands ?
-
@jens55 you will put the tool selection commands in your start gcode for that extruder, in your printer settings in cura
You might have to get rid of those heating commands at the beginning, too. I don't use cura, so I don't know if those can be disabled or you have to rig up a search and replace for those as well.
-
@bot, I see two problems here .... 1) you have removed the tool selection command and so Cura doesn't know to run the start gcodes, 2) how do you get the temperatures that Cura wants to use into the replacement command if, against all odds, Cura somehow knows to run the tool start.g command ?
Still very confused ....
-
@jens55 Cura still puts the start gcodes for the extruders.
In the start gcode, you use those placeholders you spoke about. I'm sure there will be some curly bracket thing that gets replaced with the temperature, the tool number, etc. Is there not?
-
@bot, unfortunately those placeholders don't work in that instance. The placeholders are evaluated as the gcode file is generated but you changed the gcode file after the fact without re-running it through Cura. What you end up with is literally the text of the placeholder in the gcode file and not the value it stands for.
-
@jens55 I don't know where you are putting the placeholders, but surely they are meant to be used in the start gcode. Can you try this and see if it works? Where would the placeholders go? Why would they exist?
-
Any start or finish g codes and what not that are set up in Cura are evaluated when Cura generates the print file and never after. Whatever the gcode is that is in the print file is executed by Duet. The T(n) commands are evaluated by the Duet and replaced with the content of the various tool change macros but those macros have no knowledge of anything from Cura. Since you replaced the T(n) commands with nothingness, Duet never sees a T(n) command and won't run anything related to changing tools.
-
@jens55
You just have to put this in your start g-code:T{extruder_nr}
to get a Tn command.We have only replaced a single Tn command with nothingness. The first one that you don't want.
-
@bot said in Cura work-around:
@jens55 I don't know where you are putting the placeholders, but surely they are meant to be used in the start gcode. Can you try this and see if it works? Where would the placeholders go? Why would they exist?
I tried it in my first post from today where I laid out the whole issue again.
The place holders are inside Cura for Cura's use and have a very narrow focus or scope.. If you set up a startg file for let's say tool1 and in that file you set G10 P{extruder_nr} S(material_print_temperature), the resulting gfile that is the print file will simply have the literal command in there ... likeG10 P{extruder_nr} S(material_print_temperature)
Ok, I am now confusing myself ..... I will have to do some tests .....
-
I don't know what you are doing, but I just tested this and it all works as expected. Put these commands in the area shown here:
This results in the following G-Code in the file:
; Start M82 ;absolute extrusion mode ; CUSTOM TOOL START G10 P0 S200 T0 M83 ;relative extrusion mode M83 ;relative extrusion mode G1 F1500 E-6.5 ;LAYER_COUNT:249 ;LAYER:0
-
Well damn ... in my earlier tests I had some normal brackets slip into my code instead of the curly brackets.
If I insert the following into the start g code of extruder 0 in Cura
G10 P{extruder_nr} S{material_print_temperature}it is evaluated into
G10 P0 S200in the gcode file
So in theory, I could put the correct G10 command in every one of the Cura tool start.g files.
I would then have to delete (in post processing), all instances of T(n) commands that start just after a new line character.This will require a bit more contemplation but might just work. I need to replace all of the instances as a standard tool change given as T(n) doesn't specify temperature so if you have a cold extruder it will not purge. Anyway, back to the problem at hand for more experiments ....
To be continued .....
-
@jens55 I think you're overthinking things. Either that, or cura is not suitable for your printer.
With RRF, once you set the standby and active temperatures, they're set when the tool is selected or deselected. You only have to set G10 temps once, in the corresponding start gcode for the extruder, in cura.
And, with the curly bracket replacement strings, you can make every extruder's start gcode the same template.
Then, you have to search and replace only that one single errant Tn command at the beginning of the file. All subsequent Tn commands would be desirable, and should work as is.
-
@bot, I think I have it worked out thanks to you. I have not actually run the resulting code in Cura, that will be a job for tomorrow (it's nearing 1am here)
My Cura startg code:
;Cura start gcode
T-1
G10 P{initial_extruder_nr} S{material_print_temperature}
M190 S{material_bed_temperature} ;Start heating bed and wait to bed reach temp before proceeding
M116 ; wait for temperatures to reach set values
T{initial_extruder_nr}My Cura tool start g code for every tool:
G10 P{extruder_nr} S{material_print_temperature}
My search and replace post processing code:
search string: \nT[0-9]\n
replace string :
(replace string is empty)This will delete all T commands that are on a line by itself and not affect any T commands that are part of another command. "\n" is a new line character
Also, I would think that it is best to delete all T commands since every instance of T had an instance of G10 added so the T's are no longer needed (and cause problems in the tool changer script I think)
I will post an update tomorrow .... but in theory this meets all my needs - there is no user interaction needed no matter the filament and the purging while the tool is parked should work as well.
I am VERY excited to try this out tomorrow !!!! Thanks !
-
Couldn't wait .... but ran into another snag.
I had assumed that a G10 command would set and select the tool which turns out to be false - it only sets the tool parameters and a T command is still required.
This is throwing a wrench in my plan but I should be able to work around this somehow.
The issue now is that the T command comes first, that tells Cura to insert the tool startg which then inserts the G10 for the tool parameters. Unfortunately the same T command that causes G10 to be inserted also initiates all the tool change macros. I end up with a T command followed by the G10 command and when the tool change macros are run, there is the potential for no temperatures being set for the tool.
I don't know yet if there is a way to put a T command into the Cura start g code section and then, in post processing, remove the initial T command that is later replaced by the T command from the Cura tool startg. This would replace the T command with G10 followed by T and would make sure that the tool is heated when called (yes, there needs to be an M116 in there someplace)My brain is fried for today ....
-
@jens55 keep playing with the START section in Cura (as seen in the image bot posted). In those sections you could insert
T{initial_extruder_nr} P0
To select a tool without running a macro. The {initial_extruder_nr} will be replaced during slicing by Cura.
I don’t think it’s the entire solution, but could help you on your path. Some other info here: https://files.fieldofview.com/cura/Replacement_Patterns.html