How to calculate Approximate Time of a 3D Printed object? Hi friends,
I'm a Developer and I was looking for an algorithm which calculate approximate time of an 3d object, something like Cura Software when you load a STL File. Actually, I already checked Cura's code on Github, but I didn't find anything.
Does anyone know how to calculate the time?
Thank you, I'll appreciate it. :)
https://reprap.org/forum/read.php?2,647001,647001#msg-647001
Mon, 12 Aug 2024 05:51:57 -0400Phorum 5.2.23https://reprap.org/forum/read.php?2,647001,648718#msg-648718Re: How to calculate Approximate Time of a 3D Printed object?
https://reprap.org/forum/read.php?2,647001,648718#msg-648718
RalfDevelopersTue, 05 Apr 2016 14:46:43 -0400https://reprap.org/forum/read.php?2,647001,648446#msg-648446Re: How to calculate Approximate Time of a 3D Printed object?
https://reprap.org/forum/read.php?2,647001,648446#msg-648446
Your program would focus on the segments that start with G0 or G1.

Your program would need to parse the individual lines, extracting the X and Y position, Feed rate, and extrusion amount (for retract and unretract - see below).

So you might have two lines like this:
G1 X0.00 Y0.00 F1200
G1 X10.00 Y0.00 E1.01

Not every line must have a feed rate, so store it when it changes. The Feedrate F1200 is mm/min, so divide by 60 for mm/sec.

Feedrate in mm/sec:
20 = 1200/60.

The distance is calculated using the last X and Y pos, and the current X and Y pos.
distance = abs(sqrt((lastX - newX)^2 + (lastY - newY)^2))
10 = abs(sqrt((0 - 10)^2 + (0 - 0)^2))

Then store your current X and Y position to lastX and lastY.

Then calculate the segment time, add that to your total seconds.
SegmentTime = distance / feedrate
0.5 = 10 / 20

You can ignore the E parameter (that's the amount extruded) - except when you want to calculate the time for retracts or unretracts - these have no change in the X or Y position (or no X or Y position on the line at all). The feedrate would be specified on these lines. It is simpler to calculate if you had set your slicer to use relative extrusion.

Then parse your next line of gcode...

This calculation will get you close.
To start with, add about 5% for acceleration, plus warmup time if any.
Then test it against an actual print.

Edit: Corrected typo in segment time result.]]>Paul WanamakerDevelopersTue, 05 Apr 2016 01:29:38 -0400https://reprap.org/forum/read.php?2,647001,648443#msg-648443Re: How to calculate Approximate Time of a 3D Printed object?
https://reprap.org/forum/read.php?2,647001,648443#msg-648443
rokumetalDevelopersTue, 05 Apr 2016 01:20:58 -0400https://reprap.org/forum/read.php?2,647001,647006#msg-647006Re: How to calculate Approximate Time of a 3D Printed object?
https://reprap.org/forum/read.php?2,647001,647006#msg-647006
rokumetalDevelopersThu, 31 Mar 2016 21:19:16 -0400https://reprap.org/forum/read.php?2,647001,647005#msg-647005Re: How to calculate Approximate Time of a 3D Printed object?
https://reprap.org/forum/read.php?2,647001,647005#msg-647005
Other than that you could probably use a linear approach multiplying several parameters by constant gains and adding them up, e.g.:

K0*1 +
K1*height +
K2*surface area +
K3*volume +
K4*XY plane protection area +
...

Figuring out the K gains via least-squares fitting of several sampled objects.]]>lhartmannDevelopersThu, 31 Mar 2016 21:04:31 -0400https://reprap.org/forum/read.php?2,647001,647001#msg-647001How to calculate Approximate Time of a 3D Printed object?
https://reprap.org/forum/read.php?2,647001,647001#msg-647001
I'm a Developer and I was looking for an algorithm which calculate approximate time of an 3d object, something like Cura Software when you load a STL File. Actually, I already checked Cura's code on Github, but I didn't find anything.

Does anyone know how to calculate the time?

Thank you, I'll appreciate it. :)]]>rokumetalDevelopersThu, 31 Mar 2016 20:43:36 -0400