Retraction issue when setting extruder temp and wait command

I just changed out the default single toolhead that comes with the TAZ 6 with the new E3D Titan Aero toolhead you can get at ITWork3D. I got the 1.75 version.

I then tried printing a few calibration cubes and noticed many of the times I tried printing the filament would be striped before it started to print. I messed around with it and noticed my startup script would retract the filament right before it ran the nozzle through the wiper.

I pulled out a couple lines of the relevant gcode and came up with these two lines for testing:

M109 S170 ; soften filament for Z homing
G1 E-12 F100 ; retract 12mm filament

Basically it tells the extruder to wait and warm up to 170 before running the next command then the next line would retract 12mm of filament from the extruder to prevent filament from oozing out of the nozzle while doing a wipe and auto bed level.

I thought maybe retracting 12mm was too much for this new toolhead and wanted to step it down to something like 5mm.

So I tried running these commands by themselves in the OctoPrint terminal window and something strange happened. If skipped the M109 command and heated the extruder manually to 170 and just ran the “G1 E-5 F100” retraction command by itself it would seem to retract fine at about 5mm. But if I cooled down the hot end then ran the “M109 S170” command then right after that run the “G1 E-5 F100” command, it would start to warm up get to about 161 ish according to the LCD screen on the TAZ 6 then start the retraction process. The issue is that when it retracted it retraced way more than 5mm and ended up grinding on the filament till it stripped it.

Ran this test a few more times and every time I ran the “M109 S170” before I ran the retraction command no matter if I tell it to retract only 1mm it still would retract for like 15 seconds straight.

Any ideas why M109 command first seems to ignore my retraction length settings and just keep retracting for an extended period of time?

You may be in absolute extraction mode (M82). It may retract an unexpected amount to reach the length you are telling it to go to if so. if E=5 and you tell it to go to length E-12 that is 17 MM. If you are at E=20 then that is 32MM.

E = current extruded distance/length the firmware thinks it is at from the origin (E=0).

You may need to set it to relative mode (M83) and reset the extruder length(G92 E0). YMMV.

Thanks kmanley57, that was the exact issue. I only adjust gcode once in a very blue moon so remembering E is relative to the last time it was zeroed messes with me almost every time and this time in particular was driving me nuts. Once again thank you!