Tool Change Speed

Ok so I've got my printer printing with the help of you guys.  Thanks!  Now I am working on printing with multiple extruders.  I've got my offsets just about perfect and all extruders are pretty much as level as I can get them and I have printed a multi color calibration object and all is well, except the tool change speed is extremely slow.  I set it from 100 mm/s to 150 mm/s and, as learned on other issues, reset my EEPROM so any settings get erased when I upload the firmware.  The only thing that I need in EEPROM is my bed level mappings and I can relevel the bed after uploading.

As seen in other posts, I get those ah ha moments, but I only see one place that adjusts tool change speed and it is definitely not going 150 mm/s like I have set.

Thanks again for your help guys :smile:

Comments

  • Not sure which value you found, but EXTRUDER_SWITCH_XY_SPEED is the one used when switching between extruders, unit is mm/s. It is not stored in eeprom.
  • edited May 2
    Yep, that's what I changed from (default?) 100 mm/s to 150 mm/s and it makes no difference.  It takes 20 seconds per tool change and the furthest distance is 73 mm on the diagonal from extruder 1 to extruder 4.  At 150 mm/s that should take less than 1 second to switch.  I know it is not going to go 150 mm/s as my x and y max speeds are 80 mm/s to keep from skipping (I still need to fix that), but this thing slows way down during a tool change.

    I know I have an odd setup, so maybe there is something else that may affect it also?

    I also went though Simplify3D and could not find any settings for tool change speed, just tool change retract speed and that was 25 mm/s and if that affected it then it would only take 3 seconds.

    On the plus side, I'm 75% done with a 4 color print that the other firmware could not get 10% through.  It's just taking several hours longer than expected.  So far I love this firmware and am so close to donating :smile:
  • The code is in Extruder.cpp function void Extruder::selectExtruderById(uint8_t extruderId)

    near end of the function you have

    if(Printer::isHomedAll()) {

    Printer::moveToReal(cx, cy, cz, IGNORE_COORDINATE, EXTRUDER_SWITCH_XY_SPEED);

    }

    which I'm quite sure is the move command to activate your new offset. And it is definitely much faster for me when switching. Of course it will respect max. limits per axis but 20s is too much if it is that move and not raising/lowering z with low speed.

    Do you have any scripts for the extruders that run or use a different command to switch then T0/T1/T2/T3? As it normally works faster I wonder if there is a conflict or something else causing the slow move like commands executed on selection/deselection. Especially the select string command gets executed after the offset has changed, so if there is a slow move inside it will activate already offset with that given speed.

  • edited May 9
    I just got the printer working again and am back to this issue.  This printer did have Marlin on it and it did the tool switching quite fast.  I am using Simplify 3D and there are no offsets set in there and there are no tool change scripts set.  I cannot find anything else in the slicer that would affect tool change.

    Now to your post.  I've been diggin through the Extruder.cpp and I only see 3 places where EXTRUDER_SWITCH_XY_SPEED is used.  I'll go through and tell you what I see.  Please correct me if I'm wrong on any of these.

    1. This one only applies to dual x axis

    #if DUAL_X_AXIS
    #if LAZY_DUAL_X_AXIS
        if(Printer::sledParked) {
            dualXPosSteps = Printer::lastCmdPos[X_AXIS] * Printer::axisStepsPerMM[X_AXIS] - Printer::xMinSteps; // correct to where we should be
        }
    #endif // LAZY_DUAL_X_AXIS
        if(Printer::isXHomed() && executeSelect
    #if LAZY_DUAL_X_AXIS
                && !Printer::sledParked
    #endif
          ) { // park extruder that will become inactive
            bool oldDestCheck = Printer::isNoDestinationCheck();
            Printer::setNoDestinationCheck(true);
            PrintLine::moveRelativeDistanceInSteps(current->xOffset - dualXPosSteps, 0, 0, 0, EXTRUDER_SWITCH_XY_SPEED, true, false);
            Printer::setNoDestinationCheck(oldDestCheck);
    #if LAZY_DUAL_X_AXIS
            Printer::sledParked = true;
    #endif
        }
    #endif

    2. This one also only applies to dual x axis, but NOT lazy dual x axis

    #if DUAL_X_AXIS
        // Unpark new current extruder
        if(executeSelect) {// Run only when changing
            Commands::waitUntilEndOfAllMoves();
            Printer::updateCurrentPosition(true); // does not update x in lazy mode!
            GCode::executeFString(next->selectCommands);
        }
    #if LAZY_DUAL_X_AXIS == 0
        if (executeSelect) {
            Printer::currentPositionSteps[X_AXIS] = Extruder::current->xOffset - dualXPosSteps;
            if(Printer::isXHomed()) {
                PrintLine::moveRelativeDistanceInSteps(-next->xOffset + dualXPosSteps, 0, 0, 0, EXTRUDER_SWITCH_XY_SPEED, true, false);
                Printer::currentPositionSteps[X_AXIS] = dualXPosSteps + Printer::xMinSteps;
            }
        }
    #endif // LAZY_DUAL_X_AXIS == 0

    3. This one looks like it wants to work, but only if you home all... or is the isHomedAll referring to if a home all was done since power on?

    #if DUAL_X_AXIS == 0 || LAZY_DUAL_X_AXIS == 0
    #if RAISE_Z_ON_TOOLCHANGE > 0 && !LAZY_DUAL_X_AXIS
    if (Printer::isZHomed()) {
    Printer::moveToReal(IGNORE_COORDINATE, IGNORE_COORDINATE, cz, IGNORE_COORDINATE, Printer::homingFeedrate[Z_AXIS]);
    Printer::lastCmdPos[Z_AXIS] = lastZ;
    }
    #endif
    if(Printer::isHomedAll()) {
    Printer::moveToReal(cx, cy, cz, IGNORE_COORDINATE, EXTRUDER_SWITCH_XY_SPEED);
    }
    #endif

  • Another thing I noticed is when I told the printer to print only from extruder 2 it did the same thing.  Once everything was heated the carriage very slowly moved left until extruder 2 is exactly where extruder 1 was then it starts moving at normal speeds and starts printing.

    If you need a sample gcode, my config.h and a video showing when it happens and what it is doing, just let me know.
  • Yes 3. is what I assume will happen. isHomedAll means if you homed before so the position is valid and known.

    A smallest gcode causing the slow move would be helpful to analyse. I have seen such moves when the stored and real position differ. Problem is that V1 has so many coordinate systems to keep watching. So I hope this will also get easier in V2, but of course should still work correct in V1.
  • I just moved all my offsets to Simplify 3D and it is doing fine.  I do not like doing it that way because the preview is all wacky.  I'm going to finish this print (offset calibration cube) so I can get the measurments then I'll grab a tool change part of the gcode and post it.  I'll also grab a toolchange section of the gcode from one where S3D does NOT handle the offsets and post it also.
  • edited May 10
    Here are the sample gcode.  Let me know if you need me to send my firmware or config.h file.  The line ; process Process2 is where the toolchange starts in both files.

    This is the gcode without the Simplify 3D offsets and the actual offsets are in the extruder section of the firmware and it takes 20 seconds to do the toolchange:

    ; infill
    G1 X148.940 Y133.614 F4500
    G1 Z2.350 F1002
    G1 E0.0000 F4800
    G92 E0
    G1 X149.916 Y132.637 E0.0469 F2321
    G1 X149.916 Y126.980 E0.2388
    G1 X143.283 Y133.614 E0.5570
    G1 X138.596 Y133.614 E0.7160
    G1 X138.596 Y132.643 E0.7490
    G1 X148.946 Y122.294 E1.2455
    G1 X143.289 Y122.294 E1.4374
    G1 X138.596 Y126.987 E1.6626
    G92 E0
    G1 E-5.0000 F1500
    G1 Z2.550 F1002
    ; process Process2
    M117 Layer 19, Z=2.350
    T3
    ; tool H0.200 W0.400
    ; inner perimeter
    G1 X150.256 Y149.954 F4500
    G1 Z2.350 F1002
    G1 E-0.5000 F1500
    G92 E0
    G1 X138.256 Y149.954 E0.3951 F1774
    G1 X138.256 Y137.954 E0.7903
    G1 X150.256 Y137.954 E1.1854
    G1 X150.256 Y149.954 E1.5805
    G92 E0
    G1 E-2.8000 F4800
    G1 Z2.550 F1002
    G1 X150.656 Y150.354 F4500
    G1 Z2.350 F1002
    G1 E0.0000 F4800
    G92 E0
    G1 X137.856 Y150.354 E0.4215 F1774
    G1 X137.856 Y137.554 E0.8429
    G1 X150.656 Y137.554 E1.2644
    G1 X150.656 Y150.354 E1.6859
    G92 E0
    G1 E-2.8000 F4800
    G1 Z2.550 F1002
    ; outer perimeter


    This is the gcode where Simplify 3D controls the offsets and all offsets in the firmware are 0 and the toolchange takes 4 seconds or less:

    ; infill
    G1 X148.940 Y133.614 F4500
    G1 Z2.350 F1002
    G1 E0.0000 F4800
    G92 E0
    G1 X149.916 Y132.637 E0.0469 F2321
    G1 X149.916 Y126.980 E0.2388
    G1 X143.283 Y133.614 E0.5570
    G1 X138.596 Y133.614 E0.7160
    G1 X138.596 Y132.643 E0.7490
    G1 X148.946 Y122.294 E1.2455
    G1 X143.289 Y122.294 E1.4374
    G1 X138.596 Y126.987 E1.6626
    G92 E0
    G1 E-5.0000 F1500
    G1 Z2.550 F1002
    ; process Process2
    M117 Layer 19, Z=2.350
    T3
    ; tool H0.200 W0.400
    ; inner perimeter
    G1 X114.606 Y80.034 F4500
    G1 Z2.350 F1002
    G1 E-0.5000 F1500
    G92 E0
    G1 X102.606 Y80.034 E0.3951 F1774
    G1 X102.606 Y68.034 E0.7903
    G1 X114.606 Y68.034 E1.1854
    G1 X114.606 Y80.034 E1.5805
    G92 E0
    G1 E-2.8000 F4800
    G1 Z2.550 F1002
    G1 X115.006 Y80.434 F4500
    G1 Z2.350 F1002
    G1 E0.0000 F4800
    G92 E0
    G1 X102.206 Y80.434 E0.4215 F1774
    G1 X102.206 Y67.634 E0.8429
    G1 X115.006 Y67.634 E1.2644
    G1 X115.006 Y80.434 E1.6859
    G92 E0
    G1 E-2.8000 F4800
    G1 Z2.550 F1002
    ; outer perimeter

  • Not really unusual the code. The only thing I see is that you set official feedrate to 1002 in these cases which is 16.7mm/s. If that speed would be used it would take 4.4s and not 20s, so this is also not the case. And if oyu have no start/end gcode scripts in firmware there is no obvious reason to be so slow.
  • Yea I've been racking my brain but then realized that the slicer looks ahead when it does the toolchange, extruder 2 goes directly where it needs to print while the firmware cannot do look ahead and extruder 2 goes where extruder 1 was then goes to the proper location.  I do not like the way Simplify 3D previews the object with the offsets, but I'm reaching out to them about that.  With the dual extruder calibration cubes I am printing, it takes 1 second to get there using the slicer offsets.  I still need to work on the ooze from the "resting" extruder, but that's a whole other issue lol.

    I don't know why my setup does odd things, but I really appreciate your help with everything.  Now off to figure out my TMC issues :confused:
  • One thing i had to think about is why you always test/talk about the diagonal move. Do the side moves work fast and it only happens on diagonal change?
  • Nope.  Every tool change is the same.  I used the diagonal as it is the longest distance and should only take a second or two where the other 2 should be faster.  But S3D does the toolchange really fast.
Sign In or Register to comment.