BRAND.07 / E + F CONTROLLERS
The program language of Kawasaki's E and F series robot controllers.
AS runs on the E series controllers (E01, E02, E03, E70 and others) and the F series (F60, F01, F02, F03). Programs live in .PROGRAM name() ... .END blocks. Motion uses JMOVE / LMOVE / C1MOVE / C2MOVE to poses that are either transformation values (X, Y, Z, O, A, T) or precision points (joint angles, written with #). Outputs switch with SIGNAL n, where a negative number turns the output off; the program waits with SWAIT 1001 and TWAIT 0.5; and flow uses IF / WHILE / FOR blocks that all close with END, plus CALL name for subroutines.
Each program is a .PROGRAM name() block closed by .END, and one file can hold many of them. CALL name runs another program and comes back when it reaches .END or RETURN. A variable whose name starts with a dot (.count) is local to its program; a name without the dot is global and shared by every program on the controller. Comments start with a semicolon.
On a real cellGlobal names are shared with every program, including PC programs running in the background. Use local .names for scratch values so two programs cannot change each other's counters.
.PROGRAM main() JMOVE home CALL pick_one .END .PROGRAM pick_one() LMOVE pick SIGNAL 1 .END
JMOVE is joint interpolation: the quickest move, with a curved TCP (tool centre point) path. LMOVE moves the TCP in a straight line at the current SPEED. An arc takes two statements, C1MOVE to a via point and C2MOVE to the end point. LAPPRO pick, 50 goes to a point 50 mm from pick along the tool Z axis and LDEPART 50 backs out the same way, so one taught point serves the approach, the pick and the retreat. HOME returns to the home pose stored in the controller.
On a real cellTeach the pick point itself and let LAPPRO and LDEPART make the approach and the retreat. Three separately taught points are three points to re-teach when the fixture moves.
JMOVE home LAPPRO pick, 50 LMOVE pick LDEPART 50 C1MOVE arc_via C2MOVE arc_end
SPEED 50 is 50 % of maximum speed and SPEED 250 MM/S a TCP speed. With ALWAYS the value holds for every later move; without it, it applies to the next move only. ACCURACY 1 ALWAYS lets the robot head for the next point once it is within 1 mm of the target, while ACCURACY 100 starts rounding the corner 100 mm out. The monitor speed set on the teach pendant scales the program speed on top of all this.
On a real cellProve a new program at a low monitor speed, then raise it in steps while you watch the path near fixtures. Speeds you never saw at 10 % appear at 100 %.
SPEED 250 MM/S ALWAYS ACCURACY 1 ALWAYS LMOVE pick SPEED 20 MM/S LMOVE place
A transformation value such as pick holds X, Y, Z in mm and O, A, T in degrees, measured in the current BASE and TOOL frames. A precision point such as #home holds joint angles, so it always puts the arm in the same configuration whatever the frames are. POINT builds poses: POINT drop = SHIFT(pick BY 0, 200, 0) is pick moved 200 mm in Y. TOOL and BASE set the active tool and work frame from a TRANS(...) value or a stored variable.
On a real cellUse precision points for home, service and clear-of-fixture poses, where the arm configuration has to be the same every time. Use transformation values for work points, so they follow BASE when the fixture is relocated.
POINT drop = SHIFT(pick BY 0, 200, 0) TOOL TRANS(0, 0, 139, 0, 0, 0) JMOVE #home LMOVE drop
SIGNAL 1, -2 turns output 1 on and output 2 off: a positive number means on and a negative number off. External inputs are numbered from 1001 and internal signals from 2001, so SWAIT 1001 waits for input 1 and IF SIG(1001) THEN tests it. PULSE 3, 0.3 turns output 3 on for 0.3 s, and TWAIT 0.5 waits half a second. Integrators usually give signals names (gripper_closed = 1001) and write SWAIT gripper_closed.
On a real cellSWAIT 1 waits for output 1, not input 1. Inputs start at 1001, and a wait on the wrong number either passes at once or never passes.
SIGNAL 1, -2 TWAIT 0.5 SWAIT 1001 PULSE 3, 0.3
IF expr THEN ... ELSE ... END, WHILE expr DO ... END and FOR i = 1 TO 5 STEP 1 ... END all close with the same END keyword. GOTO retry jumps to a label written as retry: at the start of a line. Numbers are assigned directly, count = count + 1, with no keyword in front. TYPE prints text and values to the terminal.
On a real cellWith three kinds of block closing on the same word, an END in the wrong place moves code out of a loop without any error. Indent every block and check which END closes what.
count = 0 FOR i = 1 TO 5 count = count + 1 END TYPE "PARTS:", count
| Instruction | Category | Purpose | Example |
|---|---|---|---|
| JMOVE | Motion | Joint move to a pose. Fastest; the TCP path is not straight. | JMOVE pick |
| LMOVE | Motion | Linear move: the TCP travels in a straight line at the current SPEED. | LMOVE pick |
| C1MOVE | Motion | Circular move, first statement: the via point on the arc. | C1MOVE via |
| C2MOVE | Motion | Circular move, second statement: the end point of the arc. | C2MOVE arc_end |
| HOME | Motion | Joint move to the HOME position stored in the controller (HOME 2 for the second one). | HOME |
| JAPPRO | Motion | Joint move to a point offset from the target by a distance in mm along the tool Z axis. | JAPPRO pick, 100 |
| LAPPRO | Motion | Same as JAPPRO, in a straight line. | LAPPRO pick, 50 |
| JDEPART | Motion | Joint move away from the current pose by a distance in mm along the tool Z axis. | JDEPART 100 |
| LDEPART | Motion | Same as JDEPART, in a straight line. The usual way out of a fixture. | LDEPART 50 |
| DRIVE | Motion | Move one joint by an angle: joint number, degrees, speed in %. | DRIVE 6, 90, 50 |
| SPEED | Motion | Program speed: % of maximum, or a TCP speed with MM/S. ALWAYS keeps it for every later move; without ALWAYS it applies to the next move only. The pendant monitor speed scales it again. | SPEED 250 MM/S ALWAYS |
| ACCURACY | Motion | Distance in mm from the target at which the robot may start toward the next point. Small values stop close to the point; large values round the corner. | ACCURACY 1 ALWAYS |
| TOOL | Motion | Set the tool transformation (TCP offset from the flange). TOOL NULL clears it. | TOOL TRANS(0, 0, 139, 0, 0, 0) |
| BASE | Motion | Set the base transformation (work frame). BASE NULL returns to the robot base. | BASE base1 |
| SIGNAL | I/O | Switch outputs: a positive number turns it on, a negative number turns it off. | SIGNAL 1, -2 |
| PULSE | I/O | Turn an output on for a time in seconds, then off. | PULSE 3, 0.5 |
| RESET | I/O | Turn all external outputs off. | RESET |
| SIG | I/O | TRUE when every listed signal is on; a negative number tests for off. External inputs start at 1001. | IF SIG(1001) THEN |
| SWAIT | Wait | Hold the program until the listed signals are on (negative number: off). | SWAIT 1001, -1002 |
| TWAIT | Wait | Hold the program for a time in seconds. | TWAIT 0.5 |
| WAIT | Wait | Hold the program until a logical expression is true. | WAIT SIG(1001) OR count > 5 |
| IF | Flow | Block branch: IF expr THEN ... [ELSE ...] END. | IF SIG(1001) THEN |
| THEN | Flow | Ends the condition of an IF line. | IF count < 5 THEN |
| ELSE | Flow | Else branch inside an IF block. | ELSE |
| END | Flow | Closes IF, WHILE, FOR and CASE blocks. A program ends with .END instead. | END |
| WHILE | Flow | Loop while a condition is true: WHILE expr DO ... END. | WHILE count < 5 DO |
| FOR | Flow | Counted loop: FOR var = start TO stop [STEP n] ... END. | FOR i = 1 TO 5 |
| TO | Flow | Separates the start and stop values of a FOR loop. | FOR i = 1 TO 5 |
| STEP | Flow | Increment of a FOR loop (1 when omitted). | FOR i = 0 TO 10 STEP 2 |
| DO | Flow | Starts the body of a WHILE loop. | WHILE i < 5 DO |
| GOTO | Flow | Jump to a label. A label is a name followed by a colon at the start of a line. | GOTO retry |
| CALL | Program | Run another .PROGRAM as a subroutine, then come back. | CALL pick_one |
| RETURN | Program | Return from a subroutine before its .END. | RETURN |
| PAUSE | Flow | Stop the program; the operator can continue it. | PAUSE |
| HALT | Flow | Stop the program; it cannot be continued from this point. | HALT |
| = | Variable | Assign a real (numeric) variable. Names with a leading dot (.count) are local to the program. | count = count + 1 |
| DECOMPOSE | Variable | Split a pose into an array: X, Y, Z, O, A, T for a transformation, joint angles for a precision point. | DECOMPOSE c[0] = pick |
| POINT | Position | Assign a pose variable: POINT dest = expression. | POINT drop = SHIFT(pick BY 0, 200, 0) |
| SHIFT | Position | The pose moved by dx, dy, dz in mm. | SHIFT(pick BY 0, 100, 0) |
| TRANS | Position | Build a transformation from X, Y, Z (mm) and O, A, T (degrees). | TRANS(400, 0, 300, 0, 180, 0) |
| #name | Position | Precision point: a pose stored as joint angles. A name without # is a transformation (X, Y, Z, O, A, T). | JMOVE #home |
| HERE | Position | Record the current pose into a variable. | HERE p_now |
| .PROGRAM | Program | Start a program. A file holds one or more .PROGRAM blocks. | .PROGRAM main() |
| .END | Program | Close the .PROGRAM block. | .END |
| TYPE | System | Print text and values on the terminal or pendant. | TYPE "PARTS:", count |
| PROMPT | System | Ask the operator for a value. | PROMPT "QTY:", qty |
| ; | Misc | Comment to the end of the line. | ; pick up the part |
GOTO label is read but not executed. Use FOR or WHILE to see a loop repeat here.