Page MenuHomeAleph Objects Inc

Modify Tool Head Switch Mechanics
Closed, ResolvedPublic

Description

We need to add a Z lift to Cura Engine right before a tool head change occurs, and lower the Z back down once travel moves to the new location are complete. This will prevent color/material bleeding when switching tool heads during dual extruder prints.

Issue: In the video shown below, when the tool head switches to the "blue" extruder (T1), the hot end is originally lowered into place over the green material. This will then travel to the blue area before extruding.

Example gcode that is currently generated:

G0 F2625 X125.372 Y151.535
G1 F900 X125.775 Y151.938 E61.83085 
G0 F2625 X125.536 Y152.076 
G1 F180 E53.83085 
G92 E0 
T1	
G92 E0 
M109 S210 
M104 T0 S180 
G0 F2625 X125.536 Y152.076 Z0.43 
G1 F600 E-1.75 
G0 F2625 X125.536 Y162.076 
G1 F180 Z2.43 
G0 F2625 X114.289 Y153.258 Z2.43 
;TYPE:SKIRT
G1 F180 Z0.43 
G1 F600 E0 
G1 F900 X119.785 Y148.505 E0.24489 
G1 X123.743 Y144.742 E0.42894

We would like the gcode to modified to:

G0 F2625 X125.372 Y151.535
G1 F900 X125.775 Y151.938 E61.83085 
G0 F2625 X125.536 Y152.076 
G1 F180 E53.83085 
G92 E0 
G1 F180 Z2.43 ; Z hop 2mm (based on z hop setting)
T1	
G92 E0 
M109 S210 
M104 T0 S180 
G0 F2625 X114.289 Y153.258 Z2.43 
G1 F600 E-1.75 
;TYPE:SKIRT
G1 F180 Z0.43 ;Drop z hop 2mm (based on z hop setting)
G1 F600 E0 
G1 F900 X119.785 Y148.505 E0.24489 
G1 X123.743 Y144.742 E0.42894

The best way to describe this is to Lift the head after the last extruder move before the T0 or T1, and drop the head back after the last X/Y travel move but before the next extrusion move.

Original Ticket was T1263. I have merged it in for reference, but it was messy. Please let us know if you have any questions or need any clarification.

Event Timeline

karrad created this task.Sep 5 2018, 10:23 AM
karrad triaged this task as Normal priority.
karrad created this object with edit policy "Cura LulzBot Edition (Project)".
karrad updated the task description. (Show Details)
tutley added a subscriber: tutley.Sep 5 2018, 10:53 AM

@karrad here is the old code for the toolhead change with z hop.

G0 F2625 X125.372 Y151.535
G1 F900 X125.775 Y151.938 E61.83085 ;Printing T0
G0 F2625 X125.536 Y152.076 ;Final Position for T0
G1 F180 E53.83085 ;Retract T0
G92 E0 ;Set TO extruder position to 0
T1 ;Change to T1
G92 E0 ;Set T1 extruder position to 0
M109 S210 ;Wait for T1 to reach 210C
M104 T0 S180 ;Set T0 to 180C standby temp
G0 F2625 X125.536 Y152.076 Z0.43 ;Move T1 to final position for T0
G1 F600 E-1.75 ;Retract T1 1.75mm of filament (based on retraction distance setting)
G0 F2625 X125.536 Y162.076 ;Move T1 back in y axis 10mm (not sure why this is in here)
G1 F180 Z2.43 ;Z hop 2mm (based on z hop setting)
G0 F2625 X114.289 Y153.258 Z2.43 ;Move to start position for T1
;TYPE:SKIRT
G1 F180 Z0.43 ;Drop z hop 2mm (based on z hop setting)
G1 F600 E0 ;Move T1 extruder to position 0
G1 F900 X119.785 Y148.505 E0.24489 ;Begin printing T1
G1 X123.743 Y144.742 E0.42894

Here is the new code:

