Problems with gcode when changing tool on dual

Discussion in 'Calibration, Help, and Troubleshooting' started by Alex9779, Mar 24, 2016.

  1. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    Ok I think I found what my problem is with dual printing tool change.
    I didn't do much yet but here is what I found during my very first tests.
    I used my scripts and S3D profile, the tool change script was only change so far that it is a bit more fail safe, nothing of the logic changed.
    My prints always start with T0 then a change top T1 is made.
    The tool change retraction and extra restart distance are the values from Greg's profile.

    So what I found is:
    • after switching to T1 on the very first layer T1 is not extruding for several millimeters
    • I have over extrusion after switching tools
    And now I think I found out why that happens.
    I closely examined the gcode produced.

    When starting a print the start script runs. That's ok.
    Right after the start script S3D inserts a retraction for the current tool with the set retraction distance:
    Code:
    G1 E-1.5000 F4200
    Ok. Then come the tool change script where nothing happens other than priming the new extruder because an old extruder does not exists yet.
    That's ok too because I did the purge script for each extruder at the end of the last rpint so this has to be reversed.
    After priming still in the tool change script I retract for the normal retraction distance:
    Code:
    G1 E-1.5 F3000
    That's part of Greg's development.
    I think this is there to prevent dropping/oozing while moving to continue the print. Fine so far.
    Next is that the tool change script ends and S3D step in again moving to position to continue and then reversing the retraction because S3D thinks it has done one.
    In reality the retraction did not come from S3D code but from the tool change code.

    If we get now to the point when we switch tool on the first layers rises a problem:
    S3D retracts the amount set in tool change retraction. That's ok.
    Then the tool change script kicks in, purges the old extruder and primes the new one.
    At the end of the prime the script it retracts to prevent oozing as earlier told.
    But S3D does not revert that retraction when staring to print because what S3D thinks that tool has not been retracted yet so theres no need to revert it!

    Now to my second problem, the over extrusion.
    Somehow this is related.
    S3D retracts the tool change retract when changing tools so if it gets back to that tool it reverse that amount + the extra restart distance. In my case this is 2 + 0.5. But in the tool change script I only retract 1.5mm.
    So I have +1mm extra distance which results in that overextrusion.


    So how to fix?

    To fix the second problem I just have to set the tool change retraction settings to the same as the normal retraction and the script prime part has to cover that too.
    Then that should be ok.
    The steps S3D does are as follows:
    1. layer on T0 ends
    2. T0 is retracted by tool change retraction values
    3. T0 is purged by our script
    4. ... (printing with T1)
    5. we get back to T0
    6. T0 is primed by our script
    7. T0 is retracted by our script
    8. T0 retraction is reversed by tool change retraction values
    So far so good.

    But I have no idea how to fix the first problem.

    To solve this I think there has to be some changes in S3D. I would need the ability to check in the tool change script if I am on layer 1 or not. Then I would be able to tell the script to not retract on layer 1 which will result in some oozing while moving over the bed but I would be ok with that.
    Or S3D would do the same as when starting with tool 0. There it retracts after the start script then the tool change script is run and then the layer startes it reverses that retraction.
    This is not done for the second tool on layer 1 which is a bug IMHO.
    It should also retract the second tool when switching to it the very first time, then run the tool change script and then unretract...

    What do you think?
     
  2. PsyVision

    PsyVision Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    798
    Likes Received:
    248
    Can you raise the issue with the S3D team? Also, there is a current_z_position variable, can you compare when that is a set value that corresponds to the first layer height and carry out an extra command?
     
  3. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    I saw that but then you again have always to alter the script when you change the layer height.
    Annoying enough you gotta change the scripts every time you change filaments...
     
  4. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,095
    Likes Received:
    322
    Can you not fix the first issue by simply printing the skirt with both extruders instead of one? That way they both go through a full cycle.
     
    Alex9779 and PsyVision like this.
  5. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    For this I would really use Slic3r. There you have much more options to use variables in scripts...
     
  6. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    That could be a solution. Going to try that and analyze the code again...
     
    PsyVision likes this.
  7. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,095
    Likes Received:
    322
    I find printing the skirt with both extruders has also a second benefit: you can see whether you've attempted to print too wide an area before wasting a ton of filament.
     
  8. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    @Spoon Unit thanks for that suggestion, haven't thought of that.
    That indeed solves the problem at least for the first layer of the real model...
    I will alter my profile accordingly.
     
  9. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    I would if I could really descibe it.
    From one point of view it seems like an error but on the other hand it might make sense.

    I would rather see extended options in the script to be able to make more sophisticated logics AND to have options what S3D does in its own produced code.

    For example when you do what I do, use the temp values for the extruders in the start script, the temp stuff is omitted by S3D. There should be options to tell S3D that I take care of retraction in the script myself.
    Thus then you need additional scripts like a script that will be run jsut before start printing a layer but the head already move into position...
     
  10. Kick2box

    Kick2box Well-Known Member

    Joined:
    Mar 15, 2016
    Messages:
    198
    Likes Received:
    27

Share This Page