Get the current toolhead position/coordinates
 
Notifications
Clear all

Get the current toolhead position/coordinates  

  RSS
Akkadien46
(@akkadien46)
Member
Get the current toolhead position/coordinates

Hello everyone,

I would like to know if there is a way to retrieve, in real time, the current toolhead position/coordinates (XYZ).

Let me explain my project:

I want to print using a robot arm, with a print head mounted as a tool on the robot. Instead of developing custom electronics and software, I would like to use a PRUSA printer (Mini or another model) to take advantage of its existing components (print head, controller, heated bed), except for the 3 stepper motors (since the robot arm will handle the movements).

To keep things simple, I don't want to change the controller — I only need to get the live XYZ coordinates (ideally via Ethernet) in order to move the robot arm. I can leave the original stepper motors connected to “trick” the PRUSA controller.

Is there a simple way to access these coordinates, or do I need to modify the PRUSA firmware myself?

Thanks, and have a great day!

PS : a example of the type of machine I want to do :

Posted : 18/08/2025 6:17 am
Diem
 Diem
(@diem)
Illustrious Member

It would probably be simpler to cannibalise just the heated bed and use the/a gcode file to drive the robot arm - read gcode as text to see the move geometries.

Cheerio,

Posted : 18/08/2025 10:34 pm
Akkadien46
(@akkadien46)
Member
Topic starter answered:
RE: Get the current toolhead position/coordinates

Thanks for your idea.

I was thinking of keeping not only the heatbed, but also the complete print head (extruder + hotend), and using the robot as the master that read the G-code. My main issue with this setup is: how to synchronise the robot and the print head? The robot has some digital I/O, but it can’t directly drive the extruder stepper motor, the hotend heater, nor the heated bed. That’s why I also want to keep the Prusa control board.

I’ve been looking for another interface between the robot and the print head/bed, but I haven’t found any off-the-shelf solutions.

I actually found something on diy-life.com about a board that is close to what I need, but I’d prefer not to go too deep into electronics or solder my own board and components.

Does anyone know of a ready-to-use component/board that can interface a printer head with digital/analog I/O or a fieldbus (Ethernet, RS232, I2C, …)?

Is there a way to use the Prusa board for this?

Thanks and have a good day!

Posted : 19/08/2025 6:20 am
TeamD3dp
(@teamd3dp)
Estimable Member
RE: Get the current toolhead position/coordinates

This kind of project is way outside my knowledge, so I could be wrong here...but my understanding is that Prusa's control board is designed with the minimum capacity to get the job done.  I would think you'd be better off going with something that has more processing overhead.  I don't know what that would be though.  I've seen it mentioned here in a few places that the Mk4S/core one controller is a bit under powered, leaving little room for any additional processing.  It might be worth considering before starting down this path.

-J

Posted : 19/08/2025 12:58 pm
Diem
 Diem
(@diem)
Illustrious Member

Doing robotic design without actually doing the robotics part - tricky.  The Prusa boards have been optimised to their tasks so reconfiguring might be a challenge.

For the controller, whilst an Arduino would probably be capable, these days a Raspberry Pico would be a better and possibly cheaper choice.  It has loads of IO options so interfacing with the robot should be easy and it can do all the logical control but you will need to step the logic up to power the external components.

There are plenty of small boards around intended to pulse drive two conventional motors or one stepper, some are sold for school electronic projects and will plug connect to a pico.  A second board, one intended for larger motors, might be enough to source PWM to control the heaters..

Take a look around Pimoroni's website for ideas.

Cheerio,

Posted : 19/08/2025 3:02 pm
_KaszpiR_
(@_kaszpir_)
Noble Member
RE: Get the current toolhead position/coordinates

It's probably easier to add a plugin to octoprint to report coordinates, unless someone did it already.

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 20/08/2025 3:26 pm
Akkadien46
(@akkadien46)
Member
Topic starter answered:
RE: Get the current toolhead position/coordinates

Thanks everyone for your answers.

I understand that getting the head coordinates live is not straightforward, and I probably need to use another control board.

I’m not sure about Octopus — there will probably be some lag between the coordinates from the Prusa board and the coordinates I receive on the robot via Octopus — but I’ll keep this option in mind.

So I understand that I’ll need to move to another board, keeping only the heated bed and the print head, and leaving the Prusa board aside for now.

I’ll  dig into the idea of using an Arduino or a Raspberry Pi Pico with an additional board/hat.

 

 

Posted : 21/08/2025 6:05 am
_KaszpiR_
(@_kaszpir_)
Noble Member
RE:

You could also try https://github.com/prusa3d/Prusa-Firmware-Buddy/blob/master/doc/metrics.md but that will introduce lag as well, but at least could be used as the guideline where to hack to expose the data to the outside, such as ipos_x and pos_x https://github.com/prusa3d/Prusa-Firmware-Buddy/blob/818d812f954802903ea0ff39bf44376fb0b35dd2/src/common/app_metrics.cpp#L271

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 21/08/2025 8:51 am
Akkadien46
(@akkadien46)
Member
Topic starter answered:
RE: Get the current toolhead position/coordinates

Thanks KaszpiR, this looks very much like what I want to do!

And if I understand the GitHub project correctly, the position metrics are already defined in app_metrics.cpp.

So I just need to run M331 pos_x and M334 [IP address] [metrics port] [log port] to retrieve them.

That’s how I understand the code — I’ll give it a try.

Posted : 21/08/2025 2:26 pm
Share: