what is the best way to set up an additional program designed to move the robot to its home position from anywhere. more specifically how do i call the program? with a FANUC system i would just set up a macro to be called by a DI. i thought originally to set it up as an event routine but those only trigger off system events (power on, restart, start/stop, etc.). is there an option to set up something similar to the FANUC macro or does it need to be part of the running program somehow?
ABB separate routine (macro)
-
Jleon89 -
July 30, 2024 at 7:04 PM -
Thread is Unresolved
-
-
Hi, take a look to path recovery instructions. Be sure you have path recovery option installed
/BlueIcaro
-
i do not have the path recovery option listed in my options. i do believe i figured out how to call the program, i just listed it as a system input however i have yet to test it because im still trying to build the program.
ThreadABB home program
i am trying to set up a home program so if the robot is stopped somewhere in its program (crash, power outage, estop,...) anything that may cause it to stop, run this program and it will go to its home position. this is easy for most of the robots workspace but it enters a clampframe to set a HIC part at the end of its cycle. i need to check my z coordinate to make sure im above a certain position and if not move above it then check my y coordinate and if its in the clampframe back out to a…Jleon89July 30, 2024 at 9:16 PM -
If you want to be able to call the homing routine at anytime (I presume with an input signal) then you are looking for Traps & Interrupts. You will need both.
The interrupt, once established, allows the robot to constantly monitor for a specific input signal (or other condition, such as a timer reaching a certain value). Once the interrupt is triggered, it will call a TRAP routine, which can perform essentially any task, including motion. After the trap routine is completed, it will return to the previous execution stack unless otherwise directed.
They can be a little tricky the first time, but there are lots of details and examples in the documentation. You will need to reference:
TRM - RAPID Instructions, Functions, and Data types
TRM - RAPID Kernel
TRM - RAPID Overview
-
- Declare your interrupt
- Connect you INT to a TRAP
- Tie a timer or signal to your interrupt
- In your TRAP routine, write your homing instructions
In the example below, when the digital input goes high, the TRAP routine will be called immediately after the completion of any current instruction on the stack. Once the TRAP is complete, execution will return to the previous stack level.
Code
Display MoreVAR intnum INTERRUPTUS_MAXIMUS TRAP tr_VENGEANCE TPWrite "My name is Maximus Decimus Meridius."; RETURN ; ENDTRAP PROC main() CONNECT INTERRUPTUS_MAXIMUS WITH trVENGEANCE ISignalDI di_TellMeYourName,1,INTERRUPTUS_MAXIMUS; IEnable; !Production Stuff ENDPROC
There is a lot more that CAN be done, but this is the basic structure.
-
A common practice is to delete an interrupt first, even if it is not defined, so a 41452 Argument Error 'Already connected' error does not occur.
-
- Declare your interrupt
- Connect you INT to a TRAP
- Tie a timer or signal to your interrupt
- In your TRAP routine, write your homing instructions
In the example below, when the digital input goes high, the TRAP routine will be called immediately after the completion of any current instruction on the stack. Once the TRAP is complete, execution will return to the previous stack level.
Code
Display MoreVAR intnum INTERRUPTUS_MAXIMUS TRAP tr_VENGEANCE TPWrite "My name is Maximus Decimus Meridius."; RETURN ; ENDTRAP PROC main() CONNECT INTERRUPTUS_MAXIMUS WITH trVENGEANCE ISignalDI di_TellMeYourName,1,INTERRUPTUS_MAXIMUS; IEnable; !Production Stuff ENDPROC
There is a lot more that CAN be done, but this is the basic structure.
I just set up a trap similar to what you suggested, and it seems to work but with a few bugs.
1. it finished the routine it was running before going home. is there any way to make it either finish the movement it's on then jump to the trap or stop in its tracks (preferably this way) and immediately start the trap routine.
2. I want it, after running the trap, to end the module so the operator has to start from the beginning. is the "exitcycle" command at the end of the trap the correct way to do this?
3. when trying to run the program a second time i got an instruction error telling me it's not legal to connect a variable to a trap more than once. is there something i need to add to reset that at the end of the module? how do I address that?
-
A common practice is to delete an interrupt first, even if it is not defined, so a 41452 Argument Error 'Already connected' error does not occur.
Just saw this response after I sent my reply, I'm getting a similar error but basically saying the same thing. how do I "delete" the interrupt so it will run the next time the program is ran
-
look up the instruction "IDelete" in the manuals
-
I just set up a trap similar to what you suggested, and it seems to work but with a few bugs.
1. it finished the routine it was running before going home. is there any way to make it either finish the movement it's on then jump to the trap or stop in its tracks (preferably this way) and immediately start the trap routine.
The way that interrupts work, it will never be truly "instantaneous." Once the interrupt is triggered, whatever instruction is currently being performed must finish first. For instance, if you are in the middle of a long move that will take 5 seconds to complete, the Trap routine will not start until that move instruction is complete.
Quote from Jleon892. I want it, after running the trap, to end the module so the operator has to start from the beginning. is the "exitcycle" command at the end of the trap the correct way to do this?
Yes, ExitCycle is exactly what you want there. Don't forget though, depending on the rest of your program, you may need to reset and/or validate some variables or signals after an ExitCycle. Otherwise, it may result in unexpected system function.
Quote from Jleon893. when trying to run the program a second time i got an instruction error telling me it's not legal to connect a variable to a trap more than once. is there something i need to add to reset that at the end of the module? how do I address that?
As Alex H commented, you will need to utilize IDelete (and possibly ISleep / IWatch, depending on how you set things up).
The connection between Interrupt and Trap can only be made once. And other interrupts can occur while inside a trap routine. So there are several instructions to help control these situations...
- IDelete - removes the relationship between a Trap and interrupt. Will require the use of CONNECT instruction to restore. IDelete should be used on startup to wipe the slate, then re-define and connect your Interrupts and Traps.
- IDisable - Temporarily blocks ALL interrupts. Used if you want to ensure that none of your other Interrupts trigger during a certain event. Reverse this command with IEnable.
- ISleep - Deactivates an individual interrupt. Reverse this command with IWatch.
-
ok the interrupt and trap seem to be working as advertised, I don't really like that it doesn't abort its current procedure to immediately go to the home position but from what I've gathered, from this thread and other sources, that's the way it's designed to work and I can't make it do what I'm trying to do. i very much appreciate all the info everyone.
The only issue i have now is the home procedure will only function if the main program is running, if it's in a stop condition or the program hasn't been started there is no way to trigger that procedure.
I've thought of a couple possible solutions but so far nothing has worked:
1. manipulate the PLC logic to send cycle start with the DI_Robot_to_home bit active. the only reason I don't like this (though I have not tried this yet) is because I don't want it to have to run through its first routine before running the trap both for time purposes and general safety, unnecessary moves = potential crash scenarios.
2. utilize a system input to Load and start a separate module with the homing procedure. I've tried to implement this but it always tells me "20147: Load and start rejected"
3. an event routine. I've looked into this a little but from what I can tell none of the trigger events are useful for this and it's not designed to be used this way.
-
It doesn't need to be so difficult. Use the Start at Main system input, with a home check at the top of your main program. If it is not at home, then call your homing routine.