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: 65
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: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

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: 65
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: 613
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: 2049
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: 613
Joined: Mon Oct 31, 2016 1:22 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: 65
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: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Coolant on/off on Rapids

Postby Dan911 » Mon Jan 01, 2018 12:47 pm

alex_s wrote: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


To activate mist only when cutting/drilling IMO using Z position in macro is a much better approach to achieve this than G0. For example set position in macro to zero and mist will only activate when M7 is enabled and below 0. Above zero off(not cutting/drilling).

Dezsoe I hope you don't mind but edited your macro for Z position example. I tested quickly and works fine.

Code: Select all
// ================================================================================================
// Switch output on Zheight and Mist/Flood is on
// ================================================================================================

double Zpos = AS3.Getfielddouble(228);
bool stateNow = Zpos < ZHeight &&  exec.GetLED(52);

if (lastState != stateNow)
{
lastState = stateNow;

if(stateNow)
{exec.Setoutpin(MistPort, MistPin);
exec.Code("G4"+"P"+pause);
while(exec.IsMoving()){}
}   
  else
  {exec.Clroutpin(MistPort, MistPin);} 
}

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

#Events

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

const int MistPort = 1;                  // input  Port number
const int MistPin = 1;                  // input  Pin number
const int pause = 1;                     //input Pause for mist/flood startup
static bool lastState = false;
const double ZHeight = 0;               // Set Z height for below on and above off
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Coolant on/off on Rapids

Postby Dan911 » Tue Jan 02, 2018 1:11 am

Received PM macro not working...Should of posted instructions.

1. In "AXIS SETUP/SPINDLE" M7 relay pin and port needs to be set to zero.
2. In "CONFIGURATION/IO TRIGGER/OUTPUT TRIGGER" set up port and pin here used for M7. Input this port and pin in bottom of macro. Example below.

const int MistPort = ?; // input Port number
const int MistPin = ?; // input Pin number


You can set a pause for when M7 is enabled if you like, if not use 0. Example below.

const int pause = ????;


ZHeight is the value used for any value below is on and above is off. Example below.

const double ZHeight = 0;

For Zheignt and pause use units machine is setup for.
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Next

Return to Ask a question from support here

Who is online

Users browsing this forum: Bing [Bot] and 16 guests