G0 F2625 X125.372 Y151.535
G1 F900 X125.775 Y151.938 E61.83085 ;Printing T0
G0 F2625 X125.536 Y152.076 ;Final Position for T0
G1 F180 E53.83085 ;Retract T0
G92 E0 ;Set TO extruder position to 0
G1 F180 Z2.43 ;Z hop 2mm (based on z hop setting)
T1 ;Change to T1
G92 E0 ;Set T1 extruder position to 0
M109 S210 ;Wait for T1 to reach 210C
M104 T0 S180 ;Set T0 to 180C standby temp
G0 F2625 X114.289 Y153.258 Z2.43 ;Move to start position for T1
G1 F600 E-1.75 ;Retract T1 1.75mm of filament (based on retraction distance setting)
;TYPE:SKIRT
G1 F180 Z0.43 ;Drop z hop 2mm (based on z hop setting)
G1 F600 E0 ;Move T1 extruder to position 0
G1 F900 X119.785 Y148.505 E0.24489 ;Begin printing T1
G1 X123.743 Y144.742 E0.42894

I have verified this does work correctly

karrad updated the task description. (Show Details)Sep 5 2018, 11:04 AM
karrad updated the task description. (Show Details)Sep 5 2018, 11:07 AM
karrad assigned this task to victor_larchenko.
karrad added subscribers: alexei, anolen, Steven and 6 others.

@victor_larchenko Please provide a status update on this ticket. let us know if there is any confusion on the request

@karrad Cura engine code not provide any possibilities to change z inside one layer, same issue like in T3474. To perform this change we need to add major changes to engine architecture.

@victor_larchenko Okay, we will get an answer on T3474 for you today

@victor_larchenko: How is Z-hop implemented? Also, could this be done as a post-processing plugin?

karrad added a comment.Oct 1 2018, 7:27 AM

@victor_larchenko Looking through the .gcode output, there are some comments about what is currently being printed such as ;TYPE:SKIRT, ;TYPE:WALL-INNER, etc.

If it is not possible to add a Z move, would you be able to move the print head over the priming tower before doing the tool head switch? I think we would need to add in a similar comment for ;TYPE:PRIME-TOWER and modify the engine to move to that location before inserting a T0 or T1.

What are your thoughts to this approach?

@karrad, it could be implemented like now in T3474. I missed z-hops on first look. So if test results will be ok, I can add this feature to this task too.

karrad added a comment.Oct 8 2018, 9:16 AM

@victor_larchenko Through testing, we will not need the Z movement implemented. We are not seeing a large difference. Will you be able to implement moving to the prime tower before the tool head switch is made?

tutley added a comment.Oct 8 2018, 9:25 AM

@karrad the change we need to see for improved quality isnt just a z hop, its a z hop, toolchange, then move to new position before dropping z, currently i am still seeing z up toolchange z down then move to new position.

@karrad ideally, this would remove the need for a prime tower entirely, which would be a huge bonus for this machine.

karrad added a comment.Oct 8 2018, 9:58 AM

@tutley See victors comment above:

@karrad Cura engine code not provide any possibilities to change z inside one layer, same issue like in T3474. To perform this change we need to add major changes to engine architecture.

While having that change is ideal, it does not look to be possible within our given time frame. (Working on additional resources, this may change) By moving to the prime tower before a tool head switch, it would prevent the color bleed and blobs while awaiting to reach the tool heads temperature correct?

Its not so much a matter of waiting for the toolhead to reach temp, the standby nozzle starts heating up so it is at temp by the time the toolchange is called. The issue is just that unless you have the z dual offset set perfectly between nozzles, on a toolchange one of the nozzles will plunge into the material deposited by the previous nozzle, which causes it to re melt and displace the plastic which creates blobs that are visible on the surface finish. the prime tower isnt really needed, though it does improve the print quality a little bit, since the extruder is priming the material away from the print and then starting printing with a primed nozzle, instead of priming while it starts printing which can cause some blobs.

if toolchanging on the prime tower fixes the print quality issue i think that will suffice, but if we can get rid of the prime tower all together that will be a huge plus since a lot of complaints about dual extrusion are about the wasted material

@karrad, I reviewed code twice and found that we can add such mechanics

In T3524#70730, @tutley wrote:

@karrad the change we need to see for improved quality isnt just a z hop, its a z hop, toolchange, then move to new position before dropping z, currently i am still seeing z up toolchange z down then move to new position.

karrad raised the priority of this task from Normal to High.Oct 10 2018, 10:34 AM

@victor_larchenko Alright, lets move forward with this fix. I am making this high priority, please focus on this ticket for now.

@karrad, pushed fix to T3524 branch. Not sure that it works 100% correctly, need some testing.

@victor_larchenko Thanks, we will get some tests going.

