Accessing mesh compensation values
-
Hello all,
I have an XY pen plotter powered by a Duet 3 Mini 5+ (running 3.5.2). X and Y are stepper axes, a voice coil moves the pen up and down about 6mm. The pen has its own motion controller and is not a registered motion axis on the Duet at the moment. Duet IO signals the external controller to run various subroutines that move the pen up and down.
I recently got a SZP that I currently have attached to the bottom of the "pen carriage" (3D printed structure), and what I'd like to be able to do is build a mesh of the aluminum build plate and be able to use the recorded values to compensate the motion of the pen when it moves down.
Here's the difference in what I'm trying to do, versus the more traditional use for 3D printers. The pen does have a linear encoder that allows it's motion controller to know when it's up or down. However, the way that voice coils tend to operate is their force is directly proportional to the current that passes through their coils (and to some extent, how far they're extended).
In my application, I need as close to a constant force from the pen on the build plate as possible, so instead of driving the pen to some Z position, I apply a constant current to the coil that moves it.
This has worked pretty well in practice, though the value gets a little skewed in places where the build plate isn't perfectly flat. And that's where I think the SZP could help.
Here's my main question (after a lot of rambling): Is there a way to access the mesh compensation values manually during a print? Is there a way to get, for instance, a corrected Z value without having to read the .csv file for the value each time? Is this map loaded into ram when a print starts?
TL,DR: What I'm thinking is along these lines: I have a mesh compensated Z axis that I can use when the pen needs to go down at some X Y location. Maybe the Z will differ from '0' by some amount, and I will take that difference and apply it to the amount of current flowing through the coil. I just don't know where to get the corrected Z from.
Does this mostly make sense? Any advice would be welcome.
-
@usinjin The 'easy' way to do this would be have the Z compensation reported in the Object Model, and use that. However, this isn't currently reported in the Object Model. I asked @dc42, who replied:
We could consider it for 3.6. Easiest would be to report the last computed height correction, which would be the correction at the endpoint of the current segment.
Would that suit your purpose? You could enable segmentation (see M669) would also allow the compensation to be updated more frequently on long, straight moves.
If so, please raise a feature request/enhancement on the firmware Github repository: https://github.com/Duet3D/RepRapFirmware/issues
Otherwise, you're going to need something that can read the XY position, and be able to compute the Z offset (ie have the mesh .csv file), and feed that to the pen motion control, in a timely manner. Something like that might be better done by a Raspberry Pi in SBC mode.
Ian