Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

online-programming & connection between extruder (Duet-2-Board), RoboDK & KUKA KRC4

#1
Question
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.

我们取得了/做的:
  • manufactured all physical parts
  • created all CAD parts that we need for RoboDK Tools and Environment
  • 连接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:
//m.sinclairbody.com/doc/en/Robot-Machining.html#Print3D

At RunCode we added (like you suggested) this part:
Code:
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
return
else:
self.addline(code + "()")
else:
# Output program code
self.addline(code)

Your documentation then proceeds with:


We need to trigger a function call namednew_movewith each new linear movement instruction. We can add this call at the beggining of the MoveL command:
Code:
def MoveL(self, pose, joints, conf_RLF=None):
"""Add a linear movement"""
# Handle 3D printing Extruder integration
self.new_move(pose)
...
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://m.sinclairbody.com/doc/en/PythonAPI/postprocessor.html#post-processor-methods

I actually don't know, what exact code I can use here for
Code:
self.new_move(pose)

你能给我一些提示如何proc吗eed 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 withRoboDKis connected viaethernetto aswitch
  2. theDuet-2-Board(which is connected to the stepper motor of theextruder) is also connected viaethernetto theswitch
  3. theswitchis connected to theKRC4viaethernet
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: 192.168.3.101
  • RoboDK-PC-IP: 192.168.3.102
  • Duetboard/Extruder: 192.168.3.103
We also found this code-snippet, that might help us here, but we don't know how to integrate it correctly:
https://wiki.python.org/moin/TcpCommunication
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:
Code:
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'
else:
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)