Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. Schild0r
    3. Best
    • Profile
    • Following 0
    • Followers 0
    • Topics 13
    • Posts 53
    • Best 8
    • Controversial 0
    • Groups 0

    Best posts made by Schild0r

    • RE: New Input Shaping plugin v3.4.1-b1

      I noticed just today, that this plugin existed. Must have been two days before release or so that I wrote a macro myself for doing this. (see below)

      Turns out I basically hit bullseye by accident with my shaper settings after running my macro and now comparing the results with the plugin, just because I did not know that MZV would dampen two frequency amplitudes and the second one did luckily coincide perfectly with the amplitude of my x-axis

      But the user Interface of the plugin is very good especially the merged frequency analyses of multiple axis and the damping curves preview for the shapers.
      Only thing I would like to add though are inputs for the acceleration and speed at which the accelerometer data is collected.
      Just a little QOL thing with e.g. a tickbox for "use maximum speeds and accelerations from current config" and if you untick it, you can enter your own values so that they are set before starting the sequence automatically instead of the user having to enter them manually before going to the plugin.
      Oh and returning the printhead back to the center position after the last move would not trigger my OCD 😂

      Also a little sidenote if a dev reads this:
      We now have Height Map in the Control tab
      The Accelerometer Viewer in Machine Specific under the Settings tab
      and the Input Shaping Plugin under the Plugins tab
      One could also debate about the G-Code Viewer (I personally like it under the Job tab) but at least the above three (and maybe even the Object Model browser) are pretty similar and thus should be under the same tab IMO.
      Please feel free to discuss my opinion though.

      the macro if anyone is interested:

      var origXAccel = move.axes[0].acceleration
      var origYAccel = move.axes[1].acceleration
      var feedrate = move.axes[0].speed
      
      if exists(param.F)
      	set var.feedrate = {param.F}
      	echo "speed for accelerometer data collection:", {var.feedrate/60}, "mm/s"
      else
      	echo "param.F not provided, instead maximum speed (X) is used for accelerometer data collection:", {var.feedrate/60}, "mm/s"
      
      G28
      G1 X{move.axes[0].max/2} Y{move.axes[1].max/2} F9000
      
      if exists(param.A)
      	echo "setting X and Y acceleration to", {param.A}, "mm/s^2"
      	M201 X{param.A} Y{param.A}
      	M201
      else
      	echo "param.A not provided, using current accelerations X:", {var.origXAccel}, "mm/s^2, Y:", {var.origXAccel}, "mm/s^2"
      
      echo "collecting acceleration data for X-Axis"
      G91 ; relative positioning
      G1 X-50 F9000
      G4 S2 
      M956 P21.0 S1000 A1 F"inputShapingX.csv"
      G1 X100 F{var.feedrate} 
      G4 S2
      
      echo "collecting acceleration data for Y-Axis"
      G1 X-50 Y-50 F9000
      G4 S2 
      M956 P21.0 S1000 A1 F"inputShapingY.csv"
      G1 Y100 F{var.feedrate} 
      G4 S2
      G1 Y-50 F9000
      G90 ; absolute positioning
      
      if exists(param.A)
      	echo "reverting changes in acceleration"
      	M201 X{var.origXAccel} Y{var.origYAccel}
      	M201
      
      posted in Plugins for DWC and DSF
      Schild0rundefined
      Schild0r
    • RE: PSU toggle based on printer status condition

      My solution for now if anyone is interested

      if state.status == "off"
        M81
      elif state.status == "busy"                                        ; state can't be idle because controller is busy running this macro
        M400                                                             ; wait for all movement to stop
        if heat.heaters[1].current < fans[1].thermostatic.lowTemperature ; check for all tool based thermostatic fans to be off
          M80
        else
          M291 R"Prohibited" P"PSU toggle is only allowed in standby or idle state! Wait for cooldown of hotend."
      else
        M291 R"Prohibited" P"PSU toggle is only allowed in standby or idle state!"
      
      posted in Gcode meta commands
      Schild0rundefined
      Schild0r
    • Save stealthChop2 auto tune parameters to read on startup

      I just got StealthChop2 working on my Duet 3 with this macro which includes the automatic tuning sequence on X and Y

      ; enable_stealthChop2.g
      ; sets stealthChop2 parameters and uses a homing sequence for the driver to automatically tune its current regulation parameters
      ; default stealthChop2 parameters (for standstill noise reduction) are tpwmthrs(V)=2000, thigh(H)=200, tcoolthrs(T)=2000
      ; stealthChop2 tested (under no printing conditions) flawlessly up to 150mm/s (higher speeds not yet tested)
       
      ;homing x and y in default mode of operation
      G91                                                               ; relative positioning
      ;G1 H2 Z5 F240                                                    ; lift z 5mm relative to current position ;enable when using this macro in conjunction with z homing
      G1 H1 X{-move.axes[0].max-5} Y{move.axes[1].max+5} F3600          ; move quickly to x or y endstop and stop there
      G1 H1 X{-move.axes[0].max-5}                                      ; home x
      G1 H1 Y{move.axes[1].max+5}                                       ; home y
      G1 X5 Y-5                                                         ; back up 5mm
      G1 H1 X{-move.axes[0].max-5} F360                                 ; home x slowly (second pass)
      G1 H1 Y{move.axes[1].max+5}                                       ; home y slowly (second pass)
      M400                                                              ; wait for moves to finish
       
      ;enable stealthChop2 and tuning step AT#1
      M18 X Y                                                           ; disable x and y steppers
      M569 P0.0 D3 V0 H0                                                ; enable stealthchop and set tpwmthrs and thigh for X
      M569 P0.1 D3 V0 H0                                                ; enable stealthchop and set tpwmthrs and thigh for Y
      M915 P0.0 T0                                                      ; set tcoolthrs for X
      M915 P0.1 T0                                                      ; set tcoolthrs for Y
      M17 X Y                                                           ; enable x and y steppers with full run current
      G4 P150                                                           ; pause for 150ms to satisfy AT1 condition
      G92 X{move.axes[0].min} Y{move.axes[1].max}                       ; set home positions again after position loss due to M18
      G90                                                               ; absolute positioning
       
      ;tuning step AT#2
      G1 Y{move.axes[1].max/2} F6000                                    ; tuning move at "typical speed" that is a straight line in order to move both steppers (CoreXY) significantly i.e. >400 full steps @ 60-300RPM ->F(150RPM*beltpitch*pulleyteeth)
      G1 X{move.axes[0].max/2}                                          ; move to bed center
      

      (stealthChop2 runs very stable up to 150mm and beyond, thus I set the H V and T parameter to 0 so that the drivers will exclusively run in stealthChop2)

      After running the macro the values of pwmOfsAuto and pwmGradAuto differ from the values they have on startup. In the TMC5160 datasheet says that these values could be saved to pwmOfs and pwmGrad in the driver register as starting points for the automatic tuning process when starting up the machine. I figure with these values set I could set all the stealthChop2 parameters in the config and spare running my macro from above...
      Is there a way we can do that? Maybe with the M569 C parameter? If so what would the C value be exactly?

      If this helps here is a table of the register these values reside in:
      Screenshot_20220119-190601.jpg

      posted in Tuning and tweaking
      Schild0rundefined
      Schild0r
    • RE: Macro trigger firing randomly

      So with try and error I found out that the problem has something to do with the cable that is running from the backpanel to the emergency off switch. It is a cable with 7 wires (7x1.5mm²) that are running mains voltage L and N to and from the switch (2 NC contacts) as well as the reset signal/macro trigger to and from the switch (NO contact) plus one PE line to connect the front of the frame to the mounting plate.
      So either it was indeed interference from 230V mains voltage that was able to pull the 3.3V from the input pin 27k pullup to GND or it had to to with the wire cross section transitioning from 0.34mm² (from the input port) to 1.5mm² for the 7 wire cable in a terminal.

      I now replaced the 7x1.5mm² cable with a 5x1.5mm² one plus one 2x0.34mm² shielded cable for just the reset signal and haven't had the described behaviour since.

      posted in Duet Hardware and wiring
      Schild0rundefined
      Schild0r
    • RE: Makro with variables

      @suntoxx I am not 100% sure if I understood everything correctly but you could just use the filament logic of RRF to set for example z offsets on a per filament basis in the config.g file of the respective filament (see filaments) and then put M703 in your start gcode before homing

      posted in Using Duet Controllers
      Schild0rundefined
      Schild0r
    • RE: checking STATUS

      When your printer is running tfree.g it is not idle but busy (with running the tfree.g macro). Had the same problem when writing my power toggle macro.

      Haven't found an elegant solution to this though... Instead I had to query if the printer is 'busy' but that all heaters are off and so on. If someone knows a way to query the state the printer had before the macro was triggered, please tag me 😉

      posted in General Discussion
      Schild0rundefined
      Schild0r
    • RE: Makro with variables

      @suntoxx said in Makro with variables:

      Isn't that a bit too little? I haven't tried that many filaments yet, so I do not know for sure. But is the optimal offset for all PLAs the same? Regular PLA, matte, silk, PLA that prints at 195°C and PLA that prints at 230°?

      I am using one single z offset globaly and this works fine for me... but as engikeneer said, you could just create a filament profile for every roll of filament you buy.

      @suntoxx said in Makro with variables:

      I think a macro would be more comfortable. If I change an offset value for a material, I could do so in one central place and it affacts all the profiles i want and in all slicers. Plus it would also affect already compiled .gcode files, as long as they already call for that macro. At least in theory, that looks good to me.
      What's the best way to do this?

      Just put the offset (whether it is babystepping or just the trigger offset of your probe/endstop) into the config file of each filament. As long as you then call M703 somewhere in your start gcode, the firmware will always run the config file of the filament that (it thinks) is loaded.

      e.G. That way you could also put your printing temperatures in the config file of the filament and just use a single "default" filament in your slicer with generic temperature values. Then when your print starts and calls M703, the filament config with your offset and temperatures (and PID tunes and fan curves and and pressure advance tunes .etc for that filament) will be loaded.

      posted in Using Duet Controllers
      Schild0rundefined
      Schild0r
    • RE: Makro with variables

      @engikeneer said in Makro with variables:

      @suntoxx you select the filament that you have loaded with a dropdown in DWC. That way it is not at all embedded in the gcode file s9 you can use the same file for multiple different filaments

      ...the same * Slicer Filament Setting * for multiple different filaments.

      As long as you set everything (temperatures, fan speeds, offsets,...) in the RRF filament config. You only need to call M703 for that to apply (regardless of the filament that is being loaded)

      @sunToxx you can edit a comment btw 😉

      posted in Using Duet Controllers
      Schild0rundefined
      Schild0r