December 14, 2018, 10:03:26 PM
Robotforum | Support for Robotprogrammer and Users


Author Topic:  Controled stopping when fence is open  (Read 1005 times)

0 Members and 1 Guest are viewing this topic.

July 10, 2018, 12:00:48 PM
Read 1005 times
Offline

NovaFlatline


Ok, I am using a router tool, with a 5.5 HP spindle motor. When the fence opens the robot goes to a control stop. Ive wired in a timer (hardwire, not program based) to turn on my fence relay (again hardwired to trip both chanels of the fence circuit) ive got this wired in to delay the fence signal so that i may run a macro to stop the spindle (say 4 seconds) so the operator does not injure themselves. But my problem is that i cant seem to run a macro while another program is running. My macro looks like this.


1: abort
2: if Ro(8) = on , call Spinstp

Im using robot output as a registry bit. I have another program turning that on. Basicly to say if the bit is spinning. Im using an integrated VFD that needs at least 2 seconds to stop spinnig from full speed.

Is there a better way to program this, for example Cstop, or program control.

I dont know how to write that type of code. Forgive me i am self taught. Ive come a long way with all of your help thus far. Sorry ahead of time.

July 10, 2018, 02:57:12 PM
Reply #1
Offline

Iprogram


why are you doing an abort on the first line of your macro? it will not go to line 2 if it is aborted

July 10, 2018, 03:32:17 PM
Reply #2
Offline

NovaFlatline


It doesnt have to be there. I dont know how to stop one program then start another. Thats where the problem lies. When i dont have abort in there it gives a fault saying something about unable to run macro due to another program running. How do i stop the current program and call the next.

July 10, 2018, 04:16:34 PM
Reply #3
Offline

vkoppelo


If I understand you correctly, you want to:

1. Check for request to open fence.
2. If yes, wait X seconds before unlocking fence/door.
3. During this time you want the router/spindle to stop?

Would it work with a BG logic?
Code: [Select]
1:  IF (UO[3]=OFF AND DO[1]=ON),DO[1]=(OFF) ;Translation: If program not running and is spindle is on, send OFF to spindle.

UO[3] is "Prg running" on my robot, it´s set to ON while program is executing. OFF while it isn´t.

With this BG logic active you can never run the spindle without the program running.
Do you check a DI/flag for "fence open requests"?

July 10, 2018, 05:04:22 PM
Reply #4
Offline

Fabian Munoz

Administrator
Hi

Ooops, too late, Oh well I'm posting anyway



Are you familiar with background logic ?
Familiar with UI/UO ?

I can give you more details after but

You can write a BG program where you are asking for the conditions of some UIs  and the INPUT from the timer

So basically, when the fence open you are going to lose some of the UI and 4 seconds later you'll get the input. At that time you can call Spinstp ( i dont even care if ro8=on)

You can not call a program on background, you actually have to turn the spindle output off

What controller do you have ?
somar

July 10, 2018, 05:09:12 PM
Reply #5
Offline

NovaFlatline


I have the fence wired to a "NO" interlock as the gate latch. So when the 24Vdc goes high it goes to a "on delay" timer. Timer is wired "NO" when that closes it triggers the coil on my fence relay wired "NC". While timer is counting the same wire going to the coil is going to a "DI [7]" which has a macro program waiting for the input. When the macro is triggered it will not alow it to run as there is another program running. Basically i need the spindle to stop apon opening the fence before it faults out, haulting any program running. Robot goes to a control stop, but the spindle is still running. Driven by the third party VFD.

Do i hold the current program, then start the new one?
Do i stop the current program, and run the next?
How do i program that?


I have
R-3iB controller.
I am also unfamiliar with BG logic. Still very new. Self taught.

July 10, 2018, 05:52:20 PM
Reply #6
Offline

vkoppelo


