<< Prev        Next >>

Program Example

A program example is shown below.

Program example description

  1. This program shows the example of the interdigitation.
  2. The Compliance Function with Force Sensor starts once the robot brings a workpiece to the starting position of the force control.
  3. The Compliance Function with Force Sensor ends once the workpiece has moved specified distance.

Example

Sub Main
'!TITLE "Interdigitation motion"
'
' Acquire the workpiece position				P[1]
' Force control starting position				P[2] 
' Once this travel distance is achieved, force control ends	F[1]

  Dim startPos As Position
  Dim rotStartPos As Position
  Dim snsrVal As Position
	
  TakeArm Keep = 0
  
  Move P, @e P[1]				'Position to get workpiece
  
  Delay 100
  
  hand0.Chuck 1					'Hand chuck
  
  Delay 100
  
  Move P, @e P[2]				'Starting position
	
  startPos = CurPos				'Set the current position as
  						'the starting position
  
  ForceSensor 0					'Reset sensor
  
  Delay 500
	
  ForceCtrl True, 1, Mode = 1			'Start the Compliance Function with
  						'Force Sensor
	
  Do
  
  snsrVal = ForceValue(0)			'Acquire the sensor value
  
  'Condition for motion end
  'Wait until the tool end passes F1mm from the force control starting position  
        					
  If (Abs(PosZ(*)-PosZ(startPos)) > F[1]) Then GoTo StopProc 
  
  Loop
	
  StopProc:
  		
  ForceCtrl False				'End the force sensor
  
  hand0.Unchuck 0				'Unchuck the hand
  
End Sub

 

<< Prev        Next >>