Robots in Architecture Forum

KUKA|prc - parametric robot control for Grasshopper => Support => Topic started by: kovarik on July 29, 2024, 10:51:45 AM

Title: Connection with the stepper
Post by: kovarik on July 29, 2024, 10:51:45 AM
Hello everyone,   

I am looking for a solution how to control extrusion auger via stepper motor in KUKAprc. 

I went through the forums and did not find any relevant answers to my problem, so I would like to ask you for help. 

I already run carthesian 3D printer controlled by Arduino and using gcode, generated by Grasshopper. Extrusion auger within the printhead is powered by stepper motor controlled by Arduino. In Gcode and Grasshopper the extrusion rate is set by E variable within range between 0,100 to 0,200. 

I want to use this printhead as the end effector of KUKA Quantec KR120, but I cannot solve how to link it in Grasshopper. I created the 3D model of printhead and used it as a Custom tool in KUKAprc and simulation works well, but I am not sure how to create the output for controlling the extrusion rate of stepper motor. 

If I use nod Digital Output, I can set external axis, but there is no possibility to set up the variable for controlling extrusion rate (E variable) like I did when generating Gcode in Grasshopper. Maybe it is possible via Analog Output and setting State between -1 and 1?

Maybe I can set up E variable by adding some code directly into the krl by nod KRL code but I dont know how the code should look like.

Should you have any ideas, I would be very thankful. 

Michal Kovářík
Title: Re: Connection with the stepper
Post by: Johannes @ Robots in Architecture on July 29, 2024, 11:40:01 AM
Hello Michal,

There are many ways as you have already outlined them. In our work, we added a simulated external axis to the robot, set the extrusion value as E1 and then had a program running on the robot that would send the current E1 value to the stepper. However, you need to ensure that the stepper can follow that fast enough as you are sending absolute position values. You could also get the current speed of E1 and send that to the stepper, which avoids some problems, but at the expense of accuracy.

With an analogue output you can theoretically encode like 16m positions (assuming 24bit) but you will have to cope with signal problems etc. Coupling digital outputs into a signal might be easier.
You could consider getting an EtherCAT Arduino shield, that way you don't need many cables.

And yes, you would probably set the parameters via a Custom KRL component. You'll need to make sure that the values are set in the advance run so that the robot doesn't stop whenever your values change.

Hope that helps you get started!
Best,
Johannes
Title: Re: Connection with the stepper
Post by: kovarik on July 31, 2024, 03:23:45 PM
Thank you Johannes. I will try to adapt your suggestions, hope it will work without any problems.
Best,
Michal