Interrupt Issue

Hello to the members..
i am working on a drilling spindle which can sense the object using load indicator, a touch will generate current rise, which is used as interrupt signal in the rapid code. the point of touch will be the starting point of the moveL in trap routine.
below is the rapid code for the drill: 

VAR intnum intload

PROC main ()

IDelete intload;

Connect intload WITH Drilling;

ISignalDI , Control_Drill, 1,intload;

Set Spindle_on;           “Bit to power up Spindle”

MoveJ p10, v100, Fine, Tool1;

MoveL p20, v100, Fine, Tool1;

Set Enable_On;           “Spindle Start Rotating at reference speed”

Wait Time 2;               “Time to reach desired rpm and get smooth in terms of current”

MoveL OFFs (P20, 0, 0, 50), V10, Fine, Tool1;

! Interrupt should occur here as the drill bit touches the surface before reaching 50mm Z-Axis and DI “Control_Drill” sets high. Robot should go to P40.

Reset Enable_On;

MoveL p40, V10, Fine, Tool1;

Reset Spindle_on;

End PROC

TRAP Drilling

VAR Robotarget p40

StopMove/ Quick;

P40:= CRobT ( \Tool := Tool1 \ WObj := WObj0);

MoveL OFFs (p40, 0, 0, 30), v10, Fine, Tool1;

ClearPath;

StartMove;

ExitCycle;

End TRAP


Comments

  • lordsikander
    lordsikander pakistan
    my problem is, in auto-mode robot directly goes to TRAP Routine at P40, and got stuck there, even if the DI is not set high. 
    I also used "SearchL" command instead of "MoveL". the robot goes to p40 and got stuck there after Di is set high.
    i looked for "StorePath" and "RestorePath" commands in my teachpendant commands list but could not found.
  • graemepaulin
    graemepaulin New Zealand ✭✭✭
    Have you tried using a waitdi in the main routine where your comment about the interrupt is.
    The stopmove/quick and the rest of your drilling code can go directly after the waitdi in the main routine
  • lordsikander
    lordsikander pakistan
    i tried using Wit DI, the problem was, Robot first finish the 50 mm Offset movement in Z-axis then look for the waitDI. And i need interrupt before the 50mm offset, as surface will be detected by the drill bit a variable value, which can be at 30mm or 40mm or 25mm. 

  • graemepaulin
    graemepaulin New Zealand ✭✭✭
    If you change the zone to z0 instead of fine the logic will continue on to the WaitDI and then to the stopmove once the Input is made.
  • lordsikander
    lordsikander pakistan
    Sir, I tried "WaitDI" command using zonedate "Z0", but the problem still occurs. the robot first complete the 50mm offset move then go for the waitdi command. I also used SearchL command the same problem remains. Robot stucks at "MoveL" Command right after the "StoMove/Quick" command.
    I studied an example in the manual, there is a need of "Storepath & Restorepath" command whenever the "StopMove" command is used. I look for the commands in the "Teachpendant" motion & adv, i only found "Clearpath" command. Could this be the reason 
  • graemepaulin
    graemepaulin New Zealand ✭✭✭
    The searchL command will stop the robot so you do not need the StopMoveQuick.
     Example from manual:- SearchL \Stop, di2, sp, p10, v100, probe;
Sign In or Register to comment.