S3D ending script cant get G91 to work

im tying to get my ending script when finished to raise up 5mm then move to x and y position but cant seem to get it to work when I look at the line G1 Z20 E-5 X-20 Y-20 F3000
and say the print height is 50mm height it is dropping to the Z20 height. its like it doesent recognise the relative position… any help appreciated.

M400 ;wait for moves to finish
M140 S0 ;turn bed Off
M104 S0 ;disable hotend
M107 ;disable fans
G91 ;relative positioning
G1 E-1 F300 ;ilament retraction to release pressure
G1 Z20 E-5 X-20 Y-20 F3000 ;lift up and retract even more filament
G1 E6 ;re-prime extruder
M117 Cooling please wait ;progress indicator message on LCD
G90 ;absolute positioning
G1 Y0 F3000 ;move to cooling position
G1 Y280 F3000 ;present finished print
M77 ;stop GLCD timer
M84 ;disable steppers
M117 Print Finished Bob ;progress indicator message on LCD

I think you are telling it to go Z20 and not Z+5


G1 Z+20 E-5 X-20 Y-20 F3000 ; move Z up a bit and retract filament even more

it makes no difference on that line if I put 15mm it will drop 15 mm if I put a height grater than 20mm say 25mm it will ramp to 25mm not lift off the print to 25mm which means I have to alter this line if the print is greater than say 25mm… look at the picture you can see the line is set to 25mm and you can see the ramp up… not what I was wanting, I wanted it to lift so no matter what size of print I am doing the end it would always lift a given amount.

I will try one more time:

Relative movements require to know which direction you want to move, thus the (+/-) for the distance to move. Otherwise it will think you want to move to an absolute point.

Z-5 move 5 down
Z+5 move 5 Up.
Z5 move to absolute position 5. < not relative. It can not guess which direction you want to move.


thank you for your patience I had not seen this put in this way before I have a number of scripts for other printers and these worked I did not realise they need to be specified like this + -…

Thank you

ok done that added the +5 it dropped strait to the deck

but thanks for trying

I’m afraid I’m going to disagree with you. From http://marlinfw.org/docs/gcode/G000-G001.html:

  • In Relative Mode (G91) all coordinates are interpreted as relative, adding onto the previous position.

I just performed the following on my TAZ 6:

G28 XY
G28 Z
G0 X140 Y140 Z50
G0 Z5
G0 Z-5

The M114 output:
Recv: X:140.00 Y:140.00 Z:50.00 E:0.00 Count X:14070 Y:14070 Z:80000
Recv: X:140.00 Y:140.00 Z:55.00 E:0.00 Count X:14070 Y:14070 Z:88000
Recv: X:140.00 Y:140.00 Z:50.00 E:0.00 Count X:14070 Y:14070 Z:80000

(Test.gcode and (edited)Test.log attached).
Test.zip (824 Bytes)

Can you have S3D output the gcode to a file and verify that the gcode sequence you posted actually made it into the file. What you posted should work and the “+” sign is not required (see my previous post). From the S3D Machine Control Panel, Communication tab you should be able to send individual commands and see the results. Try my simple experiment for yourself.


Thank you, I’m not the most intelligent guy but i’m not stupid either, before I posted I did do some testing hence the question for help, I have checked the gcode and it does look like the G90 was set at the beginning of the code and the G91 was implemented at the end of the code I attach the sample if you like to take a look, I will try you test later tomorrow and come back…
Side.gcode (3.35 MB)