Tool Offset Only After Move

Discussion in 'Tool heads & ToolChanger' started by Aluminati, Dec 27, 2019.

  1. Aluminati

    Aluminati Member

    Joined:
    Dec 27, 2019
    Messages:
    7
    Likes Received:
    3
    I am attempting to get the tool change scripts to work the way I would like, but I am having trouble. My current setup is that when tpre is called, the bed drops 10mm, and the head picks up a tool. Then tpost is called and the bed is raised 10mm. When tfree is called, the bed drops 10mm the tool is docked, and then the bed is again raised 10mm. All of that is working fine.

    However, my problem is that the tool offset, which is currently set at -5mm in the config.g file, is not actually applied until some other movement in one of the axes is made. In other words, the bed does not drop by the tool offset amount until the head is moved. This is probably fine if you are printing something in the front or the middle of the bed. Because, by the time the head moves to the front or the center, the bed has time to drop the required tool offset distance. But, if the print is at the back of the bed, it is possible for the nozzle to strike the print before the bed has time to drop the distance set by the tool offset. Why the offset isn't applied as soon as the tool is picked up, I don't know.

    In order to fix this issue, or work around it, I created a macro to "bump" the head once a tool is picked up so that the nozzle is never over the bed until after the bed has been lowered by the tool offset. My thought being that the macro would move the head so that the bed would then lower the tool offset distance. At the end of tfree, I used

    M98"\sys\ybump.g"

    to call the file I named "ybump.g"

    Then in ybump.g I just did

    G91
    G1 Y-1
    G90

    This moved the head -1mm, but did not work to "activate" the tool offset.

    I would like to make it so that it is impossible for the nozzle to be over the bed before the bed has been lowered by the tool offset. Any help in resolving this would be appreciated.
     
  2. Greg_The_Maker

    Greg_The_Maker Administrator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    1,035
    Likes Received:
    633

    This has never been a problem, if you have edited any of the scripts I suggest putting them back to default. there is a command in the tpre scripts to lower the bed by a set amount when a tool is picked so the tool clears the bed. there are no other movement commands for the bed until the print is resumed by the sliced gcode. this mean that the print will always be clear of the nozzle and it will only come back to the correct height on print resume. it should never be in a position to collide with the tool, unless it has not been setup correctly. I suggest you remove the command to raise the bed back up by 10mm, that would probably be the problem.
     
  3. Aluminati

    Aluminati Member

    Joined:
    Dec 27, 2019
    Messages:
    7
    Likes Received:
    3
    Greg, thanks for the quick reply. I will put things back the way they were and give it a go.

    The reason I started fiddling with this was because I noticed that the bed constantly dropped during the toolchange_test.gcode macro and never came back up. Then I read mhe's solution on this thread https://forum.e3d-online.com/threads/tool-change-scripts.3310/ But, when I attempted to do the same thing, I ran into this tool offset situation and realized that the tool offset was not applied until after another axis moved. So I tried to "fix" that, which didn't work and here we are.

    Sometimes the rabbit hole goes someplace cool, sometimes it's just a dead end.
     
  4. Greg_The_Maker

    Greg_The_Maker Administrator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    1,035
    Likes Received:
    633
    don't worry about the bed movement in the test code, it just to test tool changes. I'll add a note in the documentation :)
     
    Killercds likes this.
  5. smoki3

    smoki3 Active Member

    Joined:
    Aug 19, 2019
    Messages:
    41
    Likes Received:
    11
    This is probably the firmware bug which I adressed to the reprap dev. It is now fixed in RRF3.x and won't be fixed in 2.x as there will no future releases. You can but a M400 at the beginning of all you scripts. This will update the coordinates and stops unwanted movements.
     
    Nibbels likes this.
  6. Nibbels

    Nibbels Well-Known Member

    Joined:
    Dec 12, 2019
    Messages:
    172
    Likes Received:
    32
    I already use RRF3

    What I especially like is to move the gcode part where the bed goes down (to space the extra height of the tools heaterblock) into
    "tpostX.g" instead of "tpreX.g".
    Then we have a state.currentTool which is not -1.

    -> So using that spacing code in "tpostX.g" the nozzle is at Z+1mm

    G91
    G1 Z{-1 * tools[state.currentTool].offsets[2] + 1} F1000
    G90
     

Share This Page