Interpolation Types for Profiles¶
The curves defined by an array of MC_PProfile hold master position points and according slave positions. When the master position is between 2 points, the according position for the slave is interpolated. Different types of interpolation are possible. The type is defined in MC_ABB_iTYPES_ENUM. The master could be a real axis or some virtual axis which could be created by just writing values for position and velocity to the Axis_master variable as shown in the example. The same interpolation types could be used on MC_TProfile.
Interpolation Types | Results in | Requires |
---|---|---|
MCA_LINEAR | Linear interpolation with constant velocity between interpolation points. | profile.MC_PProfile_Array[x].master_position, profile.MC_PProfile_Array[x].interpolation_point |
MCA_SPLINE_NATURAL | Cubic spline interpolation without jerk. | profile.MC_PProfile_Array[x].master_position, profile.MC_PProfile_Array[x].interpolation_point |
MCA_SPLINE_COMPLETE | Cubic spline interpolation without jerk, start and end of profile with velocity=0. | profile.MC_PProfile_Array[x].master_position, profile.MC_PProfile_Array[x].interpolation_point |
MCA_POLY3 | Polynomial interpolation with linear velocity between interpolation points. | profile.MC_PProfile_Array[x].master_position, profile.MC_PProfile_Array[x].interpolation_point, profile.MC_PProfile_Array[x].velocity_ratio |
MCA_POLY5 | Polynomial interpolation with linear acceleration between interpolation points. | profile.MC_PProfile_Array[x].master_position, profile.MC_PProfile_Array[x].interpolation_point, profile.MC_PProfile_Array[x].velocity_ratio, profile.MC_PProfile_Array[x].acceleration_ratio |
The interpolations allow to run on smooth curves without the need to define a large number of points. The following chapter shows the results with different interpolation modes for a sinus-curve with 10 interpolation points. The following table gives the mean deviation.
Interpolation Type | Mean deviation [ppm] |
---|---|
MCA_LINEAR | 19686 =1.9% |
MCA_SPLINE_NATURAL | 151=0.0151% |
MCA_SPLINE_COMPLETE | 25510=2.5% |
MCA_POLY3 | 131=0.0131% |
MCA_POLY5 | 0.37 |
The original curve is represented by y_sinus for position and v_sinus for velocity. The diagrams show the result which is achieved by different interpolation types.
MCA_LINEAR
Results from linear interpolation
The velocity is constant between the interpolation points.
MCA_POLY3
Results from polynomial interpolation
The result looks almost identical to the original curve. The mean deviation shows that MCA_POLY3, MCA_POLY5 and MCA_SPLINE_NATURAL produce results which follow the original curve really good and are almost identical. The spline interpolation produces a jerk-free curve without the need of providing velocity values and acceleration values in advance.
MCA_COMPLETE
Results from complete spline interpolation
In the beginning and the end, the curve does not follow the original curve. The reason is that it starts with velocity=0 and produces a jerk free result.
So the favoured result has to be considered in advance to choose the right interpolation method. With these different methods it is not necessary to provide a large number of interpolation points to get good results and smooth acceleration and deceleration ramps.