Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use klipper estimate from klipper_estimator in SuperSlicer #2226

Open
GijsvanDulmen opened this issue Jan 14, 2022 · 6 comments
Open

Use klipper estimate from klipper_estimator in SuperSlicer #2226

GijsvanDulmen opened this issue Jan 14, 2022 · 6 comments
Labels
help wanted Someone can do the work and submit a pull request? new Feature New feature or request

Comments

@GijsvanDulmen
Copy link

Is your feature request related to a problem? Please describe.
I'm using the nice program dalegaard wrote to get better estimates for my prints. It uses postprocess and prints the estimated time inside my generated gcode. This seems to be extremely accurate. Before I got like 6 hour estimates to be 3 hours in real printing time.

The estimator:
https://github.com/Annex-Engineering/klipper_estimator

Describe the solution you'd like
I would love if there was a feature to enable to get the estimated time from the generated post-processed gcode again after my print is sliced and to show up in SuperSlicer.

Describe how it would work
Read the following line from the gcode:
; estimated printing time (normal mode) = 2h 50m 47s

And show it in SuperSlicer.

Describe alternatives you've considered
Accepting the way it is and get stress when I start a print at 19:00 of which the estimate is 6 hours. Don't know if I will be able to sleep on time ;-)

Additional context
None.

@supermerill supermerill added the new Feature New feature or request label Jan 16, 2022
@supermerill
Copy link
Owner

Erf.
If he has make it in c or c++, i could have use it as a lib.
I don't have time to learn rust to rewrite it.
Can he do a c++ version?

@GijsvanDulmen
Copy link
Author

Maybe, I could ask. But I was more thinking about just reading back the estimate from the gcode. That would allow for sort of a an interface between superslicer and post-process scripts. Does that seem like a way to go?

@matthewlloyd
Copy link

Looking at the code in SuperSlicer's GCodeProcessor.cpp and klipper-estimator's planner.rs, since they both use trapezoidal move queues for planning, would it be faster and a better solution to implement Klipper's kinematics directly in C++ in GCodeProcessor.cpp? Then everything would be integrated, and SS could expose square corner velocity and max accel to decel settings in the UI alongside the existing Marlin jerk settings. @dalegaard

@supermerill
Copy link
Owner

supermerill commented Jan 17, 2022

would it be faster and a better solution to implement Klipper's kinematics directly in C++ in GCodeProcessor.cpp?

Ideally extracting all the time-stuff (timemachine, timeprocessor and code that aren't inside them but should) into a "TimeProcessor" class
then, we can implement it with the current marlin code & another one with klipper stuff.

But if using some if(==klipper) at some points is enough and much less work, I won't complain.

SS could expose square corner velocity and max accel to decel settings in the UI alongside the existing Marlin jerk settings.

yes

@supermerill supermerill added the help wanted Someone can do the work and submit a pull request? label Jan 17, 2022
@michaelmyc
Copy link

I think C++ and Rust can interop, though I'm not super familiar with the topic and have 0 experience in Rust. https://hsivonen.fi/modern-cpp-in-rust/

@LeLocTai
Copy link

Is there any reason we have to port the code instead of just calling the binary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Someone can do the work and submit a pull request? new Feature New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants