Welcome! Log In Create A New Profile

Advanced

Logging position data during print

Posted by WongD 
Logging position data during print
August 12, 2020 07:26AM
Hi,

I currently have a Prusa i3 MK3s and I am trying to log the position of the extruder over time during prints. Ideally, I am looking to poll the printer at a frequency of around 50Hz or higher using M114 commands of equivalent.

Using MATLAB, I have managed to connect to the printer via serial and ran a M114 loop but the printer does not respond consistently, often delaying the response until after the current move has completed. Is there any way to overcome this?

Ideally, I want to see a smooth profile of the position for the move to be able to map out the acceleration curves etc.

Thanks!
Re: Logging position data during print
August 12, 2020 09:36AM
I tend to be a bit 'old school' when faced with problems like this. Logging the step and direction inputs to the stepper motor driver(s) with a logic analyzer will get pretty close to giving you a true picture of the position. I have used a 'Saleae' logic analyzer for this purpose on X, Y, and Z motors simultaneously. Genuine Saleae analyzers are about £400 although clones are available at about £40 - I don't know how good they are.

It sounds like you are looking at the extruder alone - in which case the above approach should be good enough. For X, Y, and Z position there are a lot of dynamic effects which mean that the commanded position, i.e., that calculated form step and direction signals, can be quite far from the real position. In this case, an approach based on encoders independent of the stepper motors would work well.

Mike
Re: Logging position data during print
August 12, 2020 09:37AM
If the machine isn't skipping any steps, you should be able to calculate all the speed and position info from the gcode file and the acceleration and jerk settings in the config file of the controller board. You can tell if there are any steps being skipped by the print quality- skipped steps translates into layer shifting. If the acceleration, speed, and jerk are set within the limits of the motors and mechanism, there won't be any skipped steps.


Ultra MegaMax Dominator 3D printer: [drmrehorst.blogspot.com]
Sorry, only registered users may post in this forum.

Click here to login