Hello,
I seem to have stumbled upon an issue with krl coding requiring a broader knowledge than mine.
I'm in the process of developing 3D printing technology, since quality is what I'm after the density of points in tool path is very high. Problems with file size quickly arose and Kuka PRC function "Reduce Filesize - Skip Redundant Position" was invaluable.
However, as I went further it became necessary to run a certain subprogram before each movement (g1.src) to check the robot velocity with $VEL_ACT and calculate the speed of extrusion. It's because our extruder uses servo motor rather than a stepper motor and needs to synchronize with robot slowing down on detailed tool path - a command is sent via EthernetIP with correct rotation speed, hence slimak=(...).
The appearance of any command woven between motion positions seems to prevent Kuka PRC from optimizing the code and redundant positions (such as external axis) are no longer removed: see "example_with_intersecting_functions" compared to "example_without_intersecting_functions(optimized)"
Solution that I'm after consists of two elements:
- Possibility to retain skipping of redundant positions even with interwoven functions
- A better solution to the robot-servomotor synchronization
I had some ideas that with Your help might prove valid:
- Load all the movement points (although there could be as much as 100 000) into an array and execute them one by one with a WHILE function
- Run a function in background (is it possible?) which at fixed time intervals would send a proper extruder speed based on current robot velocity
- Set another global variable which is being transmitted every 1 second to extruder
- Using submit interpreter
One thing I should mention is that the robot movements need to be stutter free. For instance, from what I have gathered a conditional function could cause interrupts in advance run.
I'm most grateful for any guidance in the matter.
Best regards,
Michael.