• No results found

3.4 Automated Test Cases

3.4.3 General movement (ATC-1)

The purpose of the tests of general movement test case, is to test all basic functionalities of the industrial robot.

CHAPTER 3. IMPLEMENTATION 27 3.4.3.1 Direction and position

The purpose of this first test is to verify very basic movement, checking that the robot is moving the TCP in the correct direction. And that the robot is moving its TCP to the correct position. Because this test is to determine the correct movement calculation of MoveJ RAPID operation, the first rapid instruction use MoveAbsJ to set the robot in the initial position based on the robot’s joint angles.

When the joint target is reached, that point is tracked with RobTracker, and defined as a center point. Then in sequence the robot moves its TCP in each positive X, Y, and Z direction, by calling a MoveJ operation with 50mm/s. While moving, the tracker is retrieving the position by averaging over 100ms, to reduce the implication of jitter from the tracker. For each result from tracking, the difference from last tracked point is calculated, and then checks that the movement in the current direction is positive. If the difference is not positive, an error is given, indicating that the robot did not move in the correct direction.

After each movement in the different directions, the stationary point is tracked and stored as a point. These points are predefined and compared to determine if the robot ended up in the desired position. If the robot is not within 4.0mm, which is the defined allowed deviation for this test, an error is given for that sub test.

3.4.3.2 Orientation

To determine if the the orientation of a given target is achieved correctly. This test moves the TCP to four different targets, and records the tracked position of each of them. The recorded orientation is compared with the predefined orientation, and the differential are calculated. The angular deviation limit for this test is set to 5 degrees, and each point tested will result in an error if the deviation is not within this limit. Each tracked point is added to a path object, and stored to a single file when completed.

3.4.3.3 Linear movement

The purpose of testing a linear movement, is to verify the correct operation of the RAPID instruction MoveL. This test performs two MoveL instruction between two points, one maintaining the same orientation, and another with a continuous rotation to the orienta-tion.

In the RAPID code, four targets are defined, two start targets, and two stop targets, with the same position. They first set of targets have both targets with the standard orientation, while the second set have both different orientation, resulting in a movement where the TCP is following a line, while the orientation is changing through the movement.

The targets are positioned such that the TCP is only moving in the Y-axis, keeping both X and Z unchanged.

Both movements are tracked separately, and checked one by one. Due to the simplification of only moving in Y direction, the deviation is found by extracting a two-dimensional

vector from the X and Z positional value for each tracked point. The length of this vector represents the deviation for that particular point. The allowed deviation is set to 5mm, and if a deviation greater than that, an error is logged.

For each path that is tested, a new path object is created where each out-of-bounds point is copied to. At the end of the test, both the tracked paths, and the out-of-bounds path are stored to file, and can be examined at a later point if desired.

3.4.3.4 Circular movement

Circular movements are performed with the RAPID instruction MoveC. This test uses this instruction to move the TCP in a circular movement, and then verify that the tracked path follows that circle.

This test moves in a circle twice, one with the tool orientation stationary, and one with a changing orientation throughout the movement, where both runs are tracked into separate paths. The RAPID targets used for the circular movement, are all set to the same position on the X-axis, where all movement happens in the Y and Z-axis.

When checking deviation from the circle path, it’s the distance from each point to the oracle circle, following a perpendicular line to the tangent of the circle. By removing the X-axis value from the 3D position, the result a 2D vector that is on the same plane as the circle. When the tracked position is compensated for the offset to the oracle circle, the length of this 2D vector should be the same as the radius of the circle. This difference and the difference in X-axis, represents a 2D vector with a length of the deviation from the circle.

The allowed deviation is set to 5mm for this test, where an exceeded deviation in a point will be reported as an error. All points with too much deviation are stored into a separate path. Both the tracked paths, and the path with the deviated points, are stored to file at the end of the test.

p

Deviation

Tracked points Target path

Radius

Figure 3.6: Measuring the deviation from a circular path, by determining the distance to point p, which is the point on the circle with the same angle as the tracked point.

CHAPTER 3. IMPLEMENTATION 29 3.4.3.5 Path movement

This test is designed to verify correct operation of a longer sequence of RAPID instruc-tions, by comparing the tracked path to a predefined reference. The test prepares the robot by running a procedure that moves the robot to its starting point before starting the tracking. The timing between the tracker and the RAPID procedure is important, as the two are to be compared based on time stamp. When the tracker is started, the RAPID procedure is called immediately after.

The RAPID procedure for the path, have been run through a simulation in RobotStudio, where the simulated path has been recorded with a smart component that records the movement and stores to an xml file. This xml file is loaded into a path in the test, and with the ComparePath method of Path, the difference between the tracked and the simulated path are calculated.

Each point in the differenced path is checked for its length, which refers to the deviation at a given point. The allowed deviation is set to 10mm, where each point with too high deviation is reported as an error. The logged path, and the differenced path are stored to file.