How to add 3d printer (arduino/marlin) to my robot using ROS?

asked 2020-03-03 09:55:13 -0500

tom94 gravatar image


I'm building a 6-axis 3d printer. 6-axis robot is ROSified and it is Staubli TX40 with CS8 controller.

At this moment, my task is to make printerhead work with 6-axis robot using ROS. Printer specs are:

Arduino MEGA 2560 with RAMPS 1.4 shield, running marlin 1.1.x. At the RAMPS 1.4 shield is plugged step motor (EXTRUDER 0), DRV8825 Stepper Motor Driver Carrier, and heater to (THERMISTORS). There is also S-360-12 Power Supply.

I'm using Ubuntu 18.04 and ROS melodic.

Printer part has been taken from other similar robot, which was fully working, but not using ROS. Staubli robot is connected to the laptop with RS232 cable, and i'm planning to connect Arduino to my laptop using USB.

So my question is, how can i do that and what are the options?

My vision is, that i'm not touching Arduino's hardware and software, keeping Marlin inside. Computer is working as a master, and i have to create a node(?) to communicate with printer and send the G-code. Printer is reading G(?) E and F data from the G-code and print using this information. So, basically i have to create communication work between the computer and Arduino/RAMPS using ROS? Am i thinking in right direction?

Correct me if i'm wrong or if you know better solution, and can someone give me a tips in what direction i should move/how i can do it? I'm not so long in ROS.

Maybe someone allready did that, and there is a similar project somewhere, which i didn't find?

Thank you in advance for help!

Also i tried to send G-code to printerhead (Arduino/Marlin) using Pronterface, and it started printing, so it works and is configured. (NOT with ROS)

edit retag flag offensive close merge delete


why not ? write a subscriber node, maybe in python, read topic (string or cmd_vel) and send received/translated values as g-code to serial/usb port. After this you can control your printer with a simple teleop_joystick or teleop_keyboard node :-) Good luck!

ChriMo gravatar image ChriMo  ( 2020-03-03 16:58:39 -0500 )edit

Thanks for replying! Ok, that makes sence. Do you mean by sending data - publisher? I will try to do ROS subscriber/publisher tutorial again and maybe i will understand better how to do it in my case. This is new thing to me, so all help would be appreciated!

tom94 gravatar image tom94  ( 2020-03-05 02:13:04 -0500 )edit

Hi, I am working in the same thing, could I contact you somehow if it doesn't bother you, I have experience with ROS but no too much with gcode and marlin. Maybe we could work together, my mail is

EdisonAltamirano gravatar image EdisonAltamirano  ( 2020-03-08 20:27:27 -0500 )edit

Yea sure, i'll send you an email!

tom94 gravatar image tom94  ( 2020-03-09 03:12:20 -0500 )edit