SMC_OrientationBasedOnTangent (FB)ΒΆ
FUNCTION_BLOCK SMC_OrientationBasedOnTangent
This function block computes the tool orientation based on the path tangent.
The resulting orientation is written to the position piOut in
the members dA, dB, and dC, according to the chosen orientation
convention.
The orientation is computed as follows:
First, an intermediate coordinate system is computed, where the Z-axis is the given normal vector, and the X-axis points in the direction of the tangent, but projected to the working plane.
Second, the relative orientation is applied to this coordinate system, resulting in the final orientation.
This function block is intended to be used before the inverse kinematic transformation function block.
- InOut:
Scope
Name
Type
Comment
Input
EnableBOOLStarts on a rising edge. If used with SMC_Interpolator, it is recommended to set
Enabletoipo.bWorking AND ipo.iStatus <> IPO_INIT.piInThe input position.
TangentSMC_VECTOR3DTangent vector of the path. The output |ioSMC_Interpolator|``.vecActTangent`` can be connected. Note: if the component of the tangent that is orthogonal to the normal vector is 0 (or very close to 0), the orientation is not updated. If an orientation has been computed previously, then the last orientation is kept. If no orientation has been computed previously, the error
SMC_ORIENTATION_UNKNOWNis reported. This error is automatically cleared once called with a tangent that is not 0.NormalSMC_VECTOR3DThe normal vector. This is the direction orthogonal to the working plane. For a process that works in the X/Y plane, this will be the Z-Axis. A new value is only used at a rising edge of
Enable.RelativeOrientationThe relative orientation offset from the orientation given by the normal in z-direction and the tangent in x-direction. A new value is only used at a rising edge of
Enable.OriConvThe orientation convention used for the
RelativeOrientationand the orientation inpiOut. A new value is only applied at a rising edge ofEnable.Output
ErrorBOOLTRUEif an error has occurredErrorIDSMC_ERRORThe error identifier
piOutThe resulting position. Identical to
piIn, except for dA, dB, and dC.