diff --git a/rrf3.x/macros/Dock0 b/rrf3.x/macros/Dock0 new file mode 100644 index 0000000000000000000000000000000000000000..0e246150ad6b421e045f2b6a4990d5f4601d2167 --- /dev/null +++ b/rrf3.x/macros/Dock0 @@ -0,0 +1,3 @@ +G1 Y 180 F5000 +G1 X -12.2 Y 180 F5000 +G1 X -12.2 Y 227.4 F5000 diff --git a/rrf3.x/macros/Dock1 b/rrf3.x/macros/Dock1 index 0e246150ad6b421e045f2b6a4990d5f4601d2167..0c600c7e437ef90a759a0e8e66f3d9217340aaa7 100644 --- a/rrf3.x/macros/Dock1 +++ b/rrf3.x/macros/Dock1 @@ -1,3 +1,3 @@ G1 Y 180 F5000 -G1 X -12.2 Y 180 F5000 -G1 X -12.2 Y 227.4 F5000 +G1 X 77.8 Y 180 F5000 +G1 X 77.8 Y 227.4 F5000 diff --git a/rrf3.x/macros/Dock2 b/rrf3.x/macros/Dock2 index 211d480ba962732a7ab8f34e9e171921317cbaa9..fe163d6d17af0acf89d1eef5d7c63dc2d1e6c418 100644 --- a/rrf3.x/macros/Dock2 +++ b/rrf3.x/macros/Dock2 @@ -1,3 +1,3 @@ G1 Y 180 F5000 -G1 X 77.2 Y 180 F5000 -G1 X 77.2 Y 227.4 F5000 +G1 X 211.8 Y 180 F5000 +G1 X 211.8 Y 226.9 F5000 diff --git a/rrf3.x/macros/Dock3 b/rrf3.x/macros/Dock3 index ef03cce6f0ca208e5d3c663aef3b0581167c351d..4c17f753e35a3110cb3c14951762068c121d246b 100644 --- a/rrf3.x/macros/Dock3 +++ b/rrf3.x/macros/Dock3 @@ -1,3 +1,3 @@ G1 Y 180 F5000 -G1 X 211.4 Y 180 F5000 -G1 X 211.4 Y 227.4 F5000 +G1 X 301.8 Y 180 F5000 +G1 X 301.8 Y 227.4 F5000 diff --git a/rrf3.x/macros/Dock4 b/rrf3.x/macros/Dock4 deleted file mode 100644 index e5c82a9cdaa03866027c37931c87929f5dedb3e1..0000000000000000000000000000000000000000 --- a/rrf3.x/macros/Dock4 +++ /dev/null @@ -1,3 +0,0 @@ -G1 Y 180 F5000 -G1 X 301.5 Y 180 F5000 -G1 X 301.5 Y 227.4 F5000 diff --git a/rrf3.x/sys/home_positions b/rrf3.x/sys/home_positions new file mode 100644 index 0000000000000000000000000000000000000000..bdbe6f95593063d1f02b02e310a216b21bdc6f07 --- /dev/null +++ b/rrf3.x/sys/home_positions @@ -0,0 +1,4 @@ +0: X -12.2 Y 227.4 +1: X 77.8 Y 227.4 +2: X 211.8 Y 226.9 +3: X 301.8 Y 227.4 diff --git a/rrf3.x/sys/make_pre_post_free.py b/rrf3.x/sys/make_pre_post_free.py new file mode 100755 index 0000000000000000000000000000000000000000..d85f66e044c49df37b63ea68365b7a1d2ab69fe0 --- /dev/null +++ b/rrf3.x/sys/make_pre_post_free.py @@ -0,0 +1,118 @@ +#!/usr/bin/python3 + +import re +import os + +PRE = """; %(filename)s +; called before tool %(tool)d is selected + +G91 +G1 Z10 F1000 ; Drop the bed +G90 + +; Move in +M98 P"/macros/Coupler - Unlock" +G1 Y%(y_safe)0.1f F20000 ; at safe Y distance +G1 X%(x_final)0.1f Y%(y_safe)0.1f F20000 ; X location at safe Y distance +G1 X%(x_final)0.1f Y%(y_near)0.1f F20000 +G1 X%(x_final)0.1f Y%(y_final)0.1f F4000 ; X location at final Y distance +M98 P"/macros/Coupler - Lock" + +; # # # ###### # # ### # # ##### ; +; # # # # # # # ## # # ## # # # ; +; # # # # # # # # # # # # # # # ; +; # # # # # ###### # # # # # # # # #### ; +; # # # ####### # # # # # # # # # # # ; +; # # # # # # # # ## # # ## # # ; +; ## ## # # # # # # ### # # ##### ; +;if you are using non-standard length hotends ensure the bed is +;lowered enough BEFORE undocking the tool! + +; Move out +G1 X%(x_final)0.1f Y%(y_work)0.1f F4000 ; Tool in active position +""" + +POST = """; %(filename)s +; called after tool %(tool)d has been selected + +M116 P%(tool)d ; heatup + + +;prime nozzle +;M98 P"prime.g" + +M106 R1 ; restore print cooling fan speed +""" + +FREE = """; %(filename)s +; called when tool %(tool)d is freed + +G91 +G1 Z4 F1000 ; Drop the bed +G90 + +;Purge nozzle +;M98 P"purge.g" + +;Move In +G53 G1 X%(x_final)0.1f Y%(y_work)0.1f F20000 ; X location at work Y distance +G53 G1 X%(x_final)0.1f Y%(y_safe)0.1f F20000 +G53 G1 X%(x_final)0.1f Y%(y_near)0.1f F20000 +G53 G1 X%(x_final)0.1f Y%(y_final)0.1f F2000 ; X location at final Y distance +M98 P"/macros/Coupler - Unlock" + +;fan off +M106 P%(fan)d S0 + +;Move Out +G53 G1 X%(x_final)0.1f Y%(y_safe)0.1f F20000 ; X location at safe Y distance +""" + +class Home: + + def __init__(self, line): + m = re.match('^([0-9]+)\s*:\s*X\s*([-0-9.]+)\s*Y\s*([-0-9.]+)\s*$', + line) + if m: + self.tool = int(m.group(1)) + self.x = float(m.group(2)) + self.y = float(m.group(3)) + pass + + def __repr__(self): + return 'Home(%d, %f, %f)' % (self.tool, self.x, self.y) + +if __name__ == '__main__': + home = {} + for h in [Home(l) for l in open('home_positions')]: + home[h.tool] = h + pass + for i in range(3): + # Expected if all tools the same: + # 90.0 0.0 + # 135.0 0.0 + # 90.0 0.0 + print(home[i+1].x - home[i].x, home[i+1].y - home[i].y) + pass + for i in range(4): + for path,template in (('tpre%d.g' % i, PRE), + ('tpost%d.g' % i, POST), + ('tfree%d.g' % i, FREE)): + with open(path, 'w') as f: + print(path) + print(template % + dict( + filename=os.path.basename(path), + tool=i, + fan=2+i*2, + x_final=home[i].x, + y_final=home[i].y, + y_safe=home[i].y-50, + y_near=home[i].y-15, + y_work=home[i].y-75 + ), + file=f) + pass + pass + pass + pass diff --git a/rrf3.x/sys/tfree0.g b/rrf3.x/sys/tfree0.g index 2939d2d9624fb5d25c8900ccbc87a80dea404add..468fb1a4390c3a8ded4c968a2c146d6a5f50da56 100644 --- a/rrf3.x/sys/tfree0.g +++ b/rrf3.x/sys/tfree0.g @@ -1,25 +1,23 @@ ; tfree0.g ; called when tool 0 is freed -;Drop the bed G91 -G1 Z4 F1000 +G1 Z4 F1000 ; Drop the bed G90 ;Purge nozzle ;M98 P"purge.g" ;Move In -G53 G1 X-10.5 Y150 F50000 -G53 G1 X-10.5 Y200 F50000 -G53 G1 X-10.5 Y220 F50000 -G53 G1 X-10.5 Y242 F5000 - -;Open Coupler +G53 G1 X-12.2 Y152.4 F20000 ; X location at work Y distance +G53 G1 X-12.2 Y177.4 F20000 +G53 G1 X-12.2 Y212.4 F20000 +G53 G1 X-12.2 Y227.4 F2000 ; X location at final Y distance M98 P"/macros/Coupler - Unlock" ;fan off M106 P2 S0 ;Move Out -G53 G1 X-10.5 Y175 F50000 +G53 G1 X-12.2 Y177.4 F20000 ; X location at safe Y distance + diff --git a/rrf3.x/sys/tfree1.g b/rrf3.x/sys/tfree1.g index cb2037bed10fc7c5add37c65547f5868fb757be7..abb383b84d7baf631c369e2a2f8ebf66db970ced 100644 --- a/rrf3.x/sys/tfree1.g +++ b/rrf3.x/sys/tfree1.g @@ -1,26 +1,23 @@ ; tfree1.g ; called when tool 1 is freed -;Drop the bed G91 -G1 Z4 F1000 +G1 Z4 F1000 ; Drop the bed G90 ;Purge nozzle ;M98 P"purge.g" ;Move In -G53 G1 X79.5 Y150 F50000 -G53 G1 X79.5 Y200 F50000 -G53 G1 X79.5 Y220 F50000 -G53 G1 X79.5 Y242 F5000 - -;Open Coupler +G53 G1 X77.8 Y152.4 F20000 ; X location at work Y distance +G53 G1 X77.8 Y177.4 F20000 +G53 G1 X77.8 Y212.4 F20000 +G53 G1 X77.8 Y227.4 F2000 ; X location at final Y distance M98 P"/macros/Coupler - Unlock" ;fan off M106 P4 S0 ;Move Out -G53 G1 X79.5 Y175 F50000 +G53 G1 X77.8 Y177.4 F20000 ; X location at safe Y distance diff --git a/rrf3.x/sys/tfree2.g b/rrf3.x/sys/tfree2.g index 588f0d5ae162494e7334daf4ae1728fc3bfc6dd2..c76561be9932123d38784c00e2d26b1aa5ffd487 100644 --- a/rrf3.x/sys/tfree2.g +++ b/rrf3.x/sys/tfree2.g @@ -1,26 +1,23 @@ ; tfree2.g ; called when tool 2 is freed -;Drop the bed G91 -G1 Z4 F1000 +G1 Z4 F1000 ; Drop the bed G90 ;Purge nozzle ;M98 P"purge.g" ;Move In -G53 G1 X214.5 Y150 F50000 -G53 G1 X214.5 Y200 F50000 -G53 G1 X214.5 Y220 F50000 -G53 G1 X214.5 Y243 F5000 - -;Open Coupler -M98 P/macros/Coupler - Unlock +G53 G1 X211.8 Y151.9 F20000 ; X location at work Y distance +G53 G1 X211.8 Y176.9 F20000 +G53 G1 X211.8 Y211.9 F20000 +G53 G1 X211.8 Y226.9 F2000 ; X location at final Y distance +M98 P"/macros/Coupler - Unlock" ;fan off M106 P6 S0 ;Move Out -G53 G1 X214.5 Y175 F50000 +G53 G1 X211.8 Y176.9 F20000 ; X location at safe Y distance diff --git a/rrf3.x/sys/tfree3.g b/rrf3.x/sys/tfree3.g index b951dbe2994f89d4b8b9afb645f1a54ef8553eca..731274ea361223d859567acef1ab1c985a3a6fe8 100644 --- a/rrf3.x/sys/tfree3.g +++ b/rrf3.x/sys/tfree3.g @@ -1,26 +1,23 @@ ; tfree3.g ; called when tool 3 is freed -;Drop the bed G91 -G1 Z4 F1000 +G1 Z4 F1000 ; Drop the bed G90 ;Purge nozzle ;M98 P"purge.g" ;Move In -G53 G1 X304.5 Y150 F50000 -G53 G1 X304.5 Y200 F50000 -G53 G1 X304.5 Y220 F50000 -G53 G1 X304.5 Y243 F5000 - -;Open Coupler +G53 G1 X301.8 Y152.4 F20000 ; X location at work Y distance +G53 G1 X301.8 Y177.4 F20000 +G53 G1 X301.8 Y212.4 F20000 +G53 G1 X301.8 Y227.4 F2000 ; X location at final Y distance M98 P"/macros/Coupler - Unlock" ;fan off M106 P8 S0 ;Move Out -G53 G1 X304.5 Y175 F50000 +G53 G1 X301.8 Y177.4 F20000 ; X location at safe Y distance diff --git a/rrf3.x/sys/tpost0.g b/rrf3.x/sys/tpost0.g index a1a98884f800ae6a0f5165c7a51c9d3f4dc741d6..289852c86a6d007eff3e792ee294b3eba88b9228 100644 --- a/rrf3.x/sys/tpost0.g +++ b/rrf3.x/sys/tpost0.g @@ -1,10 +1,11 @@ ; tpost0.g ; called after tool 0 has been selected -;heatup -M116 P0 +M116 P0 ; heatup + ;prime nozzle ;M98 P"prime.g" -M106 R1 ; restore print cooling fan speed \ No newline at end of file +M106 R1 ; restore print cooling fan speed + diff --git a/rrf3.x/sys/tpost1.g b/rrf3.x/sys/tpost1.g index 6986d1f3d7e76b8a402bdd7cc60c2cb68e8b8876..5173c35a940a6e8e06f476835fee4b0034d76247 100644 --- a/rrf3.x/sys/tpost1.g +++ b/rrf3.x/sys/tpost1.g @@ -1,10 +1,11 @@ ; tpost1.g ; called after tool 1 has been selected -;heatup -M116 P1 +M116 P1 ; heatup + ;prime nozzle ;M98 P"prime.g" -M106 R1 ; restore print cooling fan speed \ No newline at end of file +M106 R1 ; restore print cooling fan speed + diff --git a/rrf3.x/sys/tpost2.g b/rrf3.x/sys/tpost2.g index d36304351e0675e62c1771f2b7eea15ab4f6fe5e..29c52f0edaa044b2c2bbb80375861fae65c68c0d 100644 --- a/rrf3.x/sys/tpost2.g +++ b/rrf3.x/sys/tpost2.g @@ -1,10 +1,11 @@ ; tpost2.g ; called after tool 2 has been selected -;heatup -M116 P2 +M116 P2 ; heatup + ;prime nozzle ;M98 P"prime.g" -M106 R1 ; restore print cooling fan speed \ No newline at end of file +M106 R1 ; restore print cooling fan speed + diff --git a/rrf3.x/sys/tpost3.g b/rrf3.x/sys/tpost3.g index 451872334a11969dbbfdba5ec0f1941080f1a2e7..f3e461dda247a295437e3c23a5f7e7ed2538419c 100644 --- a/rrf3.x/sys/tpost3.g +++ b/rrf3.x/sys/tpost3.g @@ -1,10 +1,11 @@ ; tpost3.g ; called after tool 3 has been selected -;heatup -M116 P3 +M116 P3 ; heatup + ;prime nozzle ;M98 P"prime.g" -M106 R1 ; restore print cooling fan speed \ No newline at end of file +M106 R1 ; restore print cooling fan speed + diff --git a/rrf3.x/sys/tpre0.g b/rrf3.x/sys/tpre0.g index ddcc06034943e07653e96e442d31f6f4a9ec36d1..01b068e50dd7049ac2ac0cdac75d87a0088d5c22 100644 --- a/rrf3.x/sys/tpre0.g +++ b/rrf3.x/sys/tpre0.g @@ -1,28 +1,28 @@ ; tpre0.g ; called before tool 0 is selected -;Unlock Coupler -M98 P"/macros/Coupler - Unlock" - -;Move to location -G1 X-10.5 Y200 F50000 - -;Move in -G1 X-10.5 Y230 F50000 - -;Collect -G1 X-10.5 Y242 F2500 - -;Close Coupler -M98 P"/macros/Coupler - Lock" - -;WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! -;if you are using non-standard length hotends ensure the bed is lowered enough BEFORE undocking the tool! G91 -G1 Z10 F1000 +G1 Z10 F1000 ; Drop the bed G90 -;Move Out -G1 X-10.5 Y150 F4000 +; Move in +M98 P"/macros/Coupler - Unlock" +G1 Y177.4 F20000 ; at safe Y distance +G1 X-12.2 Y177.4 F20000 ; X location at safe Y distance +G1 X-12.2 Y212.4 F20000 +G1 X-12.2 Y227.4 F4000 ; X location at final Y distance +M98 P"/macros/Coupler - Lock" +; # # # ###### # # ### # # ##### ; +; # # # # # # # ## # # ## # # # ; +; # # # # # # # # # # # # # # # ; +; # # # # # ###### # # # # # # # # #### ; +; # # # ####### # # # # # # # # # # # ; +; # # # # # # # # ## # # ## # # ; +; ## ## # # # # # # ### # # ##### ; +;if you are using non-standard length hotends ensure the bed is +;lowered enough BEFORE undocking the tool! + +; Move out +G1 X-12.2 Y152.4 F4000 ; Tool in active position diff --git a/rrf3.x/sys/tpre1.g b/rrf3.x/sys/tpre1.g index ec74f9656b2422009e5f0a7d44af3f9779452691..d28f82e944ffa30e55b6c08619c86ec4e102bd9d 100644 --- a/rrf3.x/sys/tpre1.g +++ b/rrf3.x/sys/tpre1.g @@ -1,26 +1,28 @@ ; tpre1.g ; called before tool 1 is selected -;Unlock Coupler -M98 P"/macros/Coupler - Unlock" - -;Move to location -G1 X79.5 Y200 F50000 - -;Move in -G1 X79.5 Y230 F50000 - -;Collect -G1 X79.5 Y242 F2500 +G91 +G1 Z10 F1000 ; Drop the bed +G90 -;Close Coupler +; Move in +M98 P"/macros/Coupler - Unlock" +G1 Y177.4 F20000 ; at safe Y distance +G1 X77.8 Y177.4 F20000 ; X location at safe Y distance +G1 X77.8 Y212.4 F20000 +G1 X77.8 Y227.4 F4000 ; X location at final Y distance M98 P"/macros/Coupler - Lock" -;WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! -;if you are using non-standard length hotends ensure the bed is lowered enough BEFORE undocking the tool! -G91 -G1 Z10 F1000 -G90 +; # # # ###### # # ### # # ##### ; +; # # # # # # # ## # # ## # # # ; +; # # # # # # # # # # # # # # # ; +; # # # # # ###### # # # # # # # # #### ; +; # # # ####### # # # # # # # # # # # ; +; # # # # # # # # ## # # ## # # ; +; ## ## # # # # # # ### # # ##### ; +;if you are using non-standard length hotends ensure the bed is +;lowered enough BEFORE undocking the tool! + +; Move out +G1 X77.8 Y152.4 F4000 ; Tool in active position -;Move Out -G1 X79.5 Y150 F4000 diff --git a/rrf3.x/sys/tpre2.g b/rrf3.x/sys/tpre2.g index 3318998c3692f2691fcf70099bd83308ec2aa9a2..ad497be18bd2622d322dfd403e519d992bd56574 100644 --- a/rrf3.x/sys/tpre2.g +++ b/rrf3.x/sys/tpre2.g @@ -1,26 +1,28 @@ ; tpre2.g ; called before tool 2 is selected -;Unlock Coupler -M98 P"/macros/Coupler - Unlock" - -;Move to location -G1 X214.5 Y200 F50000 - -;Move in -G1 X214.5 Y230 F50000 - -;Collect -G1 X214.5 Y243 F2500 +G91 +G1 Z10 F1000 ; Drop the bed +G90 -;Close Coupler +; Move in +M98 P"/macros/Coupler - Unlock" +G1 Y176.9 F20000 ; at safe Y distance +G1 X211.8 Y176.9 F20000 ; X location at safe Y distance +G1 X211.8 Y211.9 F20000 +G1 X211.8 Y226.9 F4000 ; X location at final Y distance M98 P"/macros/Coupler - Lock" -;WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! -;if you are using non-standard length hotends ensure the bed is lowered enough BEFORE undocking the tool! -G91 -G1 Z10 F1000 -G90 +; # # # ###### # # ### # # ##### ; +; # # # # # # # ## # # ## # # # ; +; # # # # # # # # # # # # # # # ; +; # # # # # ###### # # # # # # # # #### ; +; # # # ####### # # # # # # # # # # # ; +; # # # # # # # # ## # # ## # # ; +; ## ## # # # # # # ### # # ##### ; +;if you are using non-standard length hotends ensure the bed is +;lowered enough BEFORE undocking the tool! + +; Move out +G1 X211.8 Y151.9 F4000 ; Tool in active position -;Move Out -G1 X214.5 Y150 F4000 diff --git a/rrf3.x/sys/tpre3.g b/rrf3.x/sys/tpre3.g index b300f24e00ce8f12ea130e2931cb9a31500daf0d..a5d7c7a4aaae0af42c28ccc2beaf4cbe1ad6bfb7 100644 --- a/rrf3.x/sys/tpre3.g +++ b/rrf3.x/sys/tpre3.g @@ -1,27 +1,28 @@ ; tpre3.g ; called before tool 3 is selected -;Unlock Coupler -M98 P"/macros/Coupler - Unlock" - -;Move to location -G1 X304.5 Y200 F50000 - -;Move in -G1 X304.5 Y230 F50000 - -;Collect -G1 X304.5 Y243 F2500 - -;Close Coupler -M98 P"/macros/Coupler - Lock" - -;WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! -;if you are using non-standard length hotends ensure the bed is lowered enough BEFORE undocking the tool! G91 -G1 Z10 F1000 +G1 Z10 F1000 ; Drop the bed G90 -;Move Out -G1 X304.5 Y150 F4000 +; Move in +M98 P"/macros/Coupler - Unlock" +G1 Y177.4 F20000 ; at safe Y distance +G1 X301.8 Y177.4 F20000 ; X location at safe Y distance +G1 X301.8 Y212.4 F20000 +G1 X301.8 Y227.4 F4000 ; X location at final Y distance +M98 P"/macros/Coupler - Lock" + +; # # # ###### # # ### # # ##### ; +; # # # # # # # ## # # ## # # # ; +; # # # # # # # # # # # # # # # ; +; # # # # # ###### # # # # # # # # #### ; +; # # # ####### # # # # # # # # # # # ; +; # # # # # # # # ## # # ## # # ; +; ## ## # # # # # # ### # # ##### ; +;if you are using non-standard length hotends ensure the bed is +;lowered enough BEFORE undocking the tool! + +; Move out +G1 X301.8 Y152.4 F4000 ; Tool in active position