Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
online-programming & connection between extruder (Duet-2-Board), RoboDK & KUKA KRC4
Hey to all forum members and dear RoboDK Team,

I am working on a 3D printing project to print with an extruder connected to a KUKA-Robot (KR-210 L-150-2 with a KRC4).

This thread got a little long, but please read it completely. It contains a lot of RoboDK code from your documentations, but I had to paste it in here, so that you know, what exactly I am talking about.

What we have achieved/done so far:
  • manufactured all physical parts
  • created all CAD parts that we need for RoboDK Tools and Environment
  • connected the extruder with a duet 2 board and all extruder electronics
  • made a succesfull connection between RoboDK and KRC4 (we are able to move the robot online)
Now I am working on the most important part of the project:
I need to synchronize the material-extrusion-speed/steps of the extruder (which is controlled via a Duet-2-Board) with the movement speed of the TCP.

That is why I first have to edit your kRC4-Post-processor like indicated on your documentation here:

At RunCode we added (like you suggested) this part:
   def RunCode(self, code, is_function_call = False):
       if is_function_call:
           if code.startswith("Extruder("):
               # Intercept the extruder command.
               # if the program call is Extruder(123.56)
               # we extract the number as a string
               # and convert it to a number
               self.NEW_E_LENGTH = float(code[9:-1])
               # Skip the program call generation
               self.addline(code + "()")
           # Output program code

Your documentation then proceeds with:

We need to trigger a function call named new_move with each new linear movement instruction. We can add this call at the beggining of the MoveL command:
def MoveL(self, pose, joints, conf_RLF=None):
   """Add a linear movement"""
   # Handle 3D printing Extruder integration
As I am not that much into Python yet, I am still trying to figure out all the different functions/ code-snippets that you defined.
I found some explanations here:

I actually don't know, what exact code I can use here for

Could you please give me some hints on how to proceed here and where to search for the right informations?

In order to be able to help here, you might also need some more detailed informations about our connections:
  1. Windows-Notebook with RoboDK is connected via ethernet to a switch
  2. the Duet-2-Board (which is connected to the stepper motor of the extruder) is also connected via ethernet to the switch
  3. the switch is connected to the KRC4 via ethernet
On your documentation you define an analog output from the KUKA-KRC4.
In our case we neither use an analog, nor a digital output of the KRC4, but we want to use the ethernet-cable connection (TCP communication) of the Duetboard to both RoboDK AND the KRC4 by using a third static IP.
For instance:
  • KUKA-IP:
  • RoboDK-PC-IP:
  • Duetboard/Extruder:
We also found this code-snippet, that might help us here, but we don't know how to integrate it correctly:
All we need to propper sychronize the extruder-steps with the Kuka-speed as a string with the E-Value, which can go directly to the duet-board to control the stepper motor.
This means the E-Value of the G-Code actually doesn't have to be converted to Kuka-code, but maybe it might still be necessary for a good synchronization, what do you think?

Would you and if yes, how would you define this connection properly in the KRC4-post-processor?

My question also is: Do we have to define it in the post processor or somewhere else in RoboDK, as the extruder could also be controlled via RoboDK directly. But it shell use the actual position and/or speed of the robot for highest accuracy.
  • advantage of sending it directly from RoboDK to the Extruder: no memory limit on the Kuka
  • advantage of running it on the Kuka itself: might be better synchronized/ less time-delayed.

In the post processor there is a part with the connections:
   def setDO(self, io_var, io_value):
       """Set a Digital Output"""
       if type(io_var) != str:  # set default variable name if io_var is a number
           io_var = '$OUT[%s]' % str(io_var)        
       if type(io_value) != str: # set default variable value if io_value is a number            
           if io_value > 0:
               io_value = 'TRUE'
               io_value = 'FALSE'
       # at this point, io_var and io_value must be string values
       self.addline('%s=%s' % (io_var, io_value))
Here we probably have to define a TCP-connection, but we don't know how.
It would a great help, if you could provide us some informations about how and where to update the code in RoboDK!

Thank you very much in advance.
Merry Christmas and a happy new year by the way!

Users browsing this thread:
1 Guest(s)