Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. SanderLPFRG
    3. Posts
    • Profile
    • Following 1
    • Followers 0
    • Topics 30
    • Posts 125
    • Best 13
    • Controversial 0
    • Groups 0

    Posts made by SanderLPFRG

    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @dwuk3d
      I do think the Macro would not be able to be run during printing.

      But, if running on SBC-mode, you might be able to write a program to process the mesh?? it should be able to call the ".csv" to use it and pre-process it.

      might be interesting to call in on some multi-axes printing guys as well!

      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @fcwilt It does work, but ofcourse it assumes the Right side is mirrored to the Left side

      my duplication start gcode, if anyone wants to use it;

      ;   Setup variables
      var lefttemp = 0
      var righttemp = 0
      var bed = 0
      var printxmin = 0
      var printxmax = 600
      var printymin = 0
      var printymax = 500
      var sizex = 50
      var pointsx = 3
      var sizey = 50
      var pointsy = 3
      var purgelength = 15
      var initialtool = 0
      var leftused = "false"
      var rightused = "false"
      var leftfilament = "none"
      var rightfilament = "none"
      var leftnozzlesize = 0
      var rightnozzlesize = 0
      var dualprintingoffset = 167.5
      
      
      ;   Define variables
      ; Temperature variables
      set var.lefttemp = param.A  ; Extruder temperature
      set var.righttemp = param.B ; Extruder temperature
      set var.bed = param.C       ; Bed temperature
      ; Print variables
      set var.printxmin = param.D ; Left boundry
      set var.printxmax = param.E ; Right boundry
      set var.printymin = param.F ; Front boundry
      set var.printymax = param.H ; Back boundry
      set var.sizex = {var.printxmax - var.printxmin}
      set var.sizey = {var.printymax - var.printymin}
      ; Machine variables
      set var.initialtool     = param.I ; initial tool
      set var.leftused        = param.J ; is right tool used yes/no
      set var.rightused       = param.K ; is right tool used yes/no
      set var.leftfilament    = param.L ; loaded filament type left
      set var.rightfilament   = param.O ; loaded filament type right
      set var.leftnozzlesize  = param.Q ; nozzle diameter left
      set var.rightnozzlesize = param.R ; nozzle diameter right
      
      ; set probing amount for Y
      if var.sizex <= 150         ; if sizeX is less than 150mm, set probing X amount to 3
          set var.pointsx = 3
      elif var.sizex <= 350       ; if sizeX is between 150mm and 350mm, set probing X amount to 5
          set var.pointsx = 5
      elif var.sizex <= 450       ; if sizeX is between 350mm and 450mm, set probing X amount to 7
          set var.pointsx = 7
      else                        ; if sizeX is between 450mm and max, set probing X amount to 9
          set var.pointsx = 9
      ;endif
      ; set probing amount for Y
      if var.sizex <= 100         ; if sizeX is less than 100mm, set probing X amount to 3
          set var.pointsx = 3
      elif var.sizex <= 300       ; if sizeX is between 100mm and 300mm, set probing X amount to 5
          set var.pointsx = 5
      elif var.sizex <= 400       ; if sizeX is between 300mm and 400mm, set probing X amount to 7
          set var.pointsx = 7
      else                        ; if sizeX is between 400mm and max, set probing X amount to 9
          set var.pointsx = 9
      ;endif
      
      
      ; General settings;
      G90 ; set absolute coordinates
      T0
      
      ; Heat up for probing
      M104 T0 S150 ; set extruder temp for bed leveling
      M104 T1 S150 ; set extruder temp for bed leveling
      M140 P0 S{var.bed} ; set bed temperature zone 2
      M140 P1 S{var.bed} ; set bed temperature zone 1M109 T0 S150 ; wait for hotend probing temp
      M109 T1 S150 ; set extruder temp for bed leveling
      M190 P0 S{var.bed} ; wait for bed temperature zone 1
      M190 P1 S{var.bed} ; wait for bed temperature zone 1; Prepare for automatic calibration
      
      
      M302 S140 ; lower cold extrusion limit to 160C
      G1 E-2 F2400 ; cold retraction
      M302 S170 ; restore cold extrusion limit
      G32 ; home printer
      
      ; Start mesh offsetting
      G1 X0 Y0 F6000 Z10
      G91
      G1 X{-var.dualprintingoffset} ; move X to offset
      G92 X0; set position back to original
      ; Actual position is now 150mm offset compared to assumed position
      M557 X{var.printxmin, var.printxmax} Y{var.printymin, var.printymax} P{var.pointsx, var.pointsy} ; Define adaptive mesh area around X=0
      G29 ; Measure bed. 
      ;G30 Z-9999
      ; Machine assumes this is around X=0 position, while it is actually measuring offset area
      G1 X0 Y0 F6000 Z10
      G92 X{-var.dualprintingoffset}; set position back to original
      
      ; Heat up for printing
      G90 ; absolute coordinates
      G1 X-360 U360 Y-240 Z15 F6000; move to park position
      T2
      M109 S{var.lefttemp}
      
      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @dwuk3d The micro-Z compensation is above my knowledge-grade, but the main difficulty remains that there needs to be a centralized program that knows;

      • The XYU coordinates of all printing moves
      • The offset amount compared to known slicer movement axis to the new positions of toolheads
      • The heightmap of the used area of the printed

      Then it would need to look up all X and Y coordinates of the print, offset them to generate a T (Offseted X to T1) and U (Offseted X to T2) coordinage, and then create a V movement parameter for the T/Y coordinate, and then a W movement for the U/U coordinate.

      BUT, this assumes you do not want to use a taper height

      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @fcwilt
      Yes, in short.

      The G-code is printing between X-50 and X50. When I measure the adaptive mesh over this area (the middle of the bed) and then print in mirror mode, the firmware applies the mesh data from X-50 to X50, even though the print is shifted to an offset region (e.g., X-150 to X-50 with a 100mm offset).

      To fix this, I trick RRF into measuring the offset area (X-150 to X-50) while it believes it's probing around X0. This way, when printing, it applies the heightmap it thinks is from X0, but it's actually from the offset area where the print will take place.

      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @fcwilt Correct,

      See the code snippet I sent above; it automatically measures a mesh that is offset by the X value of duplication.

      It gives the same result as manually offsetting the CSV file.

      This indeed gives a good compensation for left half, and the right half follows, which is not ideal but works better than no compensation.

      Ideally, you could also do the compensation with user-defined axis ( we have a microZ which moves the X and U printhead up and down) which could be used for mesh compensation like @dwuk3d also mentioned. I guess that requires a huge overhaul of how printing with 2 printheads works in Duet tho.. We could also integrate it into a slicer (post-processing) to send a G1 X, U, Y, Z, V, and W position. But then the slicer also needs to know the mesh heightmap

      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @fcwilt @dc42

      Mesh compensation cannot work for two printheads at the same time - it could adjust the bed for one or the other, but not both.
      The video suggests it is applying the entire heightmap twice, once to the left half and again to right half of the bed.
      Which, in a way, makes sense since mirroring essentially splits the bed into two equal parts.
      However it does no good at all as the heightmap doesn't match either half of the bed.

      Theoretically it should not, but yet it does actively apply a mesh. It indeed looks like it is applying the same heatmap twice, but in any case it would be better to keep the mesh origin in the middle, and only use the left side. The physical bed does not move.

      In our case it is definitely not ideal, nor perfectly mirrored along X=0, but it definitely is significantly better to compensate more than nothing.

      I currently got it working with this code;

      G1 X0 Y0 F6000 Z10 ; move to controlled position while G90
      G91; set to relative
      G1 X{-var.dualprintingoffset} ; move X to offset position
      G92 X0; Force new position to X=0
      ; Actual position is now 150mm offset compared to assumed position
      M557 X{var.printxmin, var.printxmax} Y{var.printymin, var.printymax} P{var.pointsx, var.pointsy} ; Define adaptive mesh area around duplication position
      G29 ; Measure bed. 
      ; Machine assumes this is around X=0 position, while it is actually measuring offset area
      G1 X0 Y0 F6000 Z10 ; move back to controlled position
      G92 X{-var.dualprintingoffset}; set position back to original X=0
      
      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @fcwilt Here are some videos;

      Height map was set at 50 , 0 , 50 to make it really clear for the video
      Movement Left printhead; https://photos.app.goo.gl/FJuenGCBoZD6ia7j6
      Movement Right printhead; https://photos.app.goo.gl/8H9C4EzgjiuiZuvc7
      Movement Mirrored; https://photos.app.goo.gl/6M6dbW1AvHj1x8A36

      (uploaded like this because of limited upload size)

      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @fcwilt I managed to make one as well

      Testing I just did;
      Height map of +5 , 0, +5, so a V shape loaded

      1. When selecting and jogging with Left toolhead, it follows the path correctly, and changes the Z-compensation direction perfectly at the middle of the whole bed
      2. When selecting and jogging with Right toolhead, it follows the path correctly, and changes the Z-compensation direction perfectly at the middle of the whole bed
      3. When selecting the mirror tool (see config below), it still applies a V-shaped bed correctly, but it offsets the mesh as well, so then it is mirroring at the quarter of the whole bed

      config;

      ; Tool Left
      M563 P0 S"Left" D0 H2 X0 F0     ; define tool 0
      G10 P0 X0 Y0 Z0                 ; set tool 0 axis offsets
      G10 P0 R0 S0                    ; set initial tool 0 active and standby temperatures to 0C
      
      ; Tool Right
      M563 P1 S"Right" D1 H3 X3 F1    ; define tool 1
      G10 P1 U0 Y0 Z0.15       ; set tool 1 axis offsets
      G10 P1 R0 S0                    ; set initial tool 1 active and standby temperatures to 0C
      
      ; Tool Mirror
      M563 P2 S"Mirror" D0:1 H2:3 X0:3 F0:1     ; tool 2 uses both extruders, hot end heaters and fans, and maps X to both X and U
      G10 P2 X150 Y0 U-150 S0 R0                      ; set tool offsets and temperatures
      M567 P2 E1:1                                    ; set mix ratio 100% on both extruders
      

      Expected behavior would be to compensate and move in 1 direction only, when mirrored mode is selected (when moving from outside to the middle of the bed

      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @fcwilt said in Mesh compensation which accounts for G10 X&Y tool offsets:

      ed having a Z range of 0mm to 5mm it was easy to see the mesh compensation a

      Smart testing Idea,

      Can you share the simple CSV you made?? Maybe our issue lies with having both X and U mapped to the X movements? I wonder if it then follows with the X or the U axis?

      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @fcwilt So If I understand correctly;

      If I have a mesh present at X-200 to X-100 and print at X-50 to X50 with a G10 offset of -150, will it still print with the correct compensation?

      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @fcwilt said in Mesh compensation which accounts for G10 X&Y tool offsets:

      But you didn't say why y

      Ah, my bad!

      I have two reasons to believe it doesn't compensate correctly:

      • In the X-200 to X-100 range, the Z-offset slopes slightly downward, whereas from X-100 to X100, there's a very slight bulge. When I touch the Z-axis during printing, I can feel it compensating for the bulge, even though it's printing in the slanted area.
      • If I only probe the middle area but print outside this probed mesh, it still actively compensates. I believe RRF doesn’t extrapolate beyond the probed area, so I assume it’s applying compensation based on the middle section.
      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Home aditional V/W axis individually with probe

      @dwuk3d Yeahh we use a geared linear actuator. For Z hopping I can see why they might be slow, but we only use them for aligning the IDEX tools, and in the future we indeed want to use them for mesh compensation as well. Both of them don't require high accelerations.

      posted in MultiAxis Printing
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      @dwuk3d @fcwilt
      Great to hear you're working on this as well!

      We also have an index with dual HAQ-XY kinematics. Initially, we aimed to compensate using the micro-Z, but due to the mounting system and the materials of our bed, we observed that the bed deforms symmetrically over the center. As a result, we can handle the compensation using the gantry, at least in mirror mode. For duplication, this is still the approach we want to pursue.

      Regarding the applied mesh location, if you check the X and Y coordinates in DWC, it prints from approximately X-25 to X25. This means the height map is being applied within those coordinates. I see two possible solutions:

      Parsing the CSV file to shift all points by X+150mm, which would require some post-processing.
      Trick RRF into probing the heightmap at X-150mm instead. I believe this could be automated using meta commands, perhaps something like:

      var dualprintingoffset = 150
      
      ; Start mesh offsetting
      G91 ; relative movements
      G1 X-{var.dualprintingoffset} ; move X to offset
      G92 X{move.axes[0].machineposition + var.dualprintingoffset}; set position back to original
      G90
      
      ; Actual position is now 150mm offset compared to assumed position
      
      ; Define adaptive mesh area around X=0
      M557 X{var.printxmin, var.printxmax} Y{var.printymin, var.printymax} P{var.pointsx, var.pointsy}
      G29 ; Measure bed. 
      
      ; Machine assumes this is around X=0 position, while it is actually measuring offset area
      
      ; Reset mesh offsetting
      G92 X{move.axes[0].machineposition - var.dualprintingoffset}; set position back to original
      G90
      
      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Mesh compensation which accounts for G10 X&Y tool offsets

      note;

      I found that you might be able to use G10 L2 or M206. But from what I can see, this only adjusts the position of the toolhead, but still compensates the bed mesh at the original coordinates.

      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • Mesh compensation which accounts for G10 X&Y tool offsets

      Hi!

      We have a machine with a bed that sags symmetrically around the X=0 line (600mm X-width).

      When printing in mirror mode, this means that the compensated Z-height should theoretically be the same for both the left and right printing toolheads.

      Because mirror mode is just a regular gcode (centre at 0,0) with G10 offsets applied for X and U (and U inverted), the firmware is actively applying the bed mesh compensation for the original coordinates, while in reality, the left toolhead is printing 150mm to the left and the right toolhead is printing 150mm to the right.

      Since RRF (RepRapFirmware) knows that the tool offset for X is -150, is there a way to set it up so that it compensates the mesh at the adapted X coordinate rather than the original, unadjusted coordinate?

      posted in Gcode meta commands
      SanderLPFRGundefined
      SanderLPFRG
    • RE: Home aditional V/W axis individually with probe

      @gloomyandy G38.2 in the end worked!!

      You can move an axes until the specified probe is triggered. Works like a charm.

      G38.2 K0 V-14 
      G38.2 K1 W-14
      
      posted in MultiAxis Printing
      SanderLPFRGundefined
      SanderLPFRG
    • RE: move outside of machine limits with G2 move, in tool 2

      @T3P3Tony Hey Tony,

      We found the issue to be regarding the V axis being too low.

      Why it triggered only with G2 enabled gcodes remains a question still, but since we adapted the starting codes to account for the V being out of bounds we have not had the issue.

      Maybe an improvement is to add the relevant axis number to the errorcode for future firmware?

      posted in Beta Firmware
      SanderLPFRGundefined
      SanderLPFRG
    • RE: move outside of machine limits with G2 move, in tool 2

      @droftarts 3.6.0 beta 2 and beta 3 tried both

      posted in Beta Firmware
      SanderLPFRGundefined
      SanderLPFRG
    • move outside of machine limits with G2 move, in tool 2

      when printing with tool 2, I often get a "outside of machine limits" error at the first G2 movement of a Gcode, even if the moves are well within these limits. Below I attached my config, the first part of the failing code, and the console with error.

      Testing I already did;

      • The same code does print correctly with Tool 1.
      • The same model (nothing else changed) does print when arc fitting is disabled

      Could this be a bug?

      Console;

      24/01/2025, 12:04:19: Connected to one.local
      24/01/2025, 12:05:07: Connection established
      24/01/2025, 12:05:57: M32 "0:/gcodes/ONE_P-0026789 v1_0.2mm_PETG_1d13h17m.gcode": File 0:/gcodes/ONE_P-0026789 v1_0.2mm_PETG_1d13h17m.gcode selected for printing
      24/01/2025, 12:06:01: : Warning: Tool 0 was not driven because its heater temperatures were not high enough or it has a heater fault
      24/01/2025, 12:07:58: : Leadscrew adjustments made: 0.715 1.917 0.735, points used 3, (mean, deviation) before (0.464, 0.433) after (-0.000, 0.000)
      24/01/2025, 12:08:33: : Leadscrew adjustments made: 0.283 0.278 0.292, points used 3, (mean, deviation) before (0.290, 0.004) after (-0.000, 0.000)
      24/01/2025, 12:10:09: : Cancelled printing file 0:/gcodes/ONE_P-0026789 v1_0.2mm_PETG_1d13h17m.gcode, print time was 0h 4m
      
      24/01/2025, 12:10:09: : Error: in GCode file line 53: G2: outside machine limits <---------------- this is the error I mean
      

      Gcode;

      ; generated by PrusaSlicer 0.1.0 on 2025-01-23 at 14:07:14 UTC
      
      ; Speed; **
      ; Visual; **
      ; Strengh ;*****
      
      ; external perimeters extrusion width = 0.44mm
      ; perimeters extrusion width = 0.44mm
      ; infill extrusion width = 0.44mm
      ; solid infill extrusion width = 0.44mm
      ; top infill extrusion width = 0.44mm
      ; first layer extrusion width = 0.44mm
      
      M201 X7000 Y7000 Z200 E10000 ; sets maximum accelerations, mm/sec^2
      M203 X24000 Y24000 Z720 E6000 ; sets maximum feedrates, mm / min
      M204 P4000 T5000 ; sets acceleration (P, T), mm/sec^2
      M566 X480.00 Y480.00 Z120.00 E1200.00 ; sets the jerk limits, mm/min
      
      ; printing object P-0026789 v1.stl id:0 copy 0
      ; stop printing object P-0026789 v1.stl id:0 copy 0
      
      ;TYPE:Custom
      ;Prusaslicer section;
      ; Define prusaslicer variables
      
      ; called with M98 P"0:/macros/print-start" 
      M98 P"0:/macros/print-start" A220 B240 C50 D243.852 E356.148 F193.852 H306.148 I1 J"false" K"true" L"FLEX" O"PETG" Q0.4 R0.4 S150 T170
      G21 ; set units to millimeters
      G90 ; use absolute coordinates
      M83 ; use relative distances for extrusion
      ;                                                     Begin toolchange script
      
      
      
      ;                                                     End toolchange script
      T1
      ; Filament gcode
      M107
      ;LAYER_CHANGE
      ;Z:0.2
      ;HEIGHT:0.2
      ; printing object P-0026789 v1.stl id:0 copy 0
      G1 E-.7 F2100
      ; stop printing object P-0026789 v1.stl id:0 copy 0
      G1 Z1.7 F720
      G1 X272.388 Y226.982 F24000
      G1 Z.2 F720
      G1 E.7 F1500
      M204 P2000
      ;TYPE:Skirt/Brim
      ;WIDTH:0.44
      G1 F3300
      G2 X303.244 Y214.197 I27.609 J23.006 E6.30864 ;< ------------- this is line 53, gives the error
      G2 X281.929 Y218.923 I-3.136 J36.289 E.73211
      G2 X272.427 Y226.936 I18.068 J31.065 E.41247
      M204 P4000
      

      Config;

      ;------------------------------ General settings --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
      ; Preferences
      G90             ; send absolute coordinates...
      M83             ; ...but relative extruder moves
      M550 P"one"     ; set printer name
      
      G4 S5
      
      ; Set global variables
      global leftloadedfilament = "PLA"
      global rightloadedfilament = "PLA"
      global leftnozzlesize = "0.40"
      global rightnozzlesize = "0.40"
      global variableprobel = 10000
      global variableprober = 10000
      
      ; Reset probe trigger values on reset
      
      ;------------------------------ Drive and motion --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
      ; Drive & motion definition
      M569 P60.0 S1     								        ; physical drive 60.0 goes backwards (E1)
      M569 P61.0 S0     								        ; physical drive 61.0 goes backwards (E2)
      M569 P0.0 S0      								        ; physical drive 0.0 goes backwards (X)
      M569 P0.1 S0                                            ; physical drive 0.1 goes backwards (Y1)
      M569 P0.4 S1                                            ; physical drive 0.4 goes forwards (Y2)
      M569 P0.5 S0      								        ; physical drive 0.5 goes forwards (U)
      M569 P50.0 S0 D3   								        ; physical drive 50.0 goes forwards (V)
      M569 P51.0 S0 D3       					     	        ; physical drive 51.0 goes forwards (W)
      M569 P1.0 S0    								        ; physical drive 1.0 goes forwards (Z1)
      M569 P1.1 S0   										    ; physical drive 1.1 goes forwards (Z2)
      M569 P1.2 S0                                            ; physical drive 1.2 goes forwards (Z3)
      
      M970 X1 U1 Y1
      
      M584 X0.0 U0.5 Y0.1:0.4 E60.0:61.0 Z1.0:1.1:1.2 V50.0 W51.0     ; set drive mapping
      M669 K11 X1:0:0:0 Y1:1:0:-1 Z0:0:-1:0 U0:0:0:1     		    ; set markforged kinematics
      M350 X16 U16 Y16 Z16 V32 W32 I1                            	; configure axis microstepping with interpolation
      M350 E16:16 I1                                              ; configure extruder microstepping with interpolation
      M92 X80 Y80 Y80 E800:800 Z800.00 V17777.78 W17777.78  ; set steps per mm
      M906 X2100 U2100 Y2100 E580:580 Z1900 V165 W165 I40         ; set motor currents (mA) and motor idle factor in per cent
      M84 S30                                                     ; set idle timeout
      
      ; Machine axis limits
      M208 X-70.5 U0 Y0 Z0 V0 W0 S1                           ; set axis minimal
      M208 X600 U672.5 Y510 Z600 V14 W14 S0                   ; set axis maximal
      
      
      M671 X702.75:300:-102.75 Y47.125:-537.35:47.125 S10     ; Z leadscrews are at (-41,-14), (130,325.5) and (601, -14) and set compensation allowance to 20mm
      
      ;M671 X-102.75:300:702.75 Y-47.125:537.35:-47.125 S10     ; Z leadscrews are at (-102.75,-47.125), (300,537,35) and (702,75, -47,125) and set compensation allowance to 20mm
      
      
      ; Machine movement limits
      M203 X30000 U30000 Y30000 E12000:12000 Z1200 V180 W180     ; set maximum speeds (mm/min)
      M201 X8000 U8000 Y8000 E2500:2500 Z100.00 V2 W2       ; set maximum accelerations (mm/s^2)
      
      ; Machine motion settings
      M593 P"MZV" F37 S0.05                                   ; set ZVD input shaping to cancel ringing at 40.5Hz
      M566 X540 U540 Y540 E1200:1200 Z900 V100 W100           ; set instantaneous speed changes (mm/min)
      M204 P1500 T8000                                       ; set actual accelerations
      
      ;------------------------------ Sensors and inputs ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
      ; Endstops
      M574 X1 S1 P"^!50.io1.in"     ; configure switch-type endstop for low end on X via pin 2.io3.in
      M574 U2 S1 P"^!51.io1.in"     ; configure switch-type endstop for high end on U via pin 2.io1.in
      M574 Y2 S1 P"io2.in"      ; configure switch-type endstop for high end on Y via pin 2.io2.in
      M574 V2 S1 P"50.io0.in"      ; configure switch-type endstop for high end on V via pin 1.io2.in
      M574 W2 S1 P"51.io0.in"      ; configure switch-type endstop for high end on W via pin 1.io3.in
      
      ; Z-Probe
      M558 K0 P11 C"50.temp2" H7:1 F300:120 T21000 A3 S0.05 R1  ; Set E1 Z probe, set dive height, probe speed, required accuracy and travel speed
      set global.variableprobel = {sensors.probes[0].value[0]}+2750
      G31 K0 P{global.variableprobel} X0 Y0 Z-0.45						       ; Set Z offset of E1 probe
      
      
      M558 K1 P11 C"51.temp2" H7:1 F300:120 T21000 A3 S0.05 R1    ; Set E1 Z probe, set dive height, probe speed, required accuracy and travel speed
      set global.variableprober = {sensors.probes[1].value[0]}+2750
      G31 K1 P{global.variableprober} U0 Y0 Z-0.45							       ; Set Z offset of E1 probe
      
      M557 X25:575 Y25:475 P7:5                              ; define mesh grid
      M376 H10
      
      
      ; Filament control buttons
      ;M950 J1 C"2.io2.in"      ; define logical input for E1 filamentsensor
      ;M581 P1 T2 S0 R0         ; define trigger for filament auto load triggers trigger2.g
      ;M950 J2 C"2.io3.in"      ; define logical input for E1 filamentunload
      ;M581 P2 T3 S0 R0         ; define trigger for filament auto unload triggers trigger3.g
      ;M950 J3 C"2.io4.in"      ; define logical input for E2 filamentsensor
      ;M581 P3 T4 S0 R0         ; define trigger for filament auto load triggers trigger4.g
      ;M950 J4 C"2.io5.in"      ; define logical input for E2 filamentunload
      ;M581 P4 T5 S0 R0         ; define trigger for filament auto unload triggers trigger5.g
      
      
      ; Accelerometer inputs
      M955 P"50.0" I16   ; configure accelerometer sensor, set orientation, sampling and resolution
      M955 P"60.0" I46   ; configure accelerometer sensor, set orientation, sampling and resolution
      M955 P"51.0" I16   ; configure accelerometer sensor, set orientation, sampling and resolution
      M955 P"61.0" I46   ; configure accelerometer sensor, set orientation, sampling and resolution
      
      ;------------------------------ Heaters and Fan outputs -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
      
      ; Heaters, Bed zones
      M308 S0 P"temp0" Y"thermistor" A"Bed zone 1" T100000 B3950 	; configure bed zone 1 temperature sensor
      M950 H0 C"out1" T0                           			        ; create bed heater output and map it to correct sensor
      M307 H0 R0.362 K0.500:0.000 D6.39 E1.35 S1.00 B0                ; enable and set PID temperature control for bed zone 1
      M140 P0 H0                                                      ; map bed zone 1 to correct heater
      M143 H0 S120                                                    ; set temperatare limit for heater 0 to 120C
      
      M308 S1 P"temp1" Y"thermistor" A"Bed zone 2" T100000 B3950    ; configure bed zone 2 temperature sensor
      M950 H1 C"out2" T1                           			        ; create bed heater output and map it to correct sensor
      M307 H1 R0.362 K0.500:0.000 D6.39 E1.35 S1.00 B0                ; enable and set PID temperature control for bed zone 2
      M140 P1 H1                                                      ; map bed zone 1 to correct heater
      M143 H1 S120                                                    ; set temperatare limit for heater 1 to 120C
       
      
      ; Heaters, extruder
      M308 S2 P"60.temp0" Y"thermistor" A"Nozzle1"                    ; configure left printhead temperature sensor
      M950 H2 C"60.out0" T2                                           ; create left printhead heater output and map it to correct sensor
      M307 H2 R2.581 K0.635:0.000 D4.58 E1.35 S1.00 B0 V23.7          ; enable and set PID temperature control for left printhead
      M143 H2 P1 S350                                 		        ; set temperature limit for left printhead to 280C
      M572 D0 S0.01                                                   ; set pressure advance for left printhead
      ;M308 S4 P"temp3" Y"thermistor" A"HeatsinkLeft" T100000 B4138
      
      M308 S3 P"61.temp0" Y"pt1000" A"Nozzle2"                           ; configure right printhead temperature sensor
      M950 H3 C"61.out0" T3                                              ; create left printhead heater output and map it to correct sensor
      M307 H3 R2.736 K0.422:0.391 D4.34 E1.35 S1.00 B0 V24.0          ; enable and set PID temperature control for lerightt printhead
      M143 H3 P2 S350                                                 ; set temperature limit for right printhead to 280C
      M572 D1 S0.01                                                   ; set pressure advance for right printhead
      ;M308 S5 P"temp2" Y"thermistor" A"HeatsinkRight" T100000 B4138
      
      ; Fans
      M950 F0 C"60.out1" Q317.5      ; create fan 0 (E1 part) on pin 2.out3 and set its frequency
      M106 P0 S0 H-1 C"Tool1 part"  ; set fan 0 value. Thermostatic control is turned off
      M950 F1 C"61.out1" Q317.5      ; create fan 1 (E2 part) on pin 2.out4 and set its frequency
      M106 P1 S0 H-1 C"Tool2 part"                ; set fan 1 value. Thermostatic control is turned off
      M950 F2 C"60.io0.out" Q500          ; create fan 2 (E1 heat) on pin out5 and set its frequency
      M106 P2 S1 H2 T45:50          ; set fan 2 value. Thermostatic control is turned on
      M106 P2 S1 H2 T45:50 C"Tool1 Heat"  ; set fan 2 value. Thermostatic control is turned on
      M950 F3 C"61.io0.out" Q500          ; create fan 3 (E2 heat) on pin out6 and set its frequency
      M106 P3 S1 H3 T45:50 C"Tool2 Heat"  ; set fan 3 value. Thermostatic control is turned on
      
      M950 F4 C"1.out3" Q500          ; create fan 4 (SBC) on pin out6 and set its frequency
      M106 P4 S1 H-1 C"PC"          ; create fan 4 value. Thermostatic control is turned on
      M950 F5 C"1.out4" Q500          ; create fan 5 (main) on pin out6 and set its frequency
      M106 P5 S1 H-1 C"Mainboard"   ; set fan 0 value. Thermostatic control is turned of
      M950 F6 C"1.out5" Q500        ; create fan 6 (exp1) on pin out6 and set its frequency
      M106 P6 S1 H-1 C"Expansion"              ; set fan 0 value. Thermostatic control is turned off
      
      M950 F8 C"out4" Q500          ; create fan 8 (Extraction) on pin out6 and set its frequency
      M106 P8 S0.1 H-1 C"Extraction"          ; set fan 3 value. Thermostatic control is turned on
      
      ;------------------------------ Miscellaneous -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
      ; Configure chamber LED
      ;M950 F10 C"out3"            ; create chamber LED strip on correct pin
      ;M106 P10 C"LED" S1.0        ; define chamber LED name and set starting value
      
      ; Configure status LED
      M950 F11 C"1.io0.out" Q500     ; create red LED strip on correct pin
      M106 P11 C"RGB Red" S0.0    ; define red LED name and set starting value
      M950 F12 C"1.io1.out" Q500     ; create green LED strip on correct pin
      M106 P12 C"RGB Green" S0.0  ; define green LED name and set starting value
      M950 F13 C"1.io2.out" Q500     ; create blue LED strip on correct pin
      M106 P13 C"RGB Blue" S1.0   ; define blue LED name and set starting value
      
      
      ;------------------------------ Tool definition ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
      ; Tool Left
      M563 P0 S"Left" D0 H2 X0 F0     ; define tool 0
      G10 P0 X0 Y0 Z0                 ; set tool 0 axis offsets
      G10 P0 R0 S0                    ; set initial tool 0 active and standby temperatures to 0C
      
      ; Tool Right
      M563 P1 S"Right" D1 H3 X3 F1    ; define tool 1
      G10 P1 U0 Y0 Z0       ; set tool 1 axis offsets
      G10 P1 R0 S0                    ; set initial tool 1 active and standby temperatures to 0C
      
      ; Tool Duplication
      M563 P2 S"Dulplication" D0:1 H2:3 X0:3 F0:1     ; tool 2 uses both extruders, hot end heaters and fans, and maps X to both X and U
      G10 P2 X150 Y0 U-150 S0 R0                      ; set tool offsets and temperatures
      M567 P2 E1:1                                    ; set mix ratio 100% on both extruders
      
      posted in Beta Firmware
      SanderLPFRGundefined
      SanderLPFRG