### MCP_CamTableSelect – Cam definition

Block SymbolLicensing group: MOTION CONTROL

Function Description

The MCP_CamTableSelect block defines a cam profile. The definition is similar to MC_PositionProfile block, but the time axis is replaced by master position axis. There are also two possible ways for cam profile definition:

1. sequence of values: given sequence of master-slave position pairs. In each master position interval, value of slave position is interpolated by 3rd-order polynomial (simple linear interpolation would lead to steps in velocity at interval border). Master position sequence is in array/parameter mvalues, slave position sequence is in array/parameter svalues. Master position sequence must be increasing.

2. spline: master position sequence is the same as in previous case. Each interval is interpolated by 5th-order polynomial $p\left(x\right)={a}_{5}{x}^{5}+{a}_{4}{x}^{4}+{a}_{3}{x}^{3}+{a}_{2}{x}^{2}+{a}_{1}x+{a}_{0}$ where beginning of time-interval is defined for $x=0$, end of time-interval holds for $x=1$ and factors ${a}_{i}$ are put in array/parameter svalues in ascending order (e.g. array/parameter svalues contain 6 values for each interval). This method allows to reduce the number of intervals and there is special graphical editor available for interpolating curve synthesis.

For both cases the master position sequence can be equidistantly spaced in time and then the time array includes only first and last point.

Note 1: input CamTable which is defined in PLCOpen specification is missing, because all path data are set in the parameters of the block.

Note 2: parameter svalues must be set as a vector in all cases, e.g. text string must not include a semicolon.

Note 3: incorrect parameter value cSeg (higher then real size of arrays times and/or values) can lead to unpredictable results and in some cases to crash of the whole runtime execution (The problem is platform dependent and currently it is observed only for SIMULINK version).

Inputs

 uMaster Master axis reference Reference uSlave Slave axis reference Reference Execute The block is activated on rising edge Bool

Outputs

 yMaster Master axis reference Reference ySlave Slave axis reference Reference Done Algorithm finished Bool Busy Algorithm not finished yet Bool Error Error occurred Bool ErrorID Result of the last operation Error i .... REXYGEN general error CamTableID Cam table reference (connect to MC_CamIn.CamTableID) Reference

Parameters

 alg Algorithm for interpolation  $\odot$2 Long (I32) 1 .... Sequence of time/value pairs 2 .... Sequence of equidistant values 3 .... Spline 4 .... Equidistant spline cSeg Number of profile segments  $\odot$3 Long (I32) Periodic Indicate periodic cam profile  $\odot$on Bool camname Filename of special editor data file (filename is generated by system if parameter is empty) String mvalues Master positions where segments are switched  $\odot$[0 30] Double (F64) svalues Slave positions or interpolating polynomial coefficients (a0, a1, a2, ...)  $\odot$[0 100 100 0] Double (F64)

2020 © REX Controls s.r.o., www.rexygen.com