Understanding G-code to KRL Conversion for Extruder Control

Started by federgarrido, February 27, 2025, 12:19:05 PM

Previous topic - Next topic

federgarrido

Hi all,

I'm looking for a guide or documentation on how G-code is converted to KRL. My goal is to control an extruder via PWM using an Arduino board. I assume that I need to generate a signal from the KRC5 controller, which the Arduino will read and convert accordingly.

Does anyone have experience with this or know of any useful resources? Any pointers would be greatly appreciated.

Thanks!

Johannes @ Robots in Architecture

Hello,

For KUKA|prc the G-code import component can turn the extrusion values into an ON/OFF value for a digital output, to an external axis, or to a variable. This is taken from the help text:
QuoteSets how the extrusion speed is output. Entering ""E1"", ""E2"" etc. will map the E value to an external axis. Entering ""D1"", ""D2"", etc. will map a Boolean on/off value to a digital output. Entering any other string will map the extrusion velocity (E value divided by toolpath segment length) to a variable, that needs to be create at the robot, e.g. as a global variable in $config.dat
So that is how you can get the data to the robot. How you get it to the Arduino is up to you. If it has to be PWM there are EtherCAT modules from Beckhoff, but they are 24V, so will fry your Arduino unless you get the voltage down. Easier would be an analog 4-20mA output, where there are several instructions online for reading such a signal with an Arduino. Unless it's built into your robot already, you'd also have to buy a Beckhoff module for it.
Very "clean" would be an EtherCAT shield like that: https://www.bausano.net/en/ethercat-arduino-2
In any case, all of that probably works, it mostly depends on where you feel most comfortable investing your time. I personally would take the EtherCAT shield but you will have to delve a bit deeper into WorkVisual for it to work.

Best,
Johannes

federgarrido


snewk

I am working on a script to import gcode from cura and output to my KR4. According to the gcode import for KukaPRC, if I enter a string for "extrusion mode" it should map the extrusion velocity to a variable. Unfortunately, this does not seem to be working. Is there a trick to get this to function?

My gcode file has extrusion values, but my kukaprc commands out of the gcode import show only lin moves.

Johannes @ Robots in Architecture

Hello,

Can you post (or send me) your file including the g-code? Generally g-code is a very wide term, so it might be a parsing problem.

Thanks,
Johannes

snewk


Johannes @ Robots in Architecture

Hello,
That was a bug, it will be fixed in the next release - thanks for pointing it out and sorry for the inconvenience!
I can send you the fixed release in advance, I just need your eMail address plus your affiliation (as the Import component is a member-only component). Please send me an email with that information (johannes@robotsinarchitecture.org).
Best,
Johannes