Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    config-user.g overwritten with config.g contents

    Scheduled Pinned Locked Moved
    General Discussion
    2
    3
    138
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gnydickundefined
      gnydick
      last edited by gnydick

      I don't know what happened, but things started acting funny, I checked and my config-user.g file now has older contents of config.g. This isn't manual error. I've not done any renaming, full copy & paste, etc. I literally just homed my machine 20 minutes ago, and now it doesn't work because there is no more probe defined as it was in config-user.g.

      So now I've lost my lead screw positions, mesh config, z probe, etc.

      I'm on 3.5.3 + SBC, duet 6HC

      T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
      • T3P3Tonyundefined
        T3P3Tony administrators @gnydick
        last edited by

        @gnydick AFAIK config-user.g is not a system generated/modified file (unlike, say config-override.g). I can't see a mechanism that would lead to it be replaced with an older version automatically.

        As an aside I have seen config-user.g mentioned once or twice in config.g files. Do you know what the provence of doing it that way is?

        www.duet3d.com

        gnydickundefined 1 Reply Last reply Reply Quote 0
        • gnydickundefined
          gnydick @T3P3Tony
          last edited by

          @T3P3Tony I can understand the thoughts on config-user.g not being a system file, so I'm guessing it was a DWC bug.

          The config-user.g is good for settings you may want to frequently tweak after boot, that are safe to reload at any time. Having a reload_config-user macro usually accompanies it. I personally have a number of additional files

          axis-limits.g: I have kinematics that get tweaked frequently so i will reload that
          tools.g: this sets all of the kinematic configs for the tools.
          macros/tfree|tpre|tpost: these have all of the common movements for all of the tools. these macros take parameters so any movement lengths only need to be provided in the tfree_.g, tpre_.g, and tpost_.g files, like `M98 P"/macros/tools/tfree.g"

          It took me a lot of work to get this all working smoothly. But now I have a lot of safety measures built in with docking sensors, "coupler homed?", temperature thresholds.

          Examples

          tfree0.g

          ; tfree0.g
          
          ; Common routine
          M98 P"/macros/tools/tfree" X3.0 Y20.0 ; X param is how far from the end of X axis to go to pick up the tool , Y param is absolute Y position to pick up the tool
          

          tpre0.g

          ; tpre0.g
          
          M98 P"/macros/tools/tpre" X3.0 Y20.0 ; move into position, same params as tfree
          

          tpost0.g

          ; tpost0.g
          
          M98 P"/macros/tools/tpost" A0.037 ; A param is pressure advance setting
          M593 P"zvddd" F52.8 S.1 ; enable input shaping
          

          and the macros they call

          /macros/tools/tfree

          ; tfreeN
          ; called when tool N is freed
          ;
          
          var t = state.currentTool
          var heaterIndex = state.currentTool + 1
          var x = param.X
          var y = param.Y
          var xMax = move.axes[0].max - var.x
          
          var sensor_index = var.t + 10
          
          var dock0 = sensors.gpIn[10].value
          var dock1 = sensors.gpIn[11].value
          var dock2 = sensors.gpIn[12].value
          var dock3 = sensors.gpIn[13].value
          
          var undockedTools = ""
          var cancelMessage = "Too many undocked tools: "
          
          if { var.dock0 == 0 }
              set var.undockedTools = var.undockedTools ^ "1"
              set var.cancelMessage = var.cancelMessage ^ "0"
          if { var.dock1 == 0 }
              set var.undockedTools = var.undockedTools ^ "1"
              if #var.undockedTools > 0
                  set var.cancelMessage = var.cancelMessage ^ ", "     
              set var.cancelMessage = var.cancelMessage ^ "1"
          if { var.dock2 == 0 }
              set var.undockedTools = var.undockedTools ^ "1"
              if #var.undockedTools > 0
                  set var.cancelMessage = var.cancelMessage ^ ", "     
              set var.cancelMessage = var.cancelMessage ^ "2"
          if { var.dock3 == 0 }
              set var.undockedTools = var.undockedTools ^ "1"
              if #var.undockedTools > 0
                  set var.cancelMessage = var.cancelMessage ^ ", "     
              set var.cancelMessage = var.cancelMessage ^ "3"
          
          
          if exists(param.S)
              set var.undockedTools = "1"
          
          if #var.undockedTools > 1
              
              M291 P{var.cancelMessage}
          
          else 
          
          
          
              G60 S0
              if {heat.heaters[var.heaterIndex].current} > 170	
                  G1 E-5 F6000
                  G91
                  G1 Z1
                  G90
          
              G53 G1 Y{var.y} F12000
              G53 G1 X380 F12000
              G53 G1 X{var.xMax} F2000
          
              M106 P{var.t + 1} S0
          
              ;Open Coupler
              M98 P"/macros/tool_unlock"
          
          
              ;Move Out
              G53 G1 X380 F12000
              G53 G1 X330 F12000
              M400
          
              M593 P"none"  ; disable input shaping
          

          /macros/tools/tpre

          ; tpre
          ; called before tool 1 is selected
          
          ;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!
          var t = state.nextTool
          var heaterIndex = var.t + 1
          var x = param.X
          var y = param.Y
          var xMax = move.axes[0].max - var.x
          
          
          
          var dock0 = sensors.gpIn[10].value
          var dock1 = sensors.gpIn[11].value
          var dock2 = sensors.gpIn[12].value
          var dock3 = sensors.gpIn[13].value
          
          if { var.dock0 == 1 && var.dock1 == 1 && var.dock2 == 1 && var.dock3 == 1 }
          	if tools[var.t].state != "active"
          		var message = "Activating Tool " ^ var.t
          		M118 S{var.message}
          		M98 P"/macros/tools/safeZ"
          
          
          		;Move In
          		G53 G1 X300 F12000
          		G53 G1 Y{var.y} F12000
          		G53 G1 X380 F12000
          		G53 G1 X{var.xMax} F1800
          		M98 P"/macros/tool_lock"	;Close Coupler
          		G53 G1 X397 F900
          
          	M400
          
          else
          	T-1 P0
          

          /macros/tools/tpost

          ; tpost0.g
          ; called after tool 0 has been selected
          
          var t = state.currentTool
          var sensorIndex = state.currentTool + 10
          var heaterIndex = state.currentTool + 1
          var a = param.A
          
          
          
          var docked = sensors.gpIn[var.sensorIndex].value
          
          if exists(param.S)
          	set var.docked = 0
          if var.docked == 0
          	G91
          	G1 X-60 F1800
          	G1 X-40 F6000
          	G90
          	M116 P{var.t}
          	if {heat.heaters[var.heaterIndex].current} > 170		
          		M98 P"/macros/tools/wipe_tall"
          	else
          		G91
          		G1 X-100 F6000
          		G90
          
          	M400	
          	M572 D{var.t} S{var.a}
          	; enable fan if it was running
          	M106 R2
          else
          	T-1 P0
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA