cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

Write Position Command from table

Write Position Command from table

rlilla
Established Member

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.

4 REPLIES 4

bostroemc
Occasional Contributor

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:2024-05-09_09h38_04.png

to this:

2024-05-09_09h44_30.png

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:

2024-05-09_10h09_14.png

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.

CodeShepherd
Community Moderator
Community Moderator

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.

rlilla
Established Member

After modifying the software as you suggested, I got much better result. Thank you so much.

rlilla
Established Member

I´m using cyclic position channel.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist