Adjustable Brush Code

Discussion in 'Motion System' started by JB24, Aug 10, 2020.

  1. JB24

    JB24 Member

    Joined:
    Nov 26, 2019
    Messages:
    5
    Likes Received:
    4
    Anybody got an example of how they implemented the adjustable brush? Looking to double check what I did before loading it up. Thanks
     
  2. p3t3rp4nd4

    p3t3rp4nd4 Active Member

    Joined:
    Oct 28, 2019
    Messages:
    25
    Likes Received:
    48
  3. Akiross

    Akiross Member

    Joined:
    Oct 21, 2020
    Messages:
    10
    Likes Received:
    0
    Thanks for example, so...I understand that for each tool you make a separate brush/purge macro... and this is executed depend on the tool is used by slicer, right?
    On prusa slicer part I have this example on tool change:

    {if layer_num < 1}
    {if previous_extruder < 0}
    G10 P{next_extruder} S[first_layer_temperature]
    T[next_extruder]
    M98 Ppurge.g
    {else}
    M98 Ppurge.g
    G10 P{next_extruder} S[first_layer_temperature]
    T[next_extruder]
    G10 P{previous_extruder} R190
    M98 Ppurge.g
    {endif}
    {else}
    M98 Ppurge.g
    G10 P{next_extruder} S[temperature]

    T[next_extruder]
    G10 P{previous_extruder} R190
    M98 Ppurge.g
    {endif}
    {if layer_num > 0}
    {if next_extruder == 0}
    M106 P2 S255

    EXECUTE here the Ppurge macro? and erase all the first lines?
    {endif}
    {if next_extruder == 1}
    M106 P4 S255
    {endif}
    {if next_extruder == 2}
    M106 P6 S255
    {endif}
    {if next_extruder == 3}
    M106 P8 S255
    {endif}
    {endif}

    I need some help to select the correct tool/macro on each change.
    I try to learn how it runs Gcode on prusaSlicer...

    Gracias!
     
  4. Akiross

    Akiross Member

    Joined:
    Oct 21, 2020
    Messages:
    10
    Likes Received:
    0
    I have some good results on my own "trash" code, I insert this in the tool changer section:
    In my case, I have a original E3D toolchanger with T0 volcano, T1 v6, T2 v6, and in the T3 nothing.
    ; INICIO del Codigo del cambio de herramienta
    {if layer_num < 1}
    {if previous_extruder < 0}
    G10 P{next_extruder} S[first_layer_temperature]
    T[next_extruder]
    {if current_extruder == 0}
    ;M98 PpurgeV.g ; codigo de limpieza Volcano
    {endif}
    {if current_extruder == 1}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {if current_extruder == 2}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {if current_extruder == 3}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {else}
    {if current_extruder == 0}
    ;M98 PpurgeV.g ; codigo de limpieza Volcano
    {endif}
    {if current_extruder == 1}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {if current_extruder == 2}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {if current_extruder == 3}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    G10 P{next_extruder} S[first_layer_temperature]
    T[next_extruder]
    G10 P{previous_extruder} R190
    {if current_extruder == 0}
    ;M98 PpurgeV.g ; codigo de limpieza Volcano
    {endif}
    {if current_extruder == 1}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {if current_extruder == 2}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {if current_extruder == 3}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {endif}
    {else}
    {if current_extruder == 0}
    ;M98 PpurgeV.g ; codigo de limpieza Volcano
    {endif}
    {if current_extruder == 1}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {if current_extruder == 2}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {if current_extruder == 3}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    G10 P{next_extruder} S[temperature]

    T[next_extruder]
    G10 P{previous_extruder} R190
    {if current_extruder == 0}
    ;M98 PpurgeV.g ; codigo de limpieza Volcano
    {endif}
    {if current_extruder == 1}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {if current_extruder == 2}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {if current_extruder == 3}
    M98 Ppurge.g ; codigo de limpieza V6
    {endif}
    {endif}
    {if layer_num > 0}
    {if next_extruder == 0}
    M106 P2 S255
    {endif}
    {if next_extruder == 1}
    M106 P4 S255
    {endif}
    {if next_extruder == 2}
    M106 P6 S255
    {endif}
    {if next_extruder == 3}
    M106 P8 S255
    {endif}
    {endif}
    ; FIN del codigo de cambio de herramienta

    It seems to run fine. But the code is not optimized. if i have a little time I want use If/else...
     
  5. Rene

    Rene Active Member

    Joined:
    Sep 1, 2019
    Messages:
    34
    Likes Received:
    16
    I didn't check your code, but want to tell that it is bad practice to do this via slicer setting. Instead, you should execute this via firmware, like suggested in the 2nd post.
     
  6. Akiross

    Akiross Member

    Joined:
    Oct 21, 2020
    Messages:
    10
    Likes Received:
    0
    Ohh, I read again the code, It's a lot easyer if I do this in the "Tfree1.g" than at slicer.
    Thanks!

    We need this like a tutorial, or Pinned at forum. It's really usefull this example code!
     

Share This Page