Got a little testing in today. Looks like it is doing what we want, but I am having other issues today preventing much testing at this time.

Code from above video, which is starting at a Z of 0.425

G1 F900 X135.381 Y130.431 E61.30234
G0 F2625 X135.269 Y130.549
G1 F180 Z1.425
G1 F1200 E45.30234
G92 E0
T1
G92 E0
M109 S210
M104 T0 S175
G0 F2625 X135.269 Y130.549 Z1.425
G0 F10500 X135.269 Y130.549 Z2.425
G1 F600 E-1.75
G0 F2625 X135.269 Y140.549 Z1.425
G0 X124.66 Y132.571
G0 X121.636 Y128.656
;TYPE:SKIRT
G1 F180 Z0.425

The one thing I notice is that a second +1Z is occurring briefly in there. Not sure what is up with that, but I don't think it would be a serious problem. @karrad suggested it could be the Z Hop When Retracted option, but we checked and it was disabled.

karrad reassigned this task from victor_larchenko to tutley.Oct 17 2018, 7:55 AM

@tutley @samantha @anolen Giving this one to you guys to test and verify behavior is how we like it. Please run some tests on single headed machines as well.

@karrad
I have run a couple tests on a Mini 2 without issue. I have also diff'd files generated in the master build of 3.2.30 I built last week vs the branch build for this ticket. Only difference between the files appears to be z-hops at layer changes. If I am following things correctly, those moves appear to be from the T3474 change that the branch for this ticket appears to have been branched from. I see no evidence of this change effecting Mini 2 slicing based on what I have looked at today.

this fix has the desired toolchange motion but i am seeing a small issue with it. Currentlly when the toolchange happens we are seeing z hop then retract then toolchange, new position, then z down.

This is causing filament to ooze/blob out when the z hop up occurs.

@victor_larchenko can we get this to have: retract, z hop up then toolchange, move to new position, then z hop down?

karrad reassigned this task from tutley to victor_larchenko.Oct 22 2018, 1:28 PM

@tutley, There is hard to find where is "new position" while exporting gcode from engine. Currently I'm in search of place in code, that controls it.

@karrad Fixed position of z down

jlund added a subscriber: jlund.Oct 30 2018, 4:26 AM
karrad reassigned this task from victor_larchenko to tutley.Oct 30 2018, 7:19 AM

@tutley @samantha Let us know what you think

@karrad @victor_larchenko This is still not quite right.

Here's what i am seeing now : finish printing with toolhead 1, z hop up, Retract, toolchange, prime toolhead 2, new position, z hop down, start printing with new tool

Here's what we would like to see: finish printing with toolhead 1, Retract , z hop up, toolchange, new position, z hop down, prime toolhead 2, start printing with new tool

@victor_larchenko the previous behavior was better. Previously all we needed to switch is the z hop up and retraction.

Here is the previous code:
G1 X109.65 Y142.884 E30.94336
G1 X109.591 Y142.471 E30.94744
G1 X109.542 Y142.069 E30.95118
G1 X109.518 Y141.691 E30.95482
G1 X109.497 Y141.317 E30.95852
G1 X109.49 Y140.956 E30.96209
G0 F9600 X110.244 Y140.156
G1 F180 Z25.99 ; z hop up
G1 F1200 E14.96209 ; retract 16mm filament
G92 E0
T0 ; tool change
G92 E0
M109 S210
M106 S241.9
G1 F900 E13.5 ; move filament to prime position
G0 F10500 X110.244 Y140.156 Z25.99
G0 X110.876 Y143.053
G0 X114.974 Y146.632
G0 X114.976 Y146.731 ; new printing position
M104 S195
;TYPE:WALL-INNER
G1 F180 Z24.99 ; z hop down
G1 F600 E16 ; prime new toolhead
G1 F1500 X113.511 Y148.247 E16.05205 ; begin printing with new toolhead
G1 X113.505 Y148.254 E16.05228
G1 X113.477 Y148.283 E16.05327
G1 X113.158 Y147.92 E16.0592
G1 X113.152 Y147.913 E16.05943
G1 X112.91 Y147.612 E16.06896

Here is thedesired code:
G1 X109.65 Y142.884 E30.94336
G1 X109.591 Y142.471 E30.94744
G1 X109.542 Y142.069 E30.95118
G1 X109.518 Y141.691 E30.95482
G1 X109.497 Y141.317 E30.95852
G1 X109.49 Y140.956 E30.96209
G0 F9600 X110.244 Y140.156
G1 F1200 E14.96209 ; retract 16mm filament
G1 F180 Z25.99 ; z hop up
G92 E0
T0 ; tool change
G92 E0
M109 S210
M106 S241.9
G1 F900 E13.5 ; move filament to prime position
G0 F10500 X110.244 Y140.156 Z25.99
G0 X110.876 Y143.053
G0 X114.974 Y146.632
G0 X114.976 Y146.731 ; new printing position
M104 S195
;TYPE:WALL-INNER
G1 F180 Z24.99 ; z hop down
G1 F600 E16 ; prime new toolhead
G1 F1500 X113.511 Y148.247 E16.05205 ; begin printing with new toolhead
G1 X113.505 Y148.254 E16.05228
G1 X113.477 Y148.283 E16.05327
G1 X113.158 Y147.92 E16.0592
G1 X113.152 Y147.913 E16.05943
G1 X112.91 Y147.612 E16.06896

karrad reassigned this task from tutley to victor_larchenko.Oct 30 2018, 3:52 PM

@victor_larchenko We tried to get an example of the desired gcode, please let us know if you have any questions.

@karrad @tutley Swiched z hop up and retraction.

@victor_larchenko We are doing some EMI testing today, and may not have feedback for you until tomorrow. We will be sure to update here

Here is a bit of the code I generated today using this change. Looks like we got what was requested. Only issue I see with this block is that there is still the additional Z+1 on line 11. I am running this code now.

G1 X159.321 Y145.441 E43.9609
G0 F6562.5 X159.217 Y145.545
G1 F1200 E27.9609; retract
G1 F180 Z1.675; hop up
G92 E0
T0; tool change
G92 E0
M109 S195
M104 T1 S175
G0 F6562.5 X159.217 Y145.545 Z1.675
G0 F10500 X159.217 Y145.545 Z2.675
G1 F1200 E14.25; move filament to prime position
G0 F6562.5 X159.217 Y155.545 Z1.675
G0 X163.564 Y148.154
G0 X163.965 Y146.788
G0 X164.177 Y145.613
G0 X164.291 Y144.392
G0 X164.279 Y142.969
G0 X163.824 Y140.773
G0 X163.494 Y139.754
G0 X163.023 Y138.746
G0 X162.391 Y137.792
G0 X161.631 Y136.918
G0 X151.357 Y127.556
G0 X150.15 Y126.644
G0 X148.891 Y125.893
G0 X146.984 Y125.277
G0 X145.587 Y124.914
G0 X143.452 Y124.584
G0 X140.7 Y124.422
G0 X138.125 Y124.461
G0 X135.869 Y124.668
G0 X134.412 Y124.92
G0 X133.152 Y125.237
G0 X132.883 Y125.368
G0 X133.258 Y126.762
G0 X132.605 Y128.076
G0 X132.508 Y128.056; new print position
M104 S205
;TYPE:WALL-INNER
G1 F180 Z0.675; z hop down
G1 F600 E16; prime new toolhead
G1 F1350 X132.432 Y127.98 E16.00211; begin printing with new toolhead
G1 X132.042 Y127.589 E16.01293

@victor_larchenko This behavior is much better!

tutley added a comment.Nov 8 2018, 9:50 AM

@victor_larchenko any updates on the extra z hop @samantha mentioned?

karrad reassigned this task from tutley to victor_larchenko.Nov 8 2018, 12:56 PM

@victor_larchenko Sorry I had missed getting this one assigned back to you. It looks like we have an extra Z movement that is not required, highlighted in bold here below. Would it be possible to remove that extra movement?

G0 F6562.5 X159.217 Y145.545 Z1.675
G0 F10500 X159.217 Y145.545 Z2.675
G1 F1200 E14.25; move filament to prime position
G0 F6562.5 X159.217 Y155.545 Z1.675

@karrad @tutley This was additional engine priming move that was not handled correctly. Now it should work.

Everything looks good now, thank you.

karrad reassigned this task from victor_larchenko to alexei.Nov 20 2018, 8:03 AM

We are ready to merge this for alpha quiver testing

alexei closed this task as Resolved.Nov 20 2018, 8:38 AM

Merged to master.