CODESYS SoftMotion provides function blocks for the mathematical forward and inverse transformation for several popular kinematics.
For each kinematic design, two function blocks are available for the transformation. The POU named SMC_TRAFO_<Kinematik>
calculates the axis position from the position in space (inverse transformation). The POU named SMC_TRAFOF_<Kinematik>
calculates the position in space from the axis position (forward transformation).
You can link the instances of the forward transformation POUs to visualization templates in order to visualize the kinematics quick and easy.
Some of the inverse transformations also use path velocity and path direction to calculate the axis velocities. The names of these transformation POUs begin with SMC_TRAFOV_
instead of SMC_TRAFO_
. These POUs get the path tangent (v
) and path velocity (dVel
) as additional inputs from the interpolator. They also return the set velocities (dvx/dvy/dvz
) in addition to the set positions. The advantage is that the drag error in the drive can be minimized by input control of the velocity, provided the drive supports this method. To transfer the set velocities to the drive, you should use SMC_ControlAxisByPosVel
instead of SMC_ControlAxisByPos
in this case.
See also