Page 1 of 2

Working on some runtime info..

Posted: Thu Jun 19, 2025 12:25 am
by corbin
Working on a little app for runtimes. When you run a job, it will save the time it took, and show you how long is left when you run it again. It also does some basic estimates based on the line through the gcode.

I need to figure out a good way to launch it on start of CNC12.

All the code is at https://github.com/corbinstreehouse/Cen ... RackSetup/

It is still a work in progress.
Screen Recording (6-18-2025 9-12-35 PM) (2).mp4
(1.13 MiB) Downloaded 132 times

Re: Working on some runtime info..

Posted: Thu Jun 19, 2025 8:10 am
by ASPeters
Looks great!

I'd create a vcp button that launches the app, which is done on page 33 of the vcp manual - https://www.centroidcnc.com/centroid_di ... manual.pdf

You could also add to the start.bat file inside of your install directory and change your shortcut target to

Code: Select all

C:\Windows\System32\cmd.exe /C "C:\cnct\start.bat"

Re: Working on some runtime info..

Posted: Thu Jun 19, 2025 10:13 am
by ShawnM
Looks great and I agree that a VCP button to launch it is a good idea. The image on the button could be a stopwatch. You really need it for those longer jobs and not necessarily on the quick ones.

The fiber laser in the shop has that feature built in and it displays it on the screen similar to your design. There's a timer and a bar graph. I'd love to see this as a standard feature in CNC12. There's a count up timer but I don't find it useful unless you remember the runtime when you graph the job. Since I suffer from CRS having it on the screen would be great. :D

Re: Working on some runtime info..

Posted: Thu Jun 19, 2025 10:25 am
by corbin
Yeah, I've got a few VCP buttons already launching my apps; one does a drop down for tool selection.

I was thinking I could add something to my home script.

Corbin

Re: Working on some runtime info..

Posted: Thu Jun 19, 2025 10:39 am
by ASPeters
M130 allows you to run shell commands. You may still have to write a batch script to start it up

Re: Working on some runtime info..

Posted: Thu Jun 19, 2025 3:22 pm
by cnckeith
cool!
what happens when you use F4 Run, F2 search and choose to start somewhere in the middle of the program?

Re: Working on some runtime info..

Posted: Thu Jun 19, 2025 4:06 pm
by corbin
cnckeith wrote: Thu Jun 19, 2025 3:22 pm cool!
what happens when you use F4 Run, F2 search and choose to start somewhere in the middle of the program?
Yeah, that will fall back to the estimate, which is entirely brain-dead at just a percentage through the gcode file. Although, I don't have a good way of knowing when it starts half-way through so I may have to add some heuristics.

Ideally I'll kick up a background thread and actually simulate the runtime based on parsing the gcode machine moves. It won't be perfect, as it is hard to predict how smoothing may affect acceleration, but I should be able to get it as good as Fusion's estimates.

Corbin

Re: Working on some runtime info..

Posted: Thu Jun 19, 2025 4:08 pm
by corbin
ASPeters wrote: Thu Jun 19, 2025 10:39 am M130 allows you to run shell commands. You may still have to write a batch script to start it up
Yeah! I realized a while back that you don't need a batch file. Stuff like this works:

<line>M130 "C:\CNCM\ToolRackSetup.exe -showToolSetupWindow"</line>

When I had a batch file you would see it flash on the screen, which is annoying.

Re: Working on some runtime info..

Posted: Thu Jun 19, 2025 4:45 pm
by cnckeith
our g code backplot actually runs the job with accel/decel taken into account (and including smoothing if you are using G64!) it does the actual motion planning for the g code graph, not just drawing some lines. thats why CNC12's drilling job time estimates are so accurate compared to a cad/cam system's stab at it. if you set the range (F3 Set Range) in the g code backplot you will notice the run time estimate has also changed. Tip: leave the END value blank and it defaults to the end of the program using your start line number to start at and finish the rest of the job.

Re: Working on some runtime info..

Posted: Wed Jun 25, 2025 6:27 pm
by corbin
cnckeith wrote: Thu Jun 19, 2025 4:45 pm our g code backplot actually runs the job with accel/decel taken into account (and including smoothing if you are using G64!) it does the actual motion planning for the g code graph, not just drawing some lines. thats why CNC12's drilling job time estimates are so accurate compared to a cad/cam system's stab at it. if you set the range (F3 Set Range) in the g code backplot you will notice the run time estimate has also changed. Tip: leave the END value blank and it defaults to the end of the program using your start line number to start at and finish the rest of the job.
Awesome! Is there any way to get that estimate from the API?