Problems to implement custom g-code for Extruder change and z-offset

Hi there,

I´m new here and have a big problem with my new self built printer...maybe the reason is because I´m not a software engineer... :-) - mechanical side works perfect so far.

The general function is ok, axis move, bed leveling and stuff is working...but I have a problem to set up my two extruders. My general idea is to have two nozzels and two extruders. Extruder and Nozzle No1 is the main nozzle for example PLA material. The second nozzle with the second extruder is for support material. Easy so far....

I use a RC servo to lift and lower the second nozzle....the main idea is, to print with the nozzle 1 without a z-axis offset (Nozzle 1 is  0/0/0 if we take the nozzle for example as origin). As far as the nozzle 1 is printing, nozzle two should stay in lifted position (for example : M340 p0 S2000) with standby temperature of the hotend.
At this time the tool should change, I want to lift z-axis approx 5mm (maybe with an z-offset) and lower the second nozzle with the RC-servo to lower position. (The z offset is the same high as the servo lowers the nozzle no.2). Servo command is known, but how to tell the slicer or firmware what I want? (Offset of the second nozzle to the first nozzle is x0/ y23 and z5) The effect is, the standby nozzle is always 5mm above the current printing layer.

or maybe shorter:

if Tool one is aktive:
No offset - appart from the auto bed leveling
second nozzle should stay standby (lower temperature) and lifted by servo M340 p0 s2000

if tool changes to tool two:
set an tool offset of x0, y23, z5 (lift z axis 5mm upwards)
may some retract stuff
heat the second nozzle to operating temperature
lower the nozzle two by servo M340 p0 s500 (lowers the nozzle two 5mm)
set standby temperature to nozzle one

and reverse by tool change from T2 to T1.... 

My slicer is slic3r and it´s possible to implement a tool change custom g-code....but I have no idea how?...or is it better to add some code lines to repetier firmware? ...but same problem...no idea how... :-) ...I read a few discussions but can´t find a solution so far.

imageI use the newest repetier firmware, the repetier host, slic3r in latest version an arduino mega with a ramps 1.4.

For further questions feel free to get back to me...

P.S.: Hopefully someone is now laughting about my problem - that means she or he can help me before I bite in my desk... :-)

Cheers 


Comments

  • I have a felix pro which does exactly what you want to achieve and it can be done completely in firmware. For the slicer it looks like both extruders are at same position - firmware will do all the work.

    Think of extruder 0 as origin. Then you can set extruder 1 offset in firmware with negative z coordinate as it will be below extruder 0 when active. Then set for extruder 1
    select command: M400\nM340 P0 S1950 R600\nG4 P300
    deselect command: M340 P0 S1050 R600\nG4 P300

    Adjust the servo positioning M340 to your printer. Then you can simple switch in host/server the extruders and firmware will adjust position and height.
  • Hey,

    thank you very much for your quick help...sounds easy...now I got an option and a way to fix it...

    So am I right if I want to put more tasks to the tool change firmware just add: (\n G blabla) behind for example like retract?
    What is the R600 mean behind the servo position?

      
  • Exactly you can add several commands separated by \n.
    R600 in M340 mean after 600ms disable servo so it does not jitter any more. 600ms is long enough to reach the position.
  • Wow.....

    thanks a lot!...I wired the main stuff and tested your code hint today ->....WORKS PERFECT!!!
    Thanks for saving my weekend with your hint... :-)

    Cheers!...and have a nice weekend too!

  • Hello, I have the same problem. May you share your software and slice settings? My mail address; bekiryakisikli@hotmail.com
    Thanks in advance
Sign In or Register to comment.