omron — LEARN

PMAC Product Guide PMAC will reject this command if the motor is in a coordinate system that is currently running a motion program (reporting ERR001 if I6 is 1 or 3). The program must be stopped first, usually with an A command. However, the global command will kill all motors immediately, regardless of whether any are running motion programs. Examples: K ; Kill the addressed motor #1K ; Kill Motor 1 J/ ; Re-establish closed-loop control of Motor 1 LEARN Function : Learn present commanded position Scope : Coordinate-system specific Syntax :

LEARN[({axis}[,{axis}...]] LRN[({axis}[,{axis}...]] This command causes PMAC to add a line to the end of the open motion program buffer containing axis position commands equal to the current commanded positions for some or all of the motors defined in the addressed coordinate system. In this way PMAC can learn a sequence of points to be repeated by subsequent execution of the motion program. PMAC effectively performs a PMATCH function, reading motor commanded positions and inverting the axis definition equations to compute axis positions. If axis names are specified in the LEARN command, only position commands for those axes are used in the line added to the motion program.

If no axis names are specified in the learn command, position commands for all nine possible axis names are used in the line added to the motion program. The position command for an axis with no motor attached (phantom axis) will be zero. Note: If a motor is closed loop, the learned position will differ from the actual position by the amount of the position following error because commanded position is used. If a motor is open loop or killed, PMAC automatically sets motor commanded position equal to motor actual position, so the LEARN function can be used regardless of the state of the motor. Examples: &1 ; Address coordinate system 1 #1->10000X ; Define motor 1 in C.S.

1 #2->10000Y ; Define motor 2 in C.S. 1 OPEN PROG 1 CLEAR ; Prepare program buffer for entry F10 TA200 TS50 ; Enter required non-move commands {move motors to a position, e.g. #1 to 13450 ; commanded, #2 to 29317 commanded} LEARN(X,Y) ; Tell PMAC to learn these positions X1.345 Y2.9317 ; This is the line that PMAC adds to PROG 1 {move motors to new position, e.g. #1 to ; 16752 cmd., #2 to 34726 cmd} LEARN ; Tell PMAC to learn positions A0 B0 C0 U0 V0 W0 X1.6752 Y3.4726 Z0 ; PMAC adds positions for all axes to PROG 1 Online Commands 173