Using Slic3r with t...
 
Notifications
Clear all

Using Slic3r with the Retractable Purge Mechanism

Page 3 / 5

BigBrain3D
(@bigbrain3d)
Supreme moderator Admin
Joined: 2 years ago
Posts: 344
Topic starter  

@vintagepc64

I'm going to try this out now. Thanks!!


ReplyQuote
Raymond
(@gysnst2)
Active Member Customer
Joined: 2 years ago
Posts: 6
 

@bigbrain3d

which code am i supposed to use for a stock mk3s mmu2 unit. The confusion is the way the your gcode is written.  if it could be written to match the Prusa slicer Gcode section that would make things so much easier for the not so smart gcode people. 

start gcode

end gcode

before layer change

after layer change

tool change gcode

between objects gcode

 


ReplyQuote
BigBrain3D
(@bigbrain3d)
Supreme moderator Admin
Joined: 2 years ago
Posts: 344
Topic starter  

Hi @gysnst2

You only need to turn off the tower and copy the below script to your 'Tool change g-code' . You also need to update the lines with the comment ";extend purge arm"  with the value you found for your purge mechanism deployment during location testing.

Here is the video showing where to put the code.

Here the gcode:

"
{if current_extruder != next_extruder}
;***Begin pre-tool change gcode**
M907 X450 ;set current of X motor. May need to set Y as well if your printers head moves on x & y. Should be between 450 and 850

M106 S0 ;turn off fan
G92 E0 ;reset extrusion distance
G1 E-0.8 F2100 ;retract
G1 Y100 F12000 ;Break string before Z lift
G1 X200 F12000 ;move head into position

G91;Change to relative position
{if layer_z < 15.0}

G1 Z15

{endif}
G90;Change to absolute position

G4 S0 ;clear movement buffer
G1 X250 F12000 ;move head to purge zone
G1 X254.6 F1000 ;extend purge arm
;***End pre-tool change gcode**

M702 ;unload filament (Remove if doing Vintagepc tip shaping)
T{next_extruder} ;this code -> T{next_extruder} signifies the extruder tool change

;***Begin after tool change purge gcode**
G1 X200 F12000 ;move head into position
G4 S0 ;clear movement buffer
G1 X250 F12000 ;move head to purge zone
G1 X254.6 F1000 ;extend purge arm
M107 ;turn off fan
G92 E0 ;reset extrusion position
G1 E0.8 F2100 ;issue after retract
G92 E0 ;reset extrusion position
G1 E40 F200 ;1st purge extrude onto thumb tack
M106 S255 ;turn on fan
G4 S12 ;blob cooling
G92 E0 ;reset extrusion position
G1 E-0.8 F2100 ;retract extruder to prevent oozing
G1 X240 F12000 ;whack blob off tack 1
G1 X254.6 F3000 ;reset for another blob whack
G1 X240 F12000 ;whack blob off tack 2

;add additional purge blobs as needed by copying the block above. You need 1 block for each blob.

M907 X300 ;set the current back to normal which is 300ma according to Prusa
;G1 Z[layer_z] ;return to the current print height. Uncomment this ONLY if your retraction Z lift is set to zero(0)
;***End after tool Change Purge gcode**
{endif}
"


ReplyQuote
BigBrain3D
(@bigbrain3d)
Supreme moderator Admin
Joined: 2 years ago
Posts: 344
Topic starter  

Hi @vintagepc64,

I think I got closer. This time I did these:

  1. inserted the exact line "BUCKET_X 256.65" into the start gcode section in PrusaSlicer
  2. sliced model
  3. exported the gcode file "frog.gcode" to the same directory as python
  4. downloaded newest "tower2RPM.py" script to the same directory as python
  5. opened a standard windows command prompt
  6. ran this exact command "python tower2RPM.py frog.gcode > frog2.gcode"
  7. got the different attached error 'invalid syntax' for line 7 which is the first line in the script.

Thoughts?


ReplyQuote
vintagepc
(@vintagepc64)
Moderator Moderator
Joined: 2 years ago
Posts: 42
 

@bigbrain3d - I think you downloaded the HTML version of the page by accident (the "<DOCTYPE" thing). This can happen if you do a right-click->save as... on github, you have to click through the file name to the file's page,  and then hit 'raw' to get the original content.

Here's a direct link to the raw content, use save as... on this page instead.:

https://raw.githubusercontent.com/vintagepc/RPM-Post/master/tower2RPM.py

 


ReplyQuote
BigBrain3D
(@bigbrain3d)
Supreme moderator Admin
Joined: 2 years ago
Posts: 344
Topic starter  

@vintagepc64

I followed your instructions. The script ran without errors.

However, checking the gcode reveals that the 'BUCKET_X 256.65' statement was not honored. It's still using X253. Any ideas?

