FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
05-09-2024 12:36 PM
Hello,
we have an application where the customer will send a table with position values generated by an external software. The interval between each position of the table is 40ms and the table has around 32400 values. To be able to use the Ethercat cycle time, I´m dividing each 40ms by 20 and creating a linear interpolation between each interval. Attached some screen shots of the PLC program, the osciloscope and configuration. As can be seen, the curve is not smooth. Is there any better way to implement this control? The file eixo_1.txt contains the positions.
Solved! Go to Solution.
05-09-2024 05:28 PM - edited 05-09-2024 05:38 PM
To interpolate linearly between the points in the table you should change your code to
rSetPos[1]:= arPos_1[index] + subindex*(arPos_1[index+1]-arPos_1[index])/20.0;
This will change your command curve from this:
to this:
This will improve matters, but in all likelihood the system performance will still be poor. One approach might be to break up your list of points into subgroups of 1024 and use FlexProfile. In this case the "motion law" for each section of the path would be based on a Point Table. Because you are dealing with large data sets, you will have to define your trajectory "on-the-fly" - begin by defining a FlexProfile based on the first 1024 points in your table. While this is running define a second FlexProfile based on the second set of 1024 points in your table and so on.
Another approach that we have successfully implemented in the past is to interpolate using cubic splines. In this case the command curve would be defined as a set of cubic polynomials. For example:
Here the coefficients are chosen so that the velocity curve is everywhere differentiable. The math here is not exactly trivial, but there are good resources available. A Practical Guide to Splines by Carl de Boor is excellent.
05-10-2024 07:14 AM
Are you using linear movement commands or are you uing a cyclic position channel?
So I guess you are only using single axis movements? Otherwise to smoothen your movement you could also use the kinemtaic blending function polytrans.
05-10-2024 05:26 PM
After modifying the software as you suggested, I got much better result. Thank you so much.
05-10-2024 05:27 PM
I´m using cyclic position channel.