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 - Enable- BOOL- Starts on a rising edge. If used with SMC_Interpolator, it is recommended to set - Enableto- ipo.bWorking AND ipo.iStatus <> IPO_INIT.- piIn- The input position. - Tangent- SMC_VECTOR3D- Tangent 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.- Normal- SMC_VECTOR3D- The 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.- RelativeOrientation- The 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.- OriConv- The orientation convention used for the - RelativeOrientationand the orientation in- piOut. A new value is only applied at a rising edge of- Enable.- Output - Error- BOOL- TRUEif an error has occurred- ErrorID- SMC_ERROR- The error identifier - piOut- The resulting position. Identical to - piIn, except for dA, dB, and dC.