; ------------------------
; BUCKET TOOL CHANGE START
M220 B
M220 S100
G1 X243.000 Z40.0 F10000
G1 X253.000 F1000
M107
G1 E0.2816 F68 ; 2.7097 mm^3/sec for 0.25 sec
G1 E0.3051 F73 ; 2.9355 mm^3/sec for 0.25 sec
G1 E0.3453 F83 ; 3.3226 mm^3/sec for 0.25 sec
G1 E0.3990 F96 ; 3.8387 mm^3/sec for 0.25 sec
G1 E0.4761 F114 ; 4.5807 mm^3/sec for 0.25 sec
G1 E0.5767 F138 ; 5.5484 mm^3/sec for 0.25 sec
G1 E0.6773 F163 ; 6.5161 mm^3/sec for 0.25 sec
G1 E0.7644 F183 ; 7.3548 mm^3/sec for 0.25 sec
G1 E0.8248 F198 ; 7.9355 mm^3/sec for 0.25 sec
G1 E0.8483 F204 ; 8.1613 mm^3/sec for 0.25 sec
G1 E-15.000 F6000.0
G1 E-14.0000 F1200.0
G1 E-4.0000 F600.0
G1 E-2.0000 F360.0
; Cooling: 3.0 to 2.0 mm/s in 1 moves
G1 E10.000 F180.0
G1 E-10.000 F120.0
G1 E-50.0000 F2000
G4 S0
T4; RPM FROM 3
G4 S0
G1 E14.4000 F1140
G1 E50.4000 F840
G1 E7.2000 F84
G4 S0; sync
; Purge generate for 58.21 mm (140.00mm^3) at F 0
; Purge cycle 1 of 2
G1 E40 F0.0
M106
G4 S12
G1 X243.0 F12000
G1 X253.0 F3000
G1 X243.0 F10000
G1 X253.0 F3000
G4 S0; sync
; Purge cycle 2 of 2
G1 E40 F0.0
M106
G4 S12
G1 X243.0 F12000
G1 X253.0 F3000
G1 X243.0 F10000
G4 S0; sync
G1 E-3.0000 F2100.0000; TC retract
M220 R
G1 F6000
G4 S0
G92 E0
; BUCKET TOOL CHANGE END
; ----------------------


ReplyQuote
vintagepc
(@vintagepc64)
Moderator Moderator
Joined: 2 years ago
Posts: 42
 

@bigbrain3d hmm... 253 is the default value, which suggests the code isn't finding the "; bucket x" line in your start gcode. Maybe post a screenshot of your start gcode?


ReplyQuote
BigBrain3D
(@bigbrain3d)
Supreme moderator Admin
Joined: 2 years ago
Posts: 344
Topic starter  

@vintagepc64

I reviewed the start gcode and it needed a semicolon and a space before the 'bucket x'.
Now it looks like this "; BUCKET_X 256.65". I ran the script again and the value is now pulled in correctly.
I will be away from the office until Thursday. I'll resume my testing then.


ReplyQuote
Raymond
(@gysnst2)
Active Member Customer
Joined: 2 years ago
Posts: 6
 

@bigbrain3d

thanks I will try this what is the best way to find the extend purge arm number?

 


ReplyQuote
BigBrain3D
(@bigbrain3d)
Supreme moderator Admin
Joined: 2 years ago
Posts: 344
Topic starter  

@gysnst2

Before you start printing you need to determine the proper position of the purge mechanism. Run this gcode but change the number on the 'Change this line' until the nozzle is directly over the center of the tack:

;**Begin purge deployment location test**
G28 X ;home X
M907 X450 ;set motor current
G1 X200 F12000 ;move to position slow
G4 S0.1 ;momentary pause
G1 X250 F12000 ;depress action arm fast
G1 X256.6 F1000 ;Change this line (move nozzle over tack slow)
G4 S2 ;momentary pause
M907 X550 ;set motor current back
G1 X100 F12000 ;move to center of X axis
G4 S0.1 ;synchronous command
M907 X300
;**End purge deployment location test**

Once the exact location of the deployed purge mechanism is know then you can test the purge with this code. WARNING: MAKE SURE YOU RAISE THE Z FOR CLEARANCE BEFORE RUNNING THIS TEST!!

;**Begin purge test**
G28 X
M907 X450
G1 X200 F12000

G1 X200 F12000
G4 S0
G1 X250 F12000
G1 X256.65 F1000 ;Change this line (1 of 2)
M107
G92 E0
G1 E0.8 F2100 ;issue
G92 E0
G1 E40 F200 ;1st purge
M106 S255 ;blob cooling
G4 S12 ;blob cooling
G92 E0
G1 E-0.8 F2100
G1 X240 F12000
G1 X256.65 F3000 ;Change this line (2 of 2)
G1 X240 F12000
G4 S0.1 ;synchronous command
M907 X300
;**End purge test**


ReplyQuote
vintagepc
(@vintagepc64)
Moderator Moderator
Joined: 2 years ago
Posts: 42
 
Posted by: @bigbrain3d

@vintagepc64

I reviewed the start gcode and it needed a semicolon and a space before the 'bucket x'.
Now it looks like this "; BUCKET_X 256.65". I ran the script again and the value is now pulled in correctly.
I will be away from the office until Thursday. I'll resume my testing then.

Great- I should have an update for the tip shaping issue by then.


ReplyQuote
Raymond
(@gysnst2)
Active Member Customer
Joined: 2 years ago
Posts: 6
 

@bigbrain3d

do i run this code in prontoface? repeter? what is the best way

 


ReplyQuote
BigBrain3D
(@bigbrain3d)
Supreme moderator Admin
Joined: 2 years ago
Posts: 344
Topic starter  

@gysnst2

Either of those should work. Even the SD card can be used. We prefer pronterface. Octoprint is not recommended.


ReplyQuote
BigBrain3D
(@bigbrain3d)
Supreme moderator Admin
Joined: 2 years ago
Posts: 344
Topic starter  

@vintagepc64

I'm back at it! How did you make out?


ReplyQuote
vintagepc
(@vintagepc64)
Moderator Moderator
Joined: 2 years ago
Posts: 42
 

@bigbrain3d: 

I did push up a candidate fix for the issue with ramming, that is now a full purge cycle on its own. I did not get a chance to test it yet as my printer has been otherwise occupied.

The work is available in a branch here:

https://github.com/vintagepc/RPM-Post/blob/%235-ramming-as-purge-sequence/tower2RPM.py

 


ReplyQuote
Page 3 / 5
Share: