Clay Printing Script - Extrusion rate and Feed rate input

Hi there, has anyone know how to create an gcode script with grasshopper? I am quite lost now, cuz when I tested print it the tool path seems fine to me, but the extrusion rate and feed rate is quite weird that it is uncontrollable. Constant extrusion rate doesn’t work - I tried setting it E30000 for every point and it failed terribly wrong.
Here is the polyline I fed into the grasshopper:


It is a continuous line to the top.

And here is the script I used:


Which the extrusion rate now is super low, but if I set a constant or multiply it, it wont work. While the feed rate is alright when I set it to F1800.

Does anyone know where of it went wrong? Thanks a lot! I have really no clue and I am very new to grasshopper. Thanks.
Here are my files!!!:
Slicing & Gcode JCH_02.gh (15.4 KB)
Module_new.3dm (812.6 KB)

1 Like

I just recently approached the vast world of clay 3D printing, and as far as I have understood (so there might be huge knowledge gaps :slight_smile: and speficially to Marlin…) the amount of material that gets extruded depends on the Estep factor and E variable

your printer has the Estep value set in its settings, you can change it of course

if you want to change it just for the particular program you are currently running (that is very useful for Clay printing as you might want to experiment with different extruder diameters from time to time) you can insert this line in your Gcode header:
M92 Ex
where x -I believe- sets how many steps the extruder motor should turn in order to extrude 1mm of material

then, when you are for instance at X0 Y0 Z0 and want to move 10mm along X while extruding 10mm of material, you can use:

G1 X10 Y0 Z0 E10 F1800

you will move at F speed to the coordinate indicated by XYZ while the extruder motor makes E=10 times Estep turns

NEMA steppers usually have 200 steps per revolution, so if you have this in your header M92 E50 it means for each 1mm of movement you want the extruder to make 50 steps, equal to 1/4th of full turn per 1mm of linear movement

[edit] one thing I see from your screenshot, by setting M82 in the header you’re setting the extruder to absolute mode, so each command-line you have to indicate how much material to extrude as progressive sum

so, for instance, for two straight lines from X0Y0Z0 along X, you want to use:
G1 X10 Y0 Z0 E10 F1800; first horizontal line, length = 10
G1 X20 Y0 Z0 E20 F1800; second horizontal line, length = 10, summed-up to the previous value

1 Like