Clocking the Actual Machining duaration

More
25 Nov 2010 12:01 #5602 by KenC
Hi,
I totally useless when it comes to programming.
Can someone kindly point me the direction to set up a clock in AXIS to clock the actual machining time? i.e. start ticxking when the "play" button is pressed & stops when the g-code ends?

Thanks in advance.

Ken

Please Log in or Create an account to join the conversation.

More
More
25 Nov 2010 14:11 #5606 by BigJohnT
EMC 2.5 (development version) has a new component time that is designed just for a cycle timer... and outputs the time in hours, minutes, and seconds.

www.linuxcnc.org/docview/devel/html//man/man9/time.9.html

John

Please Log in or Create an account to join the conversation.

More
25 Nov 2010 15:54 #5608 by andypugh
BigJohnT wrote:

www.linuxcnc.org/docview/devel/html//man/man9/time.9.html


Hmm, I wonder if it is worth putting the 1hz siggen and reset inside the component?

Please Log in or Create an account to join the conversation.

More
25 Nov 2010 16:01 #5609 by BigJohnT
That would simplify the use of it greatly IMHO. I didn't even think about an external reset... Can I just cut and paste some code from siggen or something like that?

John

Please Log in or Create an account to join the conversation.

More
25 Nov 2010 16:59 #5611 by andypugh
Comp functions get passed the time in nS since they last ran in
The "period" variable, so I think you could just add that to an internal variable. Reset would just be a case of checking
If (reset && !old_reset) time_accumulator = 0;

Please Log in or Create an account to join the conversation.

More
26 Nov 2010 13:30 #5629 by BigJohnT
I'm still trying to sort out how one would do this with the period info... If I summed up each period the number would grow pretty quick...

John

Please Log in or Create an account to join the conversation.

More
26 Nov 2010 13:43 #5630 by andypugh
I think you need to sum them up, as otherwise you will get rounding errors.

Stored in a static long long (64 bits) you would wrap round in 14,000 years. That should be long enough :)

Alternatively the comp code can access the rtapi_get_time and rtapi_get_clocks functions, but as these also use long longs there is not much to be gained.
git.linuxcnc.org/gitweb?p=emc2.git;a=blo...282c53f877fc;hb=HEAD
(lines 300 onwards)

Please Log in or Create an account to join the conversation.

More
26 Nov 2010 17:17 #5640 by BigJohnT
I'm having so much fun and must have eaten too much turkey yesterday as I forgot to addf the time to my servo period and was wondering why it always showed up as 0...

John

Please Log in or Create an account to join the conversation.

More
26 Nov 2010 17:25 #5642 by andypugh

Please Log in or Create an account to join the conversation.

Time to create page: 0.089 seconds
Powered by Kunena Forum