Ok.
B(ack)G(round) logic is like the name suggests. It´s programs that run in the background in parallel with your "main program".
To create a program to be run in the background, create a new program like you normally do.
Create your logic.
Thereafter enable it in the "BG Logic"-menu.
As long as it is enabled the program will run each 8 millisecond (default?).

On my teach pendant I find "BG Logic" under "[Menu]" > "6. Setup" > "BG Logic".
Can you find it in on yours?

So you want to watch DI[7] for a ON-signal, then send ON/OFF to the VFD to shut it off?
What output is the VFD wired to?

Keep in mind that programs for BG logic does have some limitations (calls etc. just like Fabian mentioned).
Usually it just errors when trying to enable the program under "BG Logic" if this is the case.

July 10, 2018, 07:07:35 PM
Reply #7
Offline

NovaFlatline


Ok. I will look for that in my settings.
Let me get this right,

BG logic checks if conditions are made
Example

1: LBL[1]
2: IF DI[07] = ON, JMP LBL [2]
3: LBL [2]
4: DO[?] OFF (VFD)
5:JMP LBL[1]



Now i only care if RO[8] is on because that states that my spindle is at speed. If i dont check for this my spindle will run in reverse. As i am at a forward spin and i turn off forward spin and force reverse on to stop. If i do not do this i would have to wait 90 seconds for the spindle to stop from free spin. Mostly for cycle time.

So back to BG logic, this stop program that is above i would set as a BG Logic from inside my settings.
And this should work...

July 10, 2018, 07:30:57 PM
Reply #8
Offline

Fabian Munoz

Administrator
Couple of things

You dont need LBL1 and JUMP LBL1    BG logic loops automatically.
BG logic does not accept that kind of IF

if di7 = on then
do[?] = off
endif

For the record. I'm glad you posted that question because the answer will help a lot of folks in the same situation
I know human safety is first, but when is possible, it will be nice to "slow down" the process and then stop it. Sudden stop does not help machinery
« Last Edit: July 10, 2018, 07:35:47 PM by Fabian Munoz »
somar

July 10, 2018, 08:02:25 PM
Reply #9
Offline

vkoppelo


You beat me to it, Fabian. :icon_mrgreen:

There´s no need for the "JMP LBL[1]".
The code will be repeated anyways.
Also, if a IF-condition isn´t met, it will continue execution of the program.

A more "correct" example would be this:
Code: [Select]
1:  IF DI[7]=ON,JMP LBL[1] ;
   2:  JMP LBL[2] ;
   3:  LBL[1] ;
   4:  DO[10]=OFF ;
   5:  LBL[2] ;

If DI[7] = ON, jump to LBL 1 else continue to next row. On next row jump to LBL 2 (the end).

Fabian, do you know why I get a "syntax error" when I try to enable this on a R-J3iB controller (running V6.40)?
I know that JMP LBLs work in BG logic on a R-30iB (running V8.30?), is it a software limitation in older units?

Fabian's answer :   As far as I know it is, same with TIMER or WAIT



Nova,
If I understand you correctly.
You pulse reverse in order to stop the spindle faster? To stop the forward momentum faster vs. letting it freespin to a stop?
If you get ON on DI[7], do you want to pulse the reverse output for a couple of seconds?
Is forward spin and reverse spin mapped to 2 digital outputs?

You are currently using RO[8] as a registry bit (ON/OFF?). Flags can be used for this aswell. R[ * ] are for numerical values, F[ * ] are for ON/OFF.
:beerchug:
« Last Edit: July 10, 2018, 08:22:30 PM by Fabian Munoz »

July 10, 2018, 08:29:15 PM
Reply #10
Offline

HawkME


For the record, you don't need any jump labels for this. Instead of jumping around just do what you want to do.

:  IF (DI[7]), DO[10]=(OFF);


July 11, 2018, 11:30:40 AM
Reply #11
Offline

Iprogram


I would use a condition handler to do this but like other suggest BG logic would work.

why does the router need to stop fast is there a safety issue? if no safety issue and the work piece is getting damaged during this process in my condition handler i would do a tool offset away from the part during the deceleration of the router. 
« Last Edit: July 11, 2018, 11:36:49 AM by Iprogram »

July 11, 2018, 02:01:39 PM
Reply #12
Offline

NovaFlatline


Ok. At this shop human saftey has been pushed. The "saftey committee" tell me that if a moron opens the fence while the part is still being processed the spindle needs to stop along woth the robot.

I cant find the BG logic in my settings. Do i need to turn this on from my variables?

So if i can not use "if" statements how should i write this code. Confused.

July 11, 2018, 02:43:04 PM
Reply #13
Offline

Iprogram


just make a condition handler, for this example call it STOP and in the main loop do a MONITOR STOP. this doesn't need called multiple times only once in the main program is fine. Like this:

MONITOR STOP

LBL[1]
PROGRAM1
PROGRAM2
PROGRAM3
JMP LBL[1]



Your monitor program would look like this

IF RO[8]=ON Call SPINSTOP

But remember to also do a MONITOR STOP at the end of your SPINSTOP program otherwise it will only work one time or after an abort. Let me know if this makes sense


July 11, 2018, 03:48:03 PM
Reply #14
Offline

HawkME


Nothing you do with BG logic or condition handlers is safety rated. Could you instead wire a relay in with the fence circuit to bring the motor to a Category 1 stop. That would be simple and much safer.

So I see you are already doing this with a timer, so just add one more relay to it to give the stop command to the VFD.
« Last Edit: July 11, 2018, 03:51:15 PM by HawkME »

July 11, 2018, 04:43:38 PM
Reply #15
Offline

Lemster68


I have worked on quite a few cells which incorporate a request to enter button/switch.  Use a condition monitor to look for the request to enter, stop program and spindle, and only then, unlock the gate.

July 12, 2018, 12:59:23 AM
Reply #16
Offline

NovaFlatline


I dont fully understand the condition handler, but if the logic states what im reading to be correct this is whats happening.

"Watch this input"

"While doing these programs"

Loop to beginning.

That would make sense.

Hawk i am confused on "category 1 stop" .
In order for me to stop my VFD i need to...
1, turn off my forward direction
2, reset VFD
3, turn on reverse direction (hold on for 2 seconds)
4, reset VFD again.

This will stop my spindle from 20,000 rpm to a dead stop. In two seconds. Regardless of any effect it has on the VFD or brake resistor. Im only driving 300 Hz at 7 amps. Not much, but enough.

In order for me to wire the VFD appropriately i would need three relays. One to handle forward and reverse, forward would be on a "NC" and reverse would be on "NO" with one relay handling the power to that relay coil to control which connection​ on the VFD is the input.  And the third to reset the VFD. Im going tonhavr to think about this alot more now that i am looking at it. Kinda makes your head spin.

A permission to enter would be nice for a closed cell, but we run 3 min cycle times and need to enter the cell after each part. I would like to use some light screens and saftey sensors, but at this time there is not a place in the budget for these things.
« Last Edit: July 12, 2018, 01:07:33 AM by NovaFlatline »

July 12, 2018, 05:42:34 PM
Reply #17
Offline

HawkME


Category 1 would be a safety rated controlled stop. But if you are already using a timer to kill the VFD then you wouldn't necessarily need to do this.

 I guess I don't understand why you need to do the revers direction thing and not just give a stop command to the VFD, which could be done by a relay or BG Logic, or Condition handler.

What controller version are you using? BG Logic is in Menu>Setup>BG Logic.

July 12, 2018, 08:08:53 PM
Reply #18
Offline

Fabian Munoz

Administrator
Maybe the spindle overshoots when stops (abrupt) and need to go reverse to find itself again.

We actually use some motor controls that they are running FWD and to stop it we turn BWD on
somar