Safety door check

Post anything you want to discuss with others about the software.

Safety door check

Postby odino87 » Thu Nov 28, 2024 10:40 am

Hi to every one
I was wonder if there is a way to implement a safety door check.

I have a lock security lock relay that I can energize with a switch to open the door, and there is a couple of pin that let me know if the security door is locked or not.
Is there a way to prevent UCCNC to start the job when the door is open?
And I want to prevent the user to open the door while the machine is on working too.

Do I have to implement a macro loop of some sort to do that?
odino87
 
Posts: 23
Joined: Mon Mar 20, 2023 3:02 pm

Re: Safety door check

Postby cncdrive » Fri Nov 29, 2024 5:53 pm

Yes, in a macroloop you can make the UCCNC to call the .Stop(); function if that door open signal is active.
You could also use the faultsignals plugin.
cncdrive
Site Admin
 
Posts: 5197
Joined: Tue Aug 12, 2014 11:17 pm

Re: Safety door check

Postby odino87 » Wed Dec 11, 2024 11:45 am

Thanks you very much. Sorry for my late answer but I did not recive any notification
odino87
 
Posts: 23
Joined: Mon Mar 20, 2023 3:02 pm

Re: Safety door check

Postby odino87 » Wed Jun 25, 2025 8:51 am

Hello
I'm here again with a new question about a safety door check.

I'm using the signal fault to stop/prevent running while the door is open (I have a signal input dedicated to the door).

I have change part of the screenset to bypass the start probing button to check the door pin status before starting the probing procedure (so I can't prevent probing with the door open).
Is there a way to completely disable all movment and command while the door is open?
I want to disable the MDI input field too. In this moment if I write a command in the MDI and press ENTER KEY the command will be execute, but I want to prevent that too.
odino87
 
Posts: 23
Joined: Mon Mar 20, 2023 3:02 pm

Re: Safety door check

Postby cncdrive » Wed Jun 25, 2025 1:36 pm

You could check the idle/Running virtual LED state and if it changes then execute a stop command in your macroloop, then before the motion could start it will stop the process.
The Cycle start and probing etc. requires some time to start, so it will very likely stop everything before anything starts moving. (I tested only with cycle start, so you should test if it works with probing.)
cncdrive
Site Admin
 
Posts: 5197
Joined: Tue Aug 12, 2014 11:17 pm

Re: Safety door check

Postby odino87 » Wed Jun 25, 2025 3:08 pm

So basically it's simpler to use a macro loop to stop everything in case of running/jog instead of preventig the operation.

The offline mode can't be usefull? Or the jog/MDI are active anyway in the offline mode?
odino87
 
Posts: 23
Joined: Mon Mar 20, 2023 3:02 pm

Re: Safety door check

Postby odino87 » Fri Jun 27, 2025 2:35 pm

I was able to made some test about the macro loop.
Quite simple macro loop in the end.
It will read the led status of the door and the Idle Led.
If the door is open and the idle led is off it will stop the execution.

Firt I tryed using the
Code: Select all
exec.Stop();

and then
Code: Select all
exec.code("M30");
exec.Stop();


It works ok when I press Cycle Start, but there is some problem while using movement provided by the MDI field input, or using jog and probing function.
There is always a small delay before che macro loop check the status and kill the movments.
One workaround should be to put all the joob feedrate and feedrate to 0% while the door is open, but is just seems to be a bad patch...
In the end I wrote this
Code: Select all
bool lastDoorLed = !AS3.GetLED(37);

double lastFeed = 0;
double lastJogFeed = 0;

while(true)
{
   bool doorLed = !AS3.GetLED(37);

   bool idleLed = !AS3.GetLED(18);
   
   if(!lastDoorLed && doorLed)
   {
      //last was closed but now is open. Save feed value and Stop all and feed to zero
      string tmp = AS3.Getfield(232);
      tmp = tmp.Replace('%',' ');
      lastFeed = double.Parse(tmp);
      lastJogFeed = double.Parse(AS3jog.Getfield(913));
      
      AS3.Setfield(0,232);
      AS3.Validatefield(232);
      AS3jog.Setfield(0,913);
      AS3jog.Validatefield(913);
      
      exec.Callbutton(130);
      exec.Stop();
   }
   else if(!lastDoorLed && !doorLed)
   {
      //last door check is cloed and now door check is closed. Do nothing
   }
   else if(lastDoorLed && !doorLed)
   {
      //lastOpen and now closed, restore feedrate
      AS3.Setfield(lastFeed,232);
      AS3.Validatefield(232);
      AS3jog.Setfield(lastJogFeed,913);
      AS3jog.Validatefield(913);
   }
   else
   {
      if(idleLed)
      {
         exec.Stop();
         exec.Callbutton(130);         
      }
      //last open and now open do nothing, just spam stopping
      AS3.Setfield(0,232);
      AS3.Validatefield(232);
      AS3jog.Setfield(0,913);
      AS3jog.Validatefield(913);
   }
   lastDoorLed = doorLed;
   Thread.Sleep(40);
}

Not nice but works for testing.
Baically I'm just setting to zero all the movments speed (jog feedrate and feedrate).
I should disable the spindle start too.
It's a little bit tricky...
odino87
 
Posts: 23
Joined: Mon Mar 20, 2023 3:02 pm


Return to General discussion about the UCCNC software

Who is online

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