CPR                Position command is relative

Syntax                        

CPR

Command Position is Relative

Operands        

PlaceTMLOnline

 

Binary code

Description        After the execution of this instruction, all subsequent position commands will be considered as relative in the following motion modes: trapezoidal profiles, S-curve profiles, PVT and PT. This setting remains until the execution of a CPA command. In the trapezoidal profile mode, the position to reach can be computed in 2 ways: standard (default) or additive. In standard relative mode, the position to reach is computed by adding the position increment to the instantaneous position in the moment when the command is executed. In the additive relative mode, the position to reach is computed by adding the position increment to the previous position to reach, independently of the moment when the command was issued.

The additive relative mode is activated by setting ACR.11 = 1 and is automatically disabled after an update command UPD, which sets ACR.11 = 0 restoring the standard relative mode.

 

Example        

//Position profile

//Position feedback: 500 lines incremental

// encoder (2000 counts/rev)

CACC = 0.3183;//acceleration rate = 1000[rad/s^2]

CSPD = 16.6667;//slew speed = 500[rpm]

CPOS = 7000;//position command = 3.5[rot]

CPR; //position command is relative

MODE PP;

TUM1; //set Target Update Mode 1

UPD; //execute immediate

!MC; WAIT!; //wait for completion