Author Topic: Go "home" from inside a program.  (Read 434 times)

0 Members and 1 Guest are viewing this topic.

Offline NovaFlatline

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 14
Go "home" from inside a program.
« on: June 12, 2018, 05:16:01 PM »
I am self taught on fanuc controller, looking for a way to send the robot home on a pushbutton. I would like to use "user 2" button on the controller. If the fence is opened the robot goes to controled stop mode, but say an operator loads the part wrong and starts program then notices it. Is there a way that i can program the robot to "Z+" say 50 MM and return to a "home" position? What would be the steps to do so. Also i have UI 1,2,3,8 set to rack 35 slot 1 start 1 (on) would using the "user 2" be defeated by that said setup?

Offline rAviteja_g

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 7
  • Posts: 81
Re: Go "home" from inside a program.
« Reply #1 on: June 12, 2018, 06:27:49 PM »
I really don't know about user 2 buttons, but similar situation arised  with Yaskawa, In home program write before teached point 

If( Signal = ON)

LPOS  //Take current pos Z valur

L   LPOS  Tool offset PR[]      // In PR[] keep the value Z

}

L or J [Home]


Offline andreic

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 38
  • Posts: 196
Re: Go "home" from inside a program.
« Reply #2 on: June 13, 2018, 12:32:40 PM »
Basically if you want to be able to send the robot in home pos, one option would be to use condition handlers in KAREL programs and one HOME TP program. Condition Handler will abort the current running program and call HOME program.

Offline NovaFlatline

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 14
Re: Go "home" from inside a program.
« Reply #3 on: June 13, 2018, 04:52:47 PM »
Can you wirte karel from TP? Kinda lost here, my apologies.

Offline HawkME

  • Hero Member
  • *****
  • Thank You
  • -Given: 17
  • -Receive: 158
  • Posts: 656
Re: Go "home" from inside a program.
« Reply #4 on: June 13, 2018, 05:45:55 PM »
You can create a Home program as a macro, then assign that macro to trigger from a user key.

Create your homing program, then on the select screen highlight and press detail. Chang the type to macro.

Then you assign the user key to trigger the macro.

Menu>Setup>Macro. Select your homing program and set the assignment to UK[2] (user key 2). To run the macro you will probably first have to abort the currently running program (FCTN>ABORT) then press SHIFT+UK[2].

If you have the manual then just search for macro and it will tell you everything you want to know and more.

Offline NovaFlatline

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 14
Re: Go "home" from inside a program.
« Reply #5 on: June 13, 2018, 05:48:04 PM »
Find the manual. Ok.

Offline NovaFlatline

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 14
Re: Go "home" from inside a program.
« Reply #6 on: June 13, 2018, 10:38:49 PM »
Update, i now know how to trigger a macro to use a program. With that said, im still lost with the homeing program. I take the LPOS, keep the Z, uh and im lost.
I load the position data, add 50 MM to Z+ to come off my work piece?
How about if i were to create a point two meters above and hope for the best. Im only using a 4" X 1/2" router bit.

Offline andreic

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 38
  • Posts: 196
Re: Go "home" from inside a program.
« Reply #7 on: June 14, 2018, 12:21:52 PM »
So, regarding KAREL + TP program solution:
You have your KAREL program (with %NOABORT, %NOPAUSE etc.  which runs continuously), let's call it MYKLPROG.
You have your HOME TP program, let's call it GOHOME.
Inside MYKLPROG you make a condition handler to monitor desired signals and use RUN_TASK, ABORT_TASK to control GOHOME.

Offline HawkME

  • Hero Member
  • *****
  • Thank You
  • -Given: 17
  • -Receive: 158
  • Posts: 656
Re: Go "home" from inside a program.
« Reply #8 on: June 14, 2018, 01:31:27 PM »
Update, i now know how to trigger a macro to use a program. With that said, im still lost with the homeing program. I take the LPOS, keep the Z, uh and im lost.
I load the position data, add 50 MM to Z+ to come off my work piece?
How about if i were to create a point two meters above and hope for the best. Im only using a 4" X 1/2" router bit.

Say that PR[1] is your home position and PR[2] is used to store the current position.

Homing Program:
:  PR[2]=LPOS;
:  PR[2,3]=500; -> make this whatever value is a safe Z height to move to from your active user frame
:L PR[2] 500mm/sec FINE ;
:J PR[1] 20% FINE ;

So it will move from the current position to a safe Z height, then Joint move to home.

Offline NovaFlatline

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 14
Re: Go "home" from inside a program.
« Reply #9 on: June 15, 2018, 10:56:26 AM »
Ok, and this wont effect the current user frame. What i mean is the frame itself is not effected so i wont have to reframe. I would have to change all 6 axis if it where to lose it.

Offline andreic

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 38
  • Posts: 196
Re: Go "home" from inside a program.
« Reply #10 on: June 15, 2018, 11:11:46 AM »
It would be safer to use UFRAME[0] for going home positions.

Offline HawkME

  • Hero Member
  • *****
  • Thank You
  • -Given: 17
  • -Receive: 158
  • Posts: 656
Re: Go "home" from inside a program.
« Reply #11 on: June 15, 2018, 01:36:31 PM »
Ok, and this wont effect the current user frame. What i mean is the frame itself is not effected so i wont have to reframe. I would have to change all 6 axis if it where to lose it.
No, it will not affect your uframe. Like any program, be sure to  set the active uframe and utool before any motion instructions.

Doing homing routines in uframe[0] is a very common method.

Sent from my SM-G930V using Tapatalk


Offline NovaFlatline

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 14
Re: Go "home" from inside a program.
« Reply #12 on: June 18, 2018, 04:11:08 PM »
It wont let me program a movement to a user key. Looks like another push botton needs to be installed.
Ive got this

PR[1] = UFRAME

PR[2] = LPOS
PR[2,3]=500
L: PR[2] 500mm FINE
J: PR[1] 20% FINE
Am i missing something?
R3JB Controller

Offline HawkME

  • Hero Member
  • *****
  • Thank You
  • -Given: 17
  • -Receive: 158
  • Posts: 656
Re: Go "home" from inside a program.
« Reply #13 on: June 18, 2018, 05:14:47 PM »
PR[1] shouldn't be = UFRAME, it should be taught as your "home" position.

I would delete that 1st of code line and instead put in:

:  UFRAME_NUM=?;
:  UTOOL_NUM=?;

Replace the "?" with the user frame number and user tool number that you want this program to operate in.

Then, without worrying about the user key, just run and test this program in teach mode to ensure it safely does what you want it to do.

Finally, to assign the user key you need to go to menu>Setup>macros. Your program must be created as a macro. To check this you go to the select list, highlight the program name, and press detail. Under subtype you can change it to macro.

Offline NovaFlatline

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 14
Re: Go "home" from inside a program.
« Reply #14 on: Yesterday at 04:49:35 PM »
Thank you. Works like a charm.