Please enable JavaScript to view this site.

Validity: RC3E v33.5.8-7 (or later)

This keyword allows a variable of type STRU_PHADJ2 (STRUCT_P) to be defined.

It is used by the mv_phase_adj2() motion function.

It consists of the following information:

Field

Type

Description

corrType

I32

Type of correction profile:

Comparison table of correction profiles taking the triangular profile as reference:

 

corrType

Vmax  

Amax  

Jerk max

0

Triangular

100

100

infinity in 3 points

1

Parabolic

75

150

infinity in 2 points

2

Sinusoidal

78.5

123.25

infinity in 2 points

3

Jerked

100

200

100

4

Raised cosine

100

157

123

5

Pentic

100

150

150

error

REAL

It is the deviation of the slave axis from the desired phase position (positive if you need to accelerate to reach the phase, negative if you need to slow down).

Once the function is working, a new correction is executed by changing the error value and also resetting the space traveled by the deltaMaster runtime (e.g., on the rising edge of an input)

masterCycle

REAL

It is the master axis space available to perform phase correction

velMinSlave

REAL

This is the lower limit of speed allowed for the movement of the slave axis. In case the correction formula requires going below the minimum speed, the value returned by the function would be velMinSlave.

In case of limitation, the phase error correction will result only partial, and the state variable will take the value M_SPEED_LIMITED.

In the case of a negative value it will be limited to 0

velMaxSlave

REAL

This is the upper speed limit allowed for slave axis movement. In case the correction formula requires going above the maximum speed, the value returned by the function would be equal to velMaxSlave.

In case of limitation, the phase error correction will result only partial, and the state variable will take value M_SPEED_LIMITED

accMaxSlave

REAL

This is the maximum acceleration value accepted for the slave axis.

If the limitation is triggered, the phase error correction will result only partial, and the state variable will take value M_ACCEL_LIMITED

vRef

REAL

This is the base speed of the slave axis, i.e., the speed to be held in the absence of corrections.

This parameter must be updated by the application software before each call to the function

deltaMaster

REAL

This is the elapsed master space since the start of the function call. The correction occurs in the range of deltaMaster between zero and masterCycle.

For deltaMaster values greater than masterCycle, the function returns the base speed vRef and return code M_SYNCHRONIZED

This parameter must be updated by the application software before each call to the function

vRefMaster

REAL

Master target speed (if not specified leave 0 or IV(master))

vSlave

REAL

Current slave speed

This parameter must be updated by the application software before each call to the function

si

REAL

Sampling interval

kTrap

REAL

Minor base/major base ratio trapezoid (possibly recalculated at start of correction and reset at end of correction)

camValue

REAL

Current correction cam value (read only). Varies between 0 and 1

hmtoggle_plus0Examples

Example declaration:

; definition of variable tape1 of type STRU_PHADJ

STRU_PHADJ2 tape1

Example of use in rule:

RULE R_AUTO_2

axes(AX_2)

 

MOTION

 if (first_time())

 myHook.corrType = 0 ; triangle

 myHook.masterCycle = rrPassoMaster ; master space available to retrieve error

 myHook.velMinSlave = 0 ; minimum slave axis speed during error recovery

 myHook.velMaxSlave = MAX_SPE(AX_2) ; maximum slave axis speed during error recovery

 myHook.accMaxSlave = MAX_ACC(AX_2) ;  maximum slave axis acceleration during recovery error

 myHook.si = SI

 myHook.error = 0

 mv_status = 0

 endif

 if(rise(inp(1))) ; little red ADV button

 myHook.vRefMaster = rrVelMaster ; master steady state speed (e.g. mv_ramp(master, rrVelMaster , rrAccMaster))

 myHook.error = slave_error

 mv_status = M_INITIALIZING

 posMasterInitial = IP(AX_1)

 endif 

 ;

 ; speed that the slave axis should hold in the absence of corrections

 ;

 myHook.vRef = iv(AX_1)

 ;

 ; current speed of the slave

 ;

 myHook.vSlave = iv(AX_2)

 ;

 ; space traveled by the master from the beginning of the correction

 ;

 myHook.deltaMaster = ip(AX_1) - posMasterInitial

 ;

 ; I move the axis

 ;

 iv(AX_2) = mv_phase_adj2(mv_status, myHook)

 

 if(rise(mv_status = M_SYNCHRONIZED))

 ; correction finished

 endif

 

END_MOTION

 

END_RULE

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC