Coolant on/off on Rapids

If you have a question about the software please ask it here.

Coolant on/off on Rapids

Postby alex_s » Sat Dec 30, 2017 12:03 am

Hello,

is there an option to turn coolant of when not cutting eg. rapids ?, and if not would it be possible to add ?

Reason is on a mist Cooling setup you only want to mist when cutting or start misting just before, so whenever you rapid it should turn off, as a lot of commercial controllers do, or have a option for.
i would like to set a pin which can be used to control Relais / solenoids

best regards
Alex
alex_s
 
Posts: 62
Joined: Tue Nov 29, 2016 11:45 am

Re: Coolant on/off on Rapids

Postby dezsoe » Sat Dec 30, 2017 1:09 am

You can turn cool/mist on and off anytime in the code. See M7, M8 and M9 words. If you generate your g-code with a CAM program, you have to edit the postprocessor for your special needs, but it is possible and not too hard to do.
dezsoe
 
Posts: 388
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Coolant on/off on Rapids

Postby Vmax549 » Sat Dec 30, 2017 1:37 am

While I do not know of any internal function for that it is very easy to build and external function to do it. what I have done in the past was this.

Setup teh M8 to output to a relay. Then run the output of that realay to a second relay. Teh first relay turns ON teh function and teh second relay regulates teh G1/G0.

You would need to create a MacroLoop to query teh Label 877 and then strip out teh Section that shows teh G1/G0.

That script would look similar to this example.

string str = AS3.Getfield(877);
string[] substrings = str.Split('|');
string b = substrings[0];
MessageBox.Show(""+b);

Then you query b for if it is G1 or G0 . If G1 then activate teh output to teh second relay and that turns on teh solenoid . IF it is G0 the it turns OFF teh solenoid.

If b == G1 then activate output# ???
If b == G0 then deactivate output# ???

Now running a program teh M8 turns ON teh function and teh macroloop regulates teh on/off of teh solenoid.

Just a thought(;-) TP
Vmax549
 
Posts: 843
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Coolant on/off on Rapids

Postby alex_s » Sat Dec 30, 2017 8:10 am

thanks will look into the macroloop :D

i would rather not spam my G-Code with hundreds or thausands of M7/M8 ;)
alex_s
 
Posts: 62
Joined: Tue Nov 29, 2016 11:45 am

Re: Coolant on/off on Rapids

Postby Dan911 » Sat Dec 30, 2017 12:21 pm

Like Vmax549 already pointed out this can be done easily with a macroloop. Monitoring for G0 in loop can be simplified with this line....

int modalmode = exec.actualmodal;

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

Re: Coolant on/off on Rapids

Postby dezsoe » Sat Dec 30, 2017 3:01 pm

I made this macroloop for testing. It works fine, however it will not turn off for all the rapids. I have to test exec.activemodal for non-zero, as it has to turn on while G1, G2/G3 or any of the canned cycles are active. When working on canned cycles, the activemodal will not return to zero while positioning, but when g-code uses G0 to set new position, it will turn off. I also added the M7 and M8 state to the condition, so if you don't use both M7 and M8, then there is no need to have 2 relays: you can use only one.

Set relayPort, relayPin and relayActiveLow as your hardware configuration is.

Code: Select all
// ================================================================================================
// Switch output on modal != 0 and Mist/Flood is on
// ================================================================================================

bool stateNow = ((exec.actualmodal != 0) && (exec.GetLED(Miston) || exec.GetLED(Floodon)));
bool setRelay = false;

if (lastState != stateNow)
{
  lastState = stateNow;
  if (relayActiveLow)
    setRelay = !stateNow;
  else
    setRelay = stateNow;
  if (setRelay)
    exec.Setoutpin(relayPort, relayPin);
  else
    exec.Clroutpin(relayPort, relayPin);
}

// ================================================================================================

#Events

// ================================================================================================

const int relayPort = 2;                                                        // Port number of relay
const int relayPin = 5;                                                         // Pin number of relay
const bool relayActiveLow = false;

static bool lastState = false;

const int Miston = 52;                                                          // Miston LED
const int Floodon = 53;                                                         // Floodon LED
dezsoe
 
Posts: 388
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Coolant on/off on Rapids

Postby Dan911 » Sat Dec 30, 2017 9:27 pm

Good point Dezsoe. The flood/mist will remain on for duration of canned cycle even when traveling G0 to next hole position since the canned cycle will be the active modal.

Alex. another very conservative option would be monitoring Z dro with a <= setting for on/off instead of G0.

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

Re: Coolant on/off on Rapids

Postby Vmax549 » Sat Dec 30, 2017 11:19 pm

Hum, the last time I used this it was a grinding app that only used G1/G0 and did not use Canned cycles. So you are correct you look for a zero value to turn it off and anything else turns it on.

Canned cycles would just have to run full cycles but most of them only run for short distances so teh duration is not really a problem. Just needs a G0/1 after teh G80 that cancels the cycle and you normaly have that anyway.

It should work until Balazs takes a look at it and IF it is usefull adds it to UCCNC. BUT it really only helps for mill and normally coolant cycles run full duration for the most part.

Just a thought, (;-) TP
Vmax549
 
Posts: 843
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Coolant on/off on Rapids

Postby alex_s » Mon Jan 01, 2018 11:17 am

this stuff at least on Datron and Mori is used on Mist cooling only, and mostly then when you use this expensive evaporation kerosene ethanol coolant, which costs a fortune even in Barrel amounts.

i thought to use it on G0 because no one should cut on rapids :D

(exec.actualmodal != 0) && (curLineG0 == true) , something like this should work or ?, i would also include a second Mist on Button to toggle permanent misting or the Mist on Cutting only

i plan to look into the coding language in this week, i am only fluent in C#/++ and perl :)

So happy new year everyone

cheers Alex
alex_s
 
Posts: 62
Joined: Tue Nov 29, 2016 11:45 am

Re: Coolant on/off on Rapids

Postby dezsoe » Mon Jan 01, 2018 11:34 am

alex_s wrote:i plan to look into the coding language in this week, i am only fluent in C#/++ and perl :)

UCCNC uses C# as macro language, so you are ready. :)
dezsoe
 
Posts: 388
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Next

Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 2 guests