KPF-Zeller
Posts: 5
Joined: Tue Jan 22, 2019 2:09 pm

Script at the end of G-Code does not work as it should

Hello to all of you, this is Matt from Germany speaking.

I use the latest software version 4.1.
What I want to achieve:
At the end of the job the extruder servo motor should retract the material out of the hotend.
It seems to be done by typing a sentence into the scripts........

The *End script* is this:
------------------------------------------------------------------------------------
M104 S0 T0 ; turn off extruder 1
M104 S0 T1 ; turn off extruder 2
M140 S0 ; turn off heated bed
M127 ; turn off cooling fan
G91 ; relative mode
G1 E-2000 F300 ; retract filament <-- this is the line that should do what I want it to be done, isn't it?
G90 ; absolute mode
M400 ; wait for current moves to finish
M3079 ; output object
M400 ; wait for current moves to finish
M84 ; disable motors
-------------------------------------------------------------------------------------

I can change the value of the E-2000 to E-2 or E-20..........nothing happens, nothing is changing.

Guess, I am completely wrong.

Does anybody know how to solve this problem, please?

Many thanks in advance.

Cheers,
Matt
horst.w
Posts: 861
Joined: Fri Oct 17, 2014 5:00 pm

Re: Script at the end of G-Code does not work as it should

Is that the complete script?
I miss the relationship to one of your two extruders.

The command >T0< or >T1< switches between the extruders and the last one is available as long as a new command line follows with T0 or T1.

i.e.
...
M104 S0 T0 ; turn off extruder 1
M104 S0 T1 ; turn off extruder 2
M140 S0 ; turn off heated bed
M127 ; turn off cooling fan
T0 ; determine the first extruder for the following commands
G91 ; relative mode
G1 E-2000 F300 ; retract filament <-- this is the line that should do what I want it to be done, isn't it? 2000 means 2000 mm / 2 m !!! Now G1 E - xxx ... is related to T0
G90 ; absolute mode
T1; switches back to the second extruder ; if needed
.... following commands related now to T1 ...

Have a look here: https://reprap.org/wiki/G-code#Introduction

horst.w
GER
KPF-Zeller
Posts: 5
Joined: Tue Jan 22, 2019 2:09 pm

Re: Script at the end of G-Code does not work as it should

Thank you, Horst

Problem solved.

two things:
- I forgot to activate the correct extruder ( T1 )
- the value 2000 was too large and therefore obviously ignored by the interpreter

Return to “Troubleshooting and Bug Reports”