<< Prev        Next >>

ID : 2981

[Sensor Tracking] Programming Examples of Free Curve Interpolation

The below describes programming examples of free curve interpolation (TrackMove S) during sensor tracking.
This program is designed for workpieces whose length are less than the tracking range.

Example

Free Curve Interpolation during sensor tracking can be possible by the following three programs.

  1. "Main program"

    Main program is a initialization program with regard to the tracking.

  2. "Workpiece detection program"
    Workpiece detection program is a program that detects workpiece positions and saves the obtained data into tracking buffer.
  3. "Tracking operation program"
    Tracking operation program is a program that reads out the data of workpiece positions from the tracking buffer and executes free curve interpolation motion.

1. Main Program (FreeCurveSensorTracking.pcs (PCS:354B))

Clear the tracking buffer area of the specified conveyor number and start detecting a trigger from sensor signal.

TrackInitialize ConvNum, 0

Execute workpiece detection program and tracking operation program concurrently.

Run FreeCurveVisionSensor
Run FreeCurveTracking

2. Workpiece Detection Program (FreeCurveSensor.pcs (PCS:2KB))

Detect a rising edge.

Wait IO[IONum] = OFF
Wait IO[IONum]

Add the latest sensor detection coordinates (encoder value) to the tracking buffer as much as the number of workNum.
In this case, it is possible to add userdata up to the number of workNum as variant-type array.

TrackSetSensor ConvNum, workNum, arrayUser

3. Tracking Operation Program (FreeCurveTracking.pcs (PCS:3KB))

With a TrackStart command, move a robot arm to the home position before starting the tracking.
Please note that executing any commands designed for non-tracking mode, such as Move command, will interrupt the tracking motion. (Commands whose name do not start from "Track" will interrupt the tracking motion.)

Move P, P[HomePos]

The main loop for the tracking and pick-up motion that is executed whenever a workpiece is detected.
In this program, turning ON of an internal I/O is specified as the loop continuation condition so that the loop can be stopped in the middle of the program.

Do
    P[10] = TrackTargetPos(1)
 
    ...
 
    TrackApproach P, P[FirstPathPointWork], ApproachLength
 	
    TrackMove S, P[TargetPos], PathNum
	
    ...
 
LOOP UNTIL IO[AbortIONum] = ON

This is the processing within the loop.

Pick up a workpiece from the tracking buffer and then set it to the tracking target work.
If there are no workpieces detected, the program will wait until workpiece is detected and its data is stacked in the tracking buffer.

    P[TargetPos] = TrackTargetPos(ConvNum)

Convert the data of conveyor reference coordinate that was obtained above to the position of base coordinates.

    P[TargetPosBase] = ConvertPosWork( P[TargetPos], -1, 0 )

Obtain the coordinates of the first path point and convert it to the current work coordinates.

    P[FirstPathPoint] = GetPathPoint( PathNum, 1 )
    P[FirstPathPointWork] = ConvertPosWork( P[FirstPathPoint], P[TargetPosBase], -1 )

Start the tracking mode. The robot does not start its motion at the timing of this command execution.
The robot starts its motion once a tracking motion command, such as TrackApproach, is executed.

    TrackStart ConvNum

With performing the catch up motion in order that the robot moves at the conveyor speed, move the robot arm to the approach position which is approach-length above of the first path point.

    TrackApproach P, P[FirstPathPointWork],  ApproachLength

With the catch up motion, move the robot arm to the first path point.

    TrackMove P, P[FirstPathPointWork]

Start free curve interpolation motion.

    TrackMove S, P[TargetPos], PathNum

With the catch up motion, move the robot arm to the depart position which is depart-length above of the tracking target work.

    TrackDepart P, DepartLength

Terminate the tracking mode. Stop the catch up motion and reduce the robot arm speed until the robot fully stops.
If the workpiece moves across the downstream limit of the tracking range before executing this command, an error will be issued.

    TrackStop

Place the picked workpiece to the ejection position.

    Approach P, P[EjectPos],  ApproachLength

ID : 2981

<< Prev        Next >>