Adding a servo motor for retraction
-
Our printers extrude a paste material which is under pressure. We would like to actuate a servo motor to cut the flow when retraction occurs in a gcode file. We currently have it hooked up to 8 ) HEATER3 on the expansion pins. Is there a better place to plug this into the board? Are there and M commands that could help us with this issue? Is there something in the duet process that can sense retraction? What commands should we be using to pulse something and how can we change the pulse settings so we can tune the servo motor.
Simplify 3D has a place to custom enter retraction scripts so we could send a command to pulse the servo open/close, but this will be a trial and error process of tuning the servo for how strong the pulse needs to be.
-
M571 (see https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M571_Set_output_on_extrude) might help you.
-
We looked into the M571 command, but it was not working as we intend it to. Instead we used retraction script in simplified 3d and it will move the servo to the set closed position but wont open it back up. S80=open s0= closed in the script as shown in the picture. Are we missing something if so can you please give us more incite on how to use the M571 command or make the retraction script work properly.
-
It looks to me that in your M280 commands you are using the vertical bar character instead of uppercase letter i.
-
Thank you, We got it working it was a vertical bar and not an "i" but now we seem to be having an issue where it is opening back up before it crosses to the next object causing a tag of clay to trail across (stringing). It closes and then reopens before moving over to the next object, rather than staying closed during the movement to the next object.
-
This is a bit of a hack but it should work.
Set retraction parameters to a set value. Say 2mm retract and unretract.
Then use a post processing script REPLACE command to replace it with the servo commands you need. Match this command to your actual retract command output from S3D
{REPLACE "G1 E-2.0000 F1800" "M280 P3 S0 I1"}
{REPLACE "G1 E2.0000 F1800" "M280 P3 S80 I1"}Or if you need to wait for it to close you could do something like this:
{REPLACE "G1 E-2.000 F1800" "M280 P3 S0 I1 ; close servo\nG4 P500 ; wait for servo to close"}
{REPLACE "G1 E2.000 F1800" "M280 P3 S80 I1 ; open servo\nG4 P500 ; wait for servo to open"}the \n character will make a new line in case you need multiple lines like in the second examples.