CodeRunTime Plugin

This is where you talk about Plugins. How they are made and how they work, show examples.

CodeRunTime Plugin

Postby Dan911 » Mon Jun 19, 2017 1:00 pm

Hello ALL,

I written a simple plugin for myself to calculate how long it would take to run a Gcode file in UCCNC and thought to share with who ever my be interested. Most Cam software has this estimation of time but some don't and it's something I got use to checking.

It calculates X,Y,Z movements with feedrate in Gcode file(G1), I have G00 set to 500ipm. All calculations are done with inches per minute (ipm) but added a checkbox to calculate mm per minute. I know I can do many things to tweak this but it's working very well for me now and I'm open/welcome any suggestions.

This plugin has no macroloop running so by enabling nothing will be running until button is pressed.

CodeRunTime.JPG



Setup:

1. You will need to create a button on your screen and give it button # 21111.
2. Put in UCCNC plugin folder and enable it.

I include a blank macro "M21111" in zip file. This should be put in the macro folder of profile used. All this does is stop the false "could not be read" message in UCCNC message window.

Can be downloaded by following link below.

http://www.cnczone.com/forums/uccnc-con ... tware.html
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: CodeRunTime Plugin

Postby A_Camera » Mon Jun 19, 2017 3:10 pm

Nice, even though 500ipm is a bit fast for most I think... at least for my machine, but I can be wrong about others.

Just an idea... why not use fields 9, 10, 24, 25, 39, 40 instead of a fixed speed? Even if you leave out acceleration using fields 9, 24 and 39 would make it more general.
A_Camera
 
Posts: 638
Joined: Tue Sep 20, 2016 11:37 am

Re: CodeRunTime Plugin

Postby Dan911 » Mon Jun 19, 2017 5:13 pm

A_Camera wrote:Nice, even though 500ipm is a bit fast for most I think... at least for my machine, but I can be wrong about others.

Just an idea... why not use fields 9, 10, 24, 25, 39, 40 instead of a fixed speed? Even if you leave out acceleration using fields 9, 24 and 39 would make it more general.


Hi AC,

Thanks...The only fixed speed is the ramping speed (G00), and what your suggesting is a great idea. I also considered just adding a textbox for user to input there ramping speed. The feedrate(G1) is being extracted from the G-code file being read using streamreader and regex. If there's different feedrates for X and Z and if Feedrate changes the plugin will read this.

Yes, I don't know what I was thinking with 500 ipm.

Thanks,
Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: CodeRunTime Plugin

Postby beefy » Mon Jun 19, 2017 7:20 pm

Thanks very much Dan,

might be a while before I get to try it but it's now in my "add-ons box".

I'm learning C# / plugins as time permits and don't know if I'm more interested in studying the code or using the plugin LOL.

Keith
beefy
 
Posts: 449
Joined: Mon Sep 05, 2016 10:34 am

Re: CodeRunTime Plugin

Postby Dan911 » Tue Jun 20, 2017 3:35 am

My length of an arch code is off. So G-code with G02 and G03 in it the plugin is adding more time than it is. My heads about to explode tonight but I'll get it right eventually...lol

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: CodeRunTime Plugin

Postby A_Camera » Tue Jun 20, 2017 7:05 am

Dan911 wrote:
A_Camera wrote:Nice, even though 500ipm is a bit fast for most I think... at least for my machine, but I can be wrong about others.

Just an idea... why not use fields 9, 10, 24, 25, 39, 40 instead of a fixed speed? Even if you leave out acceleration using fields 9, 24 and 39 would make it more general.


Hi AC,

Thanks...The only fixed speed is the ramping speed (G00), and what your suggesting is a great idea. I also considered just adding a textbox for user to input there ramping speed. The feedrate(G1) is being extracted from the G-code file being read using streamreader and regex. If there's different feedrates for X and Z and if Feedrate changes the plugin will read this.

Yes, I don't know what I was thinking with 500 ipm.

Thanks,
Dan

In my opinion the maximum speed (G0) is very important in simulation, especially for long codes with a lot of rapid moves.

I use the simulator in Mach3 for long codes now, but I'd like to have one without a pop-up window, just like in Mach3. You click simulate and the software calculates and estimates the total time, presenting it in the same window. Maybe your plugin can be modified so that if a user calls it through a button call then it just returns a value, which the user can display in a field# of his/her selection. A checkbox in the plugin window, when checked the window will not pop-up next time, just return the value (maybe you can write the value in the last UCCNC Modbus variable... that can be written written to and read by anyone who likes to read it), when unchecked the window will pop-up and present the estimated values there (like today).
A_Camera
 
Posts: 638
Joined: Tue Sep 20, 2016 11:37 am

Re: CodeRunTime Plugin

Postby Dan911 » Tue Jun 20, 2017 12:40 pm

Yes, G0 is very important to get accurate results and is something I will change, possibly using one of the fields you suggested in previous post.

Having a pop up window has to be less annoying than loading another program. Regardless, creating a configure window for user to choose window or send results to a textfield is simple enough to try and suit everyone's preferences.

Right now my priority that my time will allow is to have the estimated time working accurately. I do suspect if enough request UCCNC will most likely add this feature in a future update.

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: CodeRunTime Plugin

Postby Dan911 » Wed Jun 21, 2017 12:12 am

Vmax549 wrote:Might want to consider sending the values to teh status line on the main screen.

(;-) TP


Hi TP,
I missed this post.You must of posted when I was replying to AC's post.

That is the best idea so far, this will eliminate the need to create any other fields other than the button to activate the read.

My only problem with any of these suggestions is for a large file. I do a lot of lithophane's and some can be 500,000 lines of G-code. Without the progress bar you start to wonder if there is a problem when the results aren't instant like smaller files. That's why I added it.

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: CodeRunTime Plugin

Postby Robertspark » Thu Aug 03, 2017 10:36 pm

Has this progressed at all with G2, G3 and G0?

Wouldn't mind taking a look at plugin if possible, thanks,
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: CodeRunTime Plugin

Postby Dan911 » Fri Aug 04, 2017 1:57 am

Robertspark wrote:Has this progressed at all with G2, G3 and G0?

Wouldn't mind taking a look at plugin if possible, thanks,


Actually progressed quite far, don't want to prematurely post like I did with first version.

Plugin now calculates with users max velocity and acceleration. Yes reads G2/G3 arch length and adjust with chord length. Also calculates all canned cycles and uses users UCCNC settings for G73 and dwell.

The last thing I been tweaking is CV along with exact stop, one of the reasons I found your thread below very interesting.

viewtopic.php?f=2&t=681

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA


Return to Plugins

Who is online

Users browsing this forum: No registered users and 3 guests

cron