So after some research.... and a quick look at the PrintEye code by @EasyTarget
https://forum.duet3d.com/post/110578
I think I have a plan based on the Json unpacking in PrintEye, to extract the following data:
extr: the positions of the extruders
efactor: the current extrusion factors (see M221 command), one value per extruder
Then sending a M221 to tune the extrusion factor after a user defined position delay based on filament path length between the sensor and the extruder melt zone.
The only kink is I'm not sure how to send a value to the Arduino to set the filament path length between the sensor and the extruder melt zone. I may have to hard code this to start with, or add a local display to set the value.
Does anyone know if I can add user defined elements to the json package sent to the Arduino as a response to M408? My thoughts are set a value for the filament path delta for each extruder with a user defined G/MCode (?) in the config.g.
I need to do some prototyping and merge it with Thomas Sanladerer's code and I possibly have a way forward!
https://www.printables.com/model/57154-infiDANK
https://www.youtube.com/watch?v=RYgdLPe_T0c
Multiple extruders needs a little thinking but I guess I could just connect multiple sensors to the one Arduino.
Also passthrough for the PanelDue, but I could use the code by @dc42 for the CNC pendant to sort that.
Will report back as and when I make progress! Another project to add to the list 🙂
Cheers
Barry M