Polling the position of the printer
-
Re: Polling Position of Printer
Hi all,
We are trying to integrate a laser scanner into the 3D print process at work and we need a "real-time" way to understand the exact position of the gantry during a linear move to poll the scanner and position of the axes (1000x or more during a 100mm move) to get a high resolution scan. Is there currently a way to poll a Duet board to get this position data and synchronize it with a laser scanner?
-
@garth_42
AFAIK, you can't poll the Duet 1000 times a second ( assuming 100mm/s speed) . IIRC, regular polling speed is 4 times/sec and the data you receive always lags behind.
Maybe it's possible in combination with closed loop steppers, if you were able to read their encoder signals? But you'd also have to get ahead of the actual position to get rid of latency. (knowing, where it will be in the next 0.1sec)
That takes a lot of math, given the acceleration/deceleration or jerk phases of a move. "Real time" data sometimes isn't enough. -
@garth_42 one way would be to feed the stepper driver step pulses to an external counter.
Another would be to put a linear encoder on the axis, for example https://www.renishaw.com/en/linear-incremental-encoders--11156 or https://www.renishaw.com/en/linear-absolute-encoders--10940.
Alternatively, if you know what movement speed, jerk and acceleration are being used then you can use dead reckoning to work out the position at a given time after the start of a move. Using Duet 3 you can get this information over CAN bus. For example, you could use a SAMMYC21 to do the calculation and configure RRF to have additional virtual drivers on it for the axes that you want to track.
-
@dc42 Thank you both for the responses. As to using the Sammy, if I understand you correctly, we would:
- get the accel, jerk, and feedrate settings of the printer, latest position of the printer, and next movement position in the queue
- do the calculations on the Sammy board in real time and update the virtual drives controlled by the Sammy to those positions as the move is happening
- poll the Sammy at the desired frequency to get the virtual drive positions
Is this correct?
-
@garth_42 said in Polling the position of the printer:
poll the Sammy at the desired frequency to get the virtual drive positions
If I understood David correctly, the Sammy should send the trigger impuls for the laser scanner ahead of the desired position. (latency of the scanner trigger input?)
Polling the Sammy would bring you behind real-life position again. -
@o_lampe Ah I see, that is quite clever. Thank you for the clarification.
-