RobotStudio event

Automatically path correction with ultrasonic sensor

Options
Dear all,
I would like to cut a square with an ABB ROBOT using a blade as tool.
I have a sensor (ultrasonic sensor) to check if the blade touch the material to cut.
I would like to know if it's possible to do automatic offset while triming if the sensor don't touch the material

PERS tooldata tPen := [ TRUE, [[200, 0, 30], [1, 0, 0 ,0]], [0.8,[62, 0, 17], [1, 0, 0, 0], 0, 0, 0]];
CONST robtarget p10 := [ [600, -100, 800], [0.707170, 0, 0.707170,0], [0, 0, 0, 0], [ 9E9, 9E9, 9E9, 9E9, 9E9, 9E9] ];
CONST robtarget p20 := [ [600, 100, 800], [0.707170, 0, 0.707170,0], [0, 0, 0, 0], [ 9E9, 9E9, 9E9, 9E9, 9E9, 9E9] ];
CONST robtarget p30 := [ [800, 100, 800], [0.707170, 0, 0.707170,0], [0, 0, 0, 0], [ 9E9, 9E9, 9E9, 9E9, 9E9, 9E9] ];
CONST robtarget p40 := [ [800, -100, 800], [0.707170, 0, 0.707170,0], [0, 0, 0, 0], [ 9E9, 9E9, 9E9, 9E9, 9E9, 9E9] ];

PROC main() MoveL p10, v200, fine, tPen;
   MoveL p20, v200, fine, tPen;
   MoveL p30, v200, fine, tPen; 
   MoveL p40, v200, fine, tPen;
   MoveL p10, v200, fine, tPen;
ENDPROC

Is it possible to do interrupt each 5Hz to test if sensor is On or Off to adjust the trajectory ?
Thank you in advance for help.
Regards,
Naturlight

Comments

  • soup
    soup ✭✭✭
    Options
    Look into using Corr. Or, a cheap and dirty version which mocks Corr could be dynamically creating a bunch of targets between two points and then correcting at each position in a simple move instruction.
  • Naturlight
    Options
    Thank you for answer.

    So if i write something like this (one sensor)
    Could you help to manage the trap to automatically change the offset ?

    <div>num TARGET_DIST := 5;</div><div>CONST num SCALE_FACTOR := 0.5;</div><div><br></div><div>VAR intnum intno1;</div><div>VAR corrdescr hori_id;</div><div>VAR pos total_offset;</div><div>VAR pos write_offset;</div><div><br></div><div>VAR bool conFlag;</div><div><br></div><div>PROC PathRoutine()</div><div><br></div><div>! Connect to the correction generators for horizontal correction.</div><div>CorrCon hori_id;</div><div>conFlag := TRUE;</div><div><br></div><div>CONNECT intno1 WITH ReadSensors;</div><div><br></div><div>ITimer\Single, 0.2, intno1;</div><div><br></div><div>MoveJ p10, v100, z10, tool1;</div><div><br></div><div>! Run MoveL with both vertical and horizontal correction.</div><div><br></div><div>MoveL p20, v100, z10, tool1 \Corr;</div><div><br></div><div>! Read the total corrections added by all connected correction generators.</div><div><br></div><div>total_offset := CorrRead();</div><div><br></div><div>! Run MoveL with only horizontal interrupt correction.</div><div><br></div><div>MoveL p30, v100, fine, tool1 \Corr;</div><div><br></div><div>CorrClear;</div><div><br></div><div>! Remove the timer interrupt.</div><div><br></div><div>IDelete intno1;</div><div><br></div><div>ENDPROC</div><div><br></div><div><br></div><div>TRAP ReadSensors</div><div><br></div><div>VAR num horiSig;</div><div><br></div><div>! Compute the horizontal correction values and execute the correction.</div><div><br></div><h2>IF SENSOR DONT DETECT THE EDGE OF THE GLASS MOVE OFFSET IN THE Y DIRECTION ? how to manage it</h2><div><br></div><div>horiSig := hori_sig;</div><div>write_offset.x := 0;</div><div>write_offset.y := (hori_sig - TARGET_DIST)*SCALE_FACTOR;</div><div>write_offset.z := 0;</div><div><br></div><div>CorrWrite hori_id, write_offset;</div><div><br></div><div>!Setup interrupt again</div><div><br></div><div>IDelete intnol;</div><div><br></div><div>CONNECT intno1 WITH ReadSensors;</div><div><br></div><div>ITimer\single, 0.2, intno1;</div><div><br></div><div>ENDTRAP</div>
  • soup
    soup ✭✭✭
    Options
    Not sure of your question... Your code looks good.