Hello Guest it is February 28, 2021, 08:27:29 PM

Author Topic: Pause loaded cycle after certain amount of time  (Read 605 times)

0 Members and 1 Guest are viewing this topic.

Pause loaded cycle after certain amount of time
« on: September 27, 2018, 05:53:50 AM »
Hi,
Is there a setting in Mach4 that could pause the cycle after a certain time from the start of the cycle, I have build a plasma table and in the plasma cutters specs there is a 40% duty cycle per 10min, at around 5-6mins the thermal relay on the transformer trips and the torch turns off, so I would like to pause the cycle at the 5min mark. I know it would be possible to add a pause in the g-code but the feedrates change depending on the thickness of the plates cut so that isn't a viable option. Also the cutter is old enough that there are no output signals to use as a trigger of a pause, but if there is no time option in Mach4 I could wire a signal output using the thermal trip LED the cutter has.

Thanks
Oscar
Re: Pause loaded cycle after certain amount of time
« Reply #1 on: September 27, 2018, 09:07:33 AM »
Daz just did a video on timer scripts.  I haven't tried this, this is just a theory.  Have a timer script to call a Feedhold and start another timer; once the second timer reaches it's limit call Cycle Start and restart the first timer.

Just an option, don't know if it would work, but that's where I would start.

https://www.youtube.com/watch?v=wNPMqjkcJ_8
Chad Byrd
Re: Pause loaded cycle after certain amount of time
« Reply #2 on: September 27, 2018, 02:18:29 PM »
Thanks for the help, I was able to do what I needed using his method, the only thing I have trouble with is finding a way to stop the timer when the cycle ends (the g-code ends), I don't expect I can add the command scr.StopTimer() to the footer of the g-code, right?

Thanks
Oscar
Re: Pause loaded cycle after certain amount of time
« Reply #3 on: September 27, 2018, 08:44:33 PM »
Oscar,
You can make your own m30 that has the scr.StopTimer() in it.  All you have to do is make a new macro and name it m30.  
This will override the stock m30 that Mach4 uses.
Be aware of the functions that m30 takes care of automatically.  
Steve does a great job explaining what needs to be put back into a custom m30 in this thread.  His post is the 4th one down.

http://www.machsupport.com/forum/index.php/topic,33831.0.html

So when you make a custom m30, be sure to add back in the listed functions as well as adding your scr.StopTimer().
Chad Byrd
Re: Pause loaded cycle after certain amount of time
« Reply #4 on: September 28, 2018, 12:26:35 PM »
I created a custom m-code and added a call in the g-code but can't seem to get it working to stop the timer, not sure if its not loading because I have written the file wrong or it isn't just possible to load such commands with m-codes. But while testing it with the simulator controller I found out that my whole idea is flawed since Stopping the cycle in the middle of a cut turns the torch off but resuming it doesn't turn it on again. My only hope now is to get Mach4 or CamBam to show cycle time estimation, so I can adjust the amount off cutting on each cycle accordingly.

But thanks for helping out anyway, learned a few things that might be useful in the future!

Oh one more thing, is there a better guide for modifying the Mach4 Screen than the one in the Docs folder, as I understand the GUI is based on wxWidgets?

Oscar
Re: Pause loaded cycle after certain amount of time
« Reply #5 on: September 28, 2018, 03:36:07 PM »
Oscar,
I'm not sure about the m30 not stopping the timer.  I don't see why it wouldn't.  Be sure it is saved as a lower case m30.mcs   . 
Also, you should be able to add the m3 to your resume timer.
Chad Byrd
Re: Pause loaded cycle after certain amount of time
« Reply #6 on: September 28, 2018, 03:50:09 PM »
Oscar,
I'm not sure about the m30 not stopping the timer.  I don't see why it wouldn't.  Be sure it is saved as a lower case m30.mcs   . 
Also, you should be able to add the m3 to your resume timer.

Yes the file name was correct and the location was in the Macros folder of the profile, I tried it by writing

function m30()
scr.StopTimer(0)
plus the rest of the commands
end

and straight

scr.StopTimer(0)
plus the rest of the commands

I actually tried multiple different ways.

I could add the m3 after resuming but it is not always stopping at a point it was cutting, it might also stop during a rapid, the cuts are usually multiple repetitive parts, so there are usually many rapids.


Oscar