ILoveBoobies
Posts: 1
Joined: Fri Apr 20, 2018 6:50 pm

Re: Tip of the Day 8- Scripts tab, G-Code

ShaqFoo wrote: Tue Aug 04, 2015 1:13 am
KeyboardWarrior wrote:
Kyuubi wrote:I want post too the LCD "(current layer) of (layers)" on every layer change, is that possible?
Since there isn't a current layer or # of layers variable, this isn't currently doable. If you're looking to do this for time-measurement reasons, I don't think that # of layers is a great indicator of speed by the way, since some layers will take much longer than others.

For instance, a pyramids base layers will print much slower than the layers towards the tip.
Great post but he never asked about time measurement. The single biggest reason to display the layer height on the LCD screen is in the case of failed print so you know where to resume by LAYER #. Yes, you could do it by z height too, but visually seeing the layer number is easier to remember and find in the gCode file that S3D creates. S3D inserts the layer# and z height in the gcode for every layer printed but it puts inserts them as comments.

After reading the post, I was really intrigued by the terminal post processing window and was able to display both the layer # and the Z height on the LCD screen during the print for every layer printed. See attached pictures.

Place the following code in the post processing window and you will get layer number printed on your LCD screen along with the z height. The replace command simply removes the comment and replaces it with the M117 command. The second line is for formatting only it is not needed but tightens things up.

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
I like this but can't get it to show up on my LCD screen. I'm using Marlin 1.1.0 RC8. Does that have anything to do with it? Thanks in advance!
gearsawe
Posts: 233
Joined: Sun Sep 10, 2017 11:06 pm

Re: Tip of the Day 8- Scripts tab, G-Code

Why has all the post processing variables not been place on the main web site yet? because this post does not contain them all.
for example
{EXTENSION "g"}
changes the annoying long "gcode" extension to a short "g".
and wonder how many others where not documented.
viet
Posts: 2
Joined: Wed Dec 12, 2018 1:22 am

Re: Tip of the Day 8- Scripts tab, G-Code

gearsawe wrote: Sun Dec 16, 2018 9:58 pm Why has all the post processing variables not been place on the main web site yet? because this post does not contain them all.
for example
{EXTENSION "g"}
changes the annoying long "gcode" extension to a short "g".
and wonder how many others where not documented.
+1
tana4
Posts: 7
Joined: Tue Nov 28, 2017 10:47 am

Re: Tip of the Day 8- Scripts tab, G-Code

How do you use postscript to do this?
Attachments
exx.JPG
dhopson
Posts: 1
Joined: Tue Mar 03, 2020 3:09 pm

Re: Tip of the Day 8- Scripts tab, G-Code

I saw [current_Z_position] mentioned in the first post. Is it possible to do something like wiping the nozzle every X layers? In this case its every 50 layers...

on layer change script

Code: Select all

{IF[current_position_z]%50=0} G1 X70 Y240 F3000 ; move to position in dock
{IF[current_position_z]%50=0} G1 X70 Y200 F3000 ; move out of dock
are there numerical operators we can use in these scripts?
bas
Posts: 2
Joined: Mon Feb 20, 2017 1:23 pm

Re: Tip of the Day 8- Scripts tab, G-Code

Disable "Wait for temperature controller to stabilize before beginning build"

Add these temp settings to the Scripts: Starting Gcode:

Code: Select all

M104 [extruder0_temperature] T0; start extruder temp
M104 [extruder1_temperature] T1; start extruder temp
M140 [bed0_temperature]; start bed temp
M109 [extruder0_temperature] T0; wait for extruder temp
M109 [extruder1_temperature] T1; wait for extruder temp
M190 [bed0_temperature]; wait for bed temp
User avatar
XoTT@6bI4
Posts: 27
Joined: Mon May 27, 2019 4:02 am

Re: Tip of the Day 8- Scripts tab, G-Code

dhopson wrote: Tue Mar 03, 2020 3:25 pm on layer change script

Code: Select all

{IF[current_position_z]%50=0} G1 X70 Y240 F3000 ; move to position in dock
{IF[current_position_z]%50=0} G1 X70 Y200 F3000 ; move out of dock
are there numerical operators we can use in these scripts?
Use:

Code: Select all

{IF "[current_position_z]%50==0"} G1 X70 Y240 F3000 ; move to position in dock
It uses javascript . You can use any js operators.
Beefi
Posts: 7
Joined: Tue Feb 18, 2020 6:13 pm

Re: Tip of the Day 8- Scripts tab, G-Code

Hi,

I wrote a PostProcessor to add some Features...quality and scripting improvements.
You can youse real If-Else-Decisions with it.

Here you can download it for free (please read the manual first): S3D-PostProcessor

Best regards,
Andi
CZF
Posts: 1
Joined: Mon Apr 06, 2020 8:13 am

Change the order Extruders Print

Hi,
i need some advice on how i can change the order in wich the extruders work in a 2 component print.
Usually they work like this:
T0
T1
Layer Change
T1
T0
...and vice versa.
I, on the other hand, need it to begin printing every layer on the same extruder
T0
T1
Layer Change
T0
T1
Layer Change
...and so on.
Thanks in advance

EDIT: Found a solution:
If you split the print into 2 processes (1 per component) and make the first layer hight a bit bigger by a minimalistic amount on one of them, simplify will print this process as the second one in EVERY LAYER. Alternatively you could adjust the global g-code offset in one of the processes
Last edited by CZF on Thu Apr 30, 2020 9:13 am, edited 1 time in total.
multicopter
Posts: 5
Joined: Mon Mar 23, 2020 3:34 am

Re: Tip of the Day 8- Scripts tab, G-Code

hi

does anymone now what is the g-code in the "Tool Change Script" fore following case:

right after toolchange i want that the new toolhead first extrude (right in the parking position, so no move ) 50mm of material, befor he start to print?

the actually Tool Change Script is:

{IF NEWTOOL=0}M106 S255 T0
{IF NEWTOOL=0}M106 S0 T1
{IF NEWTOOL=1}M106 S255 T1
{IF NEWTOOL=1}M106 S0 T0


thanks,

andy

Return to “General Discussion and Tips”