CNC Pendant Programming
-
Hello,
I'm in the process of installing a CNC pendant on my custom clay printer following this guide:
https://docs.duet3d.com/User_manual/Connecting_hardware/IO_CNC_PendantMy main hope for using this pendant is to be able to dial in my flow rate while printing, there's a ton of variability with clay, so being able to just turn a knob will be much more helpful than the web interface or panel due.
The coding for it seems to be set up only for movement when nothing is running, I'm wondering how I might alter the output command for my extruder to do a +/-1% extrude factor override for each click of the wheel.
The current pendant firmware can be found here:
https://github.com/Duet3D/CNC-Pendant-FirmwareAny help would be so much appreciated, thanks!!!
-
@twcochran88 to adjust the extrusion factor you would need to send a M221 command. If it's extruder 0 that you want to adjust then you could send this to increase it by 1%:
M221 D0 S{move.extruders[0].factor*100+1}
To reduce it by 1% replace +1 by -1.
-
@twcochran88 Ideally, use the CRC16 branch, as this is needed for compatibility with RRF 3.5 and later. https://github.com/Duet3D/CNC-Pendant-Firmware/tree/crc16
I think this should be doable, using one of the extra axis switches ie 4/5/6 (depending on which pendant you have). The pendant firmware does expect to send relative Gcode moves to an axis, and that is defined in this section: https://github.com/Duet3D/CNC-Pendant-Firmware/blob/1f9a55bb83a05ada6fbb12f5e5d92db590802086/src/CNC-pendant.ino#L126
Currently, the pendant firmware doesn't ask the Duet for any information, so it doesn't know where any axis is, it just sends the relative axis movement. I think to use M221 it would need to read the current extrusion factor from the Duet firmware Object Model, then modify that and send it back to the Duet. This functionality currently doesn't exist in the Pendant firmware.
I don't see anywhere that the sent commands are limited by the state the machine is in, but it might be done by fixing the line number to 0 in https://github.com/Duet3D/CNC-Pendant-Firmware/blob/crc16/src/GCodeSerial.cpp, ie a Gcode with a line number of 0 would be ignored during a running job. I think it would need to be changed to send the M221 command without a line number.
Maybe @dc42 might offer more hints on what needs adding/changing?
EDIT: @dc42 beat me to it! His method means the pendant doesn't need to check what the current extrusion factor is. Though I think what I wrote is still relevant.
Ian
-
@dc42 Thank you so much! I'll hopefully be finished installing today and can test it out
-
@droftarts Much appreciated! Sounds like just the info I was in need of