MC_VelocityProfile, MCP_VelocityProfile –  Velocity profile

Block SymbolsLicensing group: MOTION CONTROL
Qt SVG Document Exported by REXYGEN Studio uAxis Execute alg TimeScale VelocityScale Offset BufferMode uTimes uValues BeginAcceleration EndAcceleration yAxis Done CommandAborted Busy Active Error ErrorID MC_VelocityProfile Qt SVG Document Exported by REXYGEN Studio uAxis Execute yAxis Done CommandAborted Busy Active Error ErrorID MCP_VelocityProfile

Function Description

The MC_PositionProfile block commands a time-position locked motion profile. Block implements two possibilities for definition of time-velocity function:

1. sequence of values: the user defines a sequence of time-velocity pairs. In each time interval, the values of velocity are interpolated. Times sequence is in array times, position sequence is in array values. Time sequence must be increasing and must start with zero or zero must be between the first and last point. Execution always starts from zero time, so if the sequence start with negative time, part of the profile is not executed (could be used for debugging or time shift). For MC_VelocityProfile and MC_AccelerationProfile interpolation is linear, but for MC_PositionProfile, 3rd order polynomial is used in order to avoid steps in velocity.

2. spline: time sequence is the same as in previous case. Each interval is interpolated by 5th order polynomial p(x) = a5x5 + a4x4 + a3x3 + a2x2 + a1x + a0 where beginning of the time-interval is for x = 0, end of time-interval is for x = 1 and factors ai are put in array values in ascending order (e.g. array values contains 6 values for each interval). This method allows smaller number of intervals and there is special editor for synthesis of the interpolating spline function.

For both case, the time sequence could be equally spaced and then array times includes only the first (usually zero) and last point.

Note 1: input TimePosition is missing, because all path data are in parameters of the block.

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

Note 3: incorrect parameter cSeg (higher then real size of arrays times and/or values) leads to unpredictable result and in some cases crashes whole runtime execution (The problem is platform dependent and currently it is known only for SIMULINK - crash of whole MATLAB).

Note 4: in the spline mode, polynomial is always 5th order and always in position (also for sibling block MC_PositionProfile and MC_AccelerationProfile) and it couldn’t be changed. As the special editor exists, this is not important limitation.

Note 5: The block does not include ramp-in mode. If start position and/or velocity of profile is different from actual (commanded) position of axis, block fails with error -707 (step). It is recommended to use BufferMode=BlendingNext to eliminate the problem with start velocity.

Inputs

uAxis

Axis reference (only RM_Axis.axisRefuAxis or yAxisuAxis connections are allowed)

Reference

Execute

The block is activated on rising edge

Bool

TimeScale

Overall scale factor in time

Double (F64)

VelocityScale

Overall scale factor in value

Double (F64)

Offset

Overall profile offset in value

Double (F64)

BufferMode

Buffering mode

Long (I32)

1 ....

Aborting (start immediately)

2 ....

Buffered (start after finish of previous motion)

3 ....

Blending low (start after finishing the previous motion, previous motion finishes with the lowest velocity of both commands)

4 ....

Blending high (start after finishing the previous motion, previous motion finishes with the lowest velocity of both commands)

5 ....

Blending previous (start after finishing the previous motion, previous motion finishes with its final velocity)

6 ....

Blending next (start after finishing the previous motion, previous motion finishes with the starting velocity of the next block)

Outputs

yAxis

Axis reference (only RM_Axis.axisRefuAxis or yAxisuAxis connections are allowed)

Reference

Done

Algorithm finished

Bool

CommandAborted

Algorithm was aborted

Bool

Busy

Algorithm not finished yet

Bool

Active

The block is controlling the axis

Bool

Error

Error occurred

Bool

ErrorID

Result of the last operation

Error

i ....

REXYGEN general error

Parameters

alg

Algorithm for interpolation  2

Long (I32)

1 ....

Sequence of time/value pairs

2 ....

Sequence of equidistant values

3 ....

Spline

4 ....

Equidistant spline

nmax

Number of profile segments  3

Long (I32)

times

Times when segments are switched

Reference

values

Values or interpolating polynomial coefficients (a0, a1, a2, ...)

Reference

Example

image/svg+xmltimeScale 1.0 posScale 1.0 offset 0 mode 2 MC_VelocityProfile uAxisExecuteTimeScaleVelocityScaleOffsetBufferModeyAxisDoneCommandAbortedBusyActiveErrorErrorID Execute [execute] Axis [axis]

image/svg+xml0 0.5 1 1.5 2 2.5 3 0 0.5 1 Execute bool 0 0.5 1 1.5 2 2.5 3 0 0.5 1 Active bool 0 0.5 1 1.5 2 2.5 3 0 0.5 1 Done bool 0 0.5 1 1.5 2 2.5 3 −200 0 200 Commanded acceleration acceleration 0 0.5 1 1.5 2 2.5 3 −10 0 10 Commanded velocity velocity 0 0.5 1 1.5 2 2.5 3 0 0.5 1 Commanded positionTime [s] position

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