Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. DonStauffer
    • Profile
    • Following 0
    • Followers 0
    • Topics 57
    • Posts 405
    • Best 29
    • Controversial 0
    • Groups 0

    DonStauffer

    @DonStauffer

    47
    Reputation
    23
    Profile views
    405
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    DonStauffer Unfollow Follow

    Best posts made by DonStauffer

    • My Pressure Advance Calibration

      I wrote some GCode to calibrate pressure advance. I wasn't satisfied with how uncertain I was in reading the other ones I found. They usually try various PA values as a sort of gradient, which sounds fine until you have other artifacts confusing the issue. It also requires some effort to convert the measured height into a k value in many cases.

      But what most lacked entirely is a "normal" reference adjacent to each test value. I produced this reference by first laying down some lines at a very slow, steady speed, then putting the test lines right next to it. The picture doesn't quite show how much easier this is to read; I think I succeeded in what I was trying to do. Once removed from the bed, you can try various lighting, including back lighting.

      Features:

      Only 2 layers, so it doesn't take long.
      Raft, so it's not sensitive to initial nozzle height.
      Controlled by variables set at the beginning of the code.
      PA test values separated by configurable space, so you can read just by counting bands.
      Configurable number of lines in each band.
      Configurable for machines with multiple tools.
      Configurable speeds, temperatures, retraction, layer height & width, bed position, and of course, k values for PA.
      

      242192803_288063902757988_2824346948475361497_n.jpg

      Pictured is eSun Fire Engine Red PETG on an E3DV6 (my secondary hot end) at 243°, k values from 0.05 (bottom) to 0.25 (top), increasing 0.01 each band. The bottom of each band is 4 lines at 1,200mm/min. The top of each band is 4 lines of 35mm on each side at 1,200mm/min sandwiching 70mm at 6,000mm/min in the center.
      In my experience you can use something like this to find the general value, then do another print with fewer bands and more lines per band to confirm the best k value. My best band on this is the 8th from the bottom, so I'm using k=0.12.

      undefinedThis code uses RFF 3.x meta-commands, so it's for Duet hardware. Further, RFF 3.3 and earlier have a bug which doesn't end the lifetime of local variables when a job ends or gets canceled, so you have to do an M999, an emergency stop, or cycle the power between attempts. This will be fixed in RFF 3.4, which has been in beta for several weeks, so it should be out soon.

      Please consider this "copylefted".

      ;	set variables
      
      var StartX = 50
      var StartY = 50
      var LinesPerTest = 4
      var LinesBetweenTests = 4
      
      var TempBed = 74
      var TempTool = 243
      
      var ToolNum = 1
      var Width = 0.48
      var Height = 0.25
      var Retract = 1
      var Prime = 7.9	;	Before Raft
      
      var PALow = 0.05
      var PAHigh = 0.25
      var PAIncrement = 0.01
      
      var SpeedRaft = 2000
      var SpeedSlow = 1200
      var SpeedFast = 6000
      var SpeedTravelXY = 9000
      var SpeedTravelZ = 1200
      var SpeedRetract = 4500
      
      ;	Calculated and Utility Variables
      
      var TestCount = 1 + floor((var.PAHigh - var.PALow) / var.PAIncrement + 0.5)
      var FilFactor = var.Width * var.Height / (pi * 1.75 * 1.75 / 4)
      var PA = var.PALow - var.PAIncrement
      var Dist = 0
      
      ;	PREPARE
      
      ;M42 P1 S1	;	Lights Bright
      
      T{var.ToolNum}
      M82	;	Extruder Absolute Mode
      
      ;	Heat Bed and set Hot Ends to Standby
      
      M400
      M117 "Heat"
      
      M140 S{var.TempBed}				;	set Bed Temp
      
      M568 P{var.ToolNum} S{var.TempTool} A2	;	set Tool Temp
      M116 H{var.ToolNum + 1} S1			;	Wait for temp
      
      G4 S12					;	Delay to Allow for Overshoot
      M116 H{var.ToolNum + 1} S1		;	Wait for Recovery
      
      M116 H0 S1					;	Wait for Bed
      
      M400
      M117 "Home"
      
      G28
      
      ;	BEGIN RAFT
      
      M400
      M117 "Raft"
      
      ;	Go to StartX + Width, StartY
      
      G90	;	Absolute
      
      G92 E0
      G0 E{-var.Retract} F{var.SpeedRetract}
      
      G1 X{var.StartX + var.Width} Y{var.StartY} F{var.SpeedTravelXY}
      G1 Z{var.Height} F{var.SpeedTravelZ}
      
      G91	;	Relative
      
      ;	Prime
      
      G0 E{var.Prime} F{var.SpeedRetract}
      G92 E0
      
      var RaftLineCount = floor((floor(139 / var.Width) - 1) / 3) + 1
      set var.Dist = (2 * var.TestCount * var.LinesPerTest + var.LinesBetweenTests * (var.TestCount - 1)) * var.Width
      
      while iterations < var.RaftLineCount
      	
      	;	Draw Raft Line
      	
      	G0 Y{var.Dist} E{abs(var.Dist) * var.FilFactor} F{var.SpeedRaft}
      	G92 E0
      	
      	;	Break here if last time
      
      	if iterations + 1 >= var.RaftLineCount
      		break
      
      	;	Move Over
      
      	G0 X{3 * var.Width} E{3 * var.Width * var.FilFactor} F{var.SpeedRaft}
      	G92 E0
      
      	set var.Dist = -var.Dist
      
      G0 E{-var.Retract} F{var.SpeedRetract}	;	Retract
      
      ;	BEGIN TEST PATTERN
      
      M400
      M117 "Test Pattern"
      
      ;	Go to StartX, StartY
      
      G90	;	Absolute
      
      G1 Z{2 * var.Height} F{var.SpeedTravelZ}
      G1 X{var.StartX} Y{var.StartY} F{var.SpeedTravelXY}
      
      G91	;	Relative
      
      while iterations < var.TestCount
      
      	;	set PA
      
      	set var.PA = var.PA + var.PAIncrement
      	M572 D{var.ToolNum} S{var.PA}
      	echo "PA=",{var.PA}
      	
      	;	Draw Reference Lines
      
      	while iterations < var.LinesPerTest
      
      		G0 E0 F{var.SpeedRetract}		;	Unretract
      		G0 X140 F{var.SpeedSlow} E{140 * var.FilFactor}
      
      		G92 E0
      		G0 E{-var.Retract} F{var.SpeedRetract}	;	Retract
      
      		G1 Y{var.Width} F{var.SpeedTravelXY}
      		G1 X-140 F{var.SpeedTravelXY}
      
      	;	Draw Test Lines
      
      	while iterations < var.LinesPerTest
      	
      		G0 E0 F{var.SpeedRetract}		;	Unretract
      
      		G0 X35 F{var.SpeedSlow} E{35 * var.FilFactor}
      		G0 X70 F{var.SpeedFast} E{105 * var.FilFactor}
      		G0 X35 F{var.SpeedSlow} E{140 * var.FilFactor}
      
      		G92 E0
      		G0 E{-var.Retract} F{var.SpeedRetract}	;	Retract
      
      		G1 Y{var.Width} F{var.SpeedTravelXY}
      		G1 X-140 F{var.SpeedTravelXY}
      
      	;	Move to start of next comparison
      
      	G1 Y{var.LinesBetweenTests * var.Width} F{var.SpeedTravelXY}
      
      ;	Finish up
      
      M400
      M117 "Done"
      
      G1 Z10 F{var.SpeedTravelZ}
      
      G90					;	Absolute
      
      G1 X10 Y280 F{var.SpeedTravelXY}
      
      G0 E0	 F{var.SpeedRetract}		;	Unretract
      
      
      posted in Tuning and tweaking
      DonStaufferundefined
      DonStauffer
    • Thank You For Variables!

      Variables are an especially powerful feature that opens up huge new possibilities. I'm really enjoying having them. It's like when the Wizard Of Oz suddenly changed from black and white to color.

      Arrays are the icing on the cake. Combined with the object model so many things are possible!

      The implementation has been excellent too. Once I got used to the syntax it works fine.

      Thank you! Well done!

      posted in Gcode meta commands
      DonStaufferundefined
      DonStauffer
    • NeoPixel driver results

      I've had good results so far with the NeoDriver.

      In order to get around the inability to use M150 to control NeoPixels during printer moves, I got the $7.50 Adafruit NeoDriver card, which receives instructions for the NeoPixels via I2C, and takes care of the critical timing issue for controlling the NeoPixels.

      I have it working now, using M260 to send I2C transactions. It seems to work fine, although I haven't yet had time to test it during printer moves. I think G29 will be my first attempt.

      Once I got the correct transactions, it works as easily as M150 did, though quite differently. As expected, it's slower, but perfectly adequate for progress bars and the like. I'd say an update takes about 100ms. So my chasers go kind of at a moderate speed, not like greased lightning. That's fine for my purposes.

      I'll update this when I have tested during moves. Hopefully the daemon will still operate during moves. That's my main concern.

      Initialization script (run once - maybe from config.g):

      ;   Initializes NeoDriver and turns off LEDs
      
      var FUNC_REGISTER_PIN = 0x01
      var FUNC_REGISTER_SPEED = 0x02
      var FUNC_REGISTER_BUF_LENGTH = 0x03
      ;var FUNC_REGISTER_BUF = 0x04
      ;var FUNC_REGISTER_SHOW = 0x05
      
      var BASE_ADDR_NEO_PIX = 0x0E
      
      ;   Parameters
      
      var I2CAddress = 0x60
      var NeoPixelPinNum = 0x0F
      var LEDCount = 28
      
      if exists(param.A)
          set var.I2CAddress = param.A
      
      if exists(param.N)
          set var.NeoPixelPinNum = param.N
      
      if exists(param.L)
          set var.LEDCount = param.L
      
      ;   Set NeoDriver pin #, speed = 800,000, Buffer size
      
      var BufferSize = 3 * var.LEDCount
      
      M260 A{var.I2CAddress} B{var.BASE_ADDR_NEO_PIX,var.FUNC_REGISTER_PIN,var.NeoPixelPinNum}
      M260 A{var.I2CAddress} B{var.BASE_ADDR_NEO_PIX,var.FUNC_REGISTER_SPEED,1}
      M260 A{var.I2CAddress} B{var.BASE_ADDR_NEO_PIX,var.FUNC_REGISTER_BUF_LENGTH,var.BufferSize,0}
      
      ;   Turn all LEDs off
      
      M98 P"/macros/Lights/NeoPixel/SetNeoPix"
      M98 P"/macros/Lights/NeoPixel/ShowNeoPix"
      
      posted in General Discussion
      DonStaufferundefined
      DonStauffer
    • M150 with NeoPixels

      This statement, coupled with some wrong information out on the internet which uses the word "scroll" incorrectly, creates a confusing situation. It took me about a day to sort it out:

      "The specified RGB values will be sent to the number of LEDs in the LED strip as specified by the S parameter, pushing the existing colours along the strip. To set all the LEDs the same colour, make the S parameter equal to or a little longer than the number of LEDs in the strip."

      Strictly speaking, it is not correct that anything "pushes existing colors along the strip". That doesn't happen, ever.

      What happens is: After an M150 F0 command, the M150 commands append to one another, in order, not changing what's displayed, until another M150 F0 is reached. Then the whole string of appended new LED values (including the ones in the new M150 F0) get displayed, starting at the beginning of the strip. Only as many LEDs as those statements specified get changed, leaving any LEDs further along the strip with their prior values.

      There is no "scrolling" or "pushing existing colors along". The new values simply "overwrite" existing ones, from the beginning of the strip, and only as far as they "need" to, and it doesn't happen visibly until the M150 F0.

      A chaser, first lighting LEDs in a line, then darkening them in the same direction, would look like this (tested on 10 LED NeoPixel stick):

      M150 P0 S10 F0 E0	;	Turn entire strip off
      
      while iterations < 10
      	M150 R255 U0 B0 P32 S{iterations+1} F0 E0
      	G4 P20
      
      while iterations < 9
      	M150 R0 U0 B0 P0 S{iterations + 1} F1 E0
      	M150 R255 U0 B0 P32 S{9 - iterations} F0 E0
      	G4 P20
      
      M150 R0 U0 B0 P0 S10 F0 E0	;	Turn entire strip off
      
      

      433262322_7201834966538170_4235366852098968886_n.mp4

      posted in Documentation
      DonStaufferundefined
      DonStauffer
    • RE: Center Dot Character in macros

      @phaedrux The macro creates a few hundred short macros which support a system I developed to control printer settings on a feature level (solid fill, infill, supports, etc.) rather than just a layer level. So, you can set your outer perimeter to use a different fan setting than solid fill, for example.

      posted in Duet Web Control
      DonStaufferundefined
      DonStauffer
    • RE: Z-axis / tramming issues with 3.6.0-alpha2+3

      @Exerqtor One of my Z steppers now adjusts in the wrong direction for G32. It's not that it has reversed direction in general, because other things work. But I can't level the bed. Every time it finds that point to be off, it moves it in the other direction and then the next time around it's off by twice as much. Kind of a problem.

      Update: I've been trying to mess with it to get it level again and now my head has also hit the bed. This is a Railcore with 3 Z steppers, and #7 seem to be randomly reversing directions or not moving with the others. It's gotten to the point where I can't even do a home.

      I can't really revert to 3.5 because the memory issues will keep me from working, and I can't use this version because I can't manage the bed because probing doesn't work right. So I'm completely down right now until a new version comes out.

      Update 2: Now I'm getting Warning: Driver 7 warning: phase B may be disconnected

      posted in Beta Firmware
      DonStaufferundefined
      DonStauffer
    • RE: File exists check

      @phaedrux I found a very awkward workaround: M471 is the only code I know of which returns a result that tells you something about the existence of a file. Unfortunately, it does that when potentially deleting the file in question. I didn't want that, so I had to set up a system of dummy "semaphor" files created in parallel with the file I was interested in, which fortunately my macros created, so it could keep the semaphors consistent with the actual file status.

      But all that turned what would have been about a half page of code with a file exists capability into about 2 pages.

      posted in Firmware wishlist
      DonStaufferundefined
      DonStauffer
    • RE: Global Variable Question

      @dc42 My testing in error. exists() works fine.

      posted in Gcode meta commands
      DonStaufferundefined
      DonStauffer
    • RE: Vertical banding on COREXY machine

      @fcwilt I don't really have a theory. But I'm running out of moving parts to replace. So I'm frustrated and uncertain.

      posted in Tuning and tweaking
      DonStaufferundefined
      DonStauffer
    • RE: Center Dot Character in macros

      @dc42 Perfect, thanks! This worked:

      Private Const CENTER_DOT_CHAR As String = "·"

      Public Sub Test()
      Dim sFilename As String
      sFilename = "C:\Users\Don\3D Printing\Software\Slicing\FeatureSettings\TestDot"
      Dim fsT As Object
      Set fsT = CreateObject("ADODB.Stream")
      fsT.Type = 2 'Specify stream type - we want To save text/string data.
      fsT.Charset = "utf-8" 'Specify charset For the source text data.
      fsT.Open 'Open the stream And write binary data To the object
      fsT.WriteText ";special characters: " & String(10, CENTER_DOT_CHAR)
      fsT.SaveToFile sFilename, 2 'Save binary data To disk

      End Sub

      posted in Duet Web Control
      DonStaufferundefined
      DonStauffer

    Latest posts made by DonStauffer

    • Failed to retrieve WiFi status message

      Had an internet problem, so I cycled the power on my router. Internet is up again, but the PanelDue flashes this message over and over and the DWC won't connect. I'm in the middle of a print, so I can't cycle the Duet 2 WiFi (3.6.0 alpha 2 I think) power right now. I hope this message being repeated constantly doesn't eventually crash the Duet. I don't see a way to stop it. This is a bit concerning since I have no emergency stop except turning the power off.

      https://drive.google.com/file/d/1LCv6xmfYNOJrZTD_DPjfoaHpMnVHaB1b/view?usp=sharing

      posted in Duet Web Control
      DonStaufferundefined
      DonStauffer
    • RE: RGBW Neopixel on duet 2 wifi

      @Woody78 Be aware that on the Duet 2 M150 will only work when there is no movement of the printer carriage. The workaround I'm using is the Adafruit NeoDriver card, which works by I2C communication between Duet and NeoDriver, so you use M260 instead of M150. It's not fast, so you won't get fancy stuff, but it works for progress metering adequately, I think.

      If you use the NeoDriver, be aware that although the NeoDriver has pull-up resistors built in, you have to add your own too. I think 4.7 k ohm, but in theory that depends on how long your I2C wiring is. The resistors go from 5V+ to each of the I2C lines (data and clock). Before I added pull-up resistors I was getting intermittent "I2C Transmission Error" problems.

      Using the NeoDriver, you don't need the voltage level shifter circuit.

      posted in Beta Firmware
      DonStaufferundefined
      DonStauffer
    • RE: M300 Behavior is Inconsistent in 3.5

      @curieos I've never been able to get M300 to work right, no matter what I do. It's just broken.

      posted in Firmware installation
      DonStaufferundefined
      DonStauffer
    • RE: Bed PID Tuning: How long should it take?

      @Phaedrux Would it? I would think the wattage might affect it, but I don't see why voltage would.

      posted in Tuning and tweaking
      DonStaufferundefined
      DonStauffer
    • RE: Wifi/DWC Disconnecting with RRF3.5.2 on Duet2 Wifi Hardware

      @rechrtb Immediately after a disconnect this morning:

      10/3/2024, 11:20:49 AM 	M122
      === Diagnostics ===
      RepRapFirmware for Duet 2 WiFi/Ethernet version 3.6.0-alpha.4 (2024-08-13 15:11:39) running on Duet WiFi 1.02 or later + DueX5
      Board ID: 08DGM-9T6BU-FG3SN-6JKD0-3S06Q-9AY7D
      Used output buffers: 3 of 26 (24 max)
      === RTOS ===
      Static ram: 23368
      Dynamic ram: 70472 of which 0 recycled
      Never used RAM 22036, free system stack 122 words
      Tasks: NETWORK(1,ready,13.6%,222) HEAT(3,nWait 5,0.1%,328) Move(4,nWait 5,0.0%,286) DUEX(5,nWait 5,0.0%,23) MAIN(1,running,85.4%,610) IDLE(0,ready,0.9%,29), total 100.0%
      Owned mutexes:
      === Platform ===
      Last reset 01:19:41 ago, cause: power up
      Last software reset at 2024-09-21 14:08, reason: User, Gcodes spinning, available RAM 13020, slot 0
      Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a
      Error status: 0x08
      Aux0 errors 0,3,0
      MCU temperature: min 33.2, current 48.3, max 48.7
      Supply voltage: min 23.8, current 24.2, max 24.4, under voltage events: 0, over voltage events: 0, power good: yes
      Heap OK, handles allocated/used 99/56, heap memory allocated/used/recyclable 4096/3124/1496, gc cycles 1004
      Events: 0 queued, 0 completed
      Date/time: 2024-10-03 11:20:48
      Slowest loop: 45.92ms; fastest: 0.10ms
      I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0
      === Storage ===
      Free file entries: 8
      SD card 0 detected, interface speed: 20.0MBytes/sec
      SD card longest read time 9.4ms, write time 0.0ms, max retries 0
      === Move ===
      Segments created 6, maxWait 3515020ms, bed comp in use: none, height map offset 0.000, hiccups added 0 (0.00ms), max steps late 0, ebfmin 0.00, ebfmax 0.00, mcet 0.016
      Pos req/act/dcf: 60000.00/60000/0.00 0.00/0/0.00 13592.00/13592/0.00
      no step interrupt scheduled
      Driver 0: standstill, SG min 0
      Driver 1: standstill, SG min 0
      Driver 2: standstill, SG min n/a
      Driver 3: standstill, SG min 0
      Driver 4: standstill, SG min n/a
      Driver 5: standstill, SG min 0
      Driver 6: standstill, SG min 0
      Driver 7: standstill, SG min 0
      Driver 8: standstill, SG min n/a
      Driver 9: standstill, SG min n/a
      Driver 10: 
      Driver 11: 
      === DDARing 0 ===
      Scheduled moves 66, completed 66, LaErrors 0, Underruns [0, 0, 0]
      === Heat ===
      Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0
      Heater 0 is on, I-accum = 0.0
      === GCodes ===
      Movement locks held by null
      HTTP is idle in state(s) 0
      Telnet is idle in state(s) 0
      File is idle in state(s) 0
      USB is idle in state(s) 0
      Aux is idle in state(s) 0
      Trigger is idle in state(s) 0
      Queue is idle in state(s) 0
      LCD is idle in state(s) 0
      Daemon is idle in state(s) 0 0 0, running macro
      Autopause is idle in state(s) 0
      Q0 segments left 0
      Code queue 0 is empty
      === Filament sensors ===
      check 0 clear 25429311
      Extruder 0 sensor: no data received
      Extruder 1 sensor: no data received
      === DueX ===
      Read count 1, 0.01 reads/min
      === Network ===
      Slowest loop: 13.13ms; fastest: 0.00ms
      Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)
      HTTP sessions: 1 of 8
      === WiFi ===
      Interface state: active
      Module is connected to access point 
      Failed messages: pending 0, notrdy 0, noresp 0
      Firmware version 2.2.0beta1
      MAC address 84:f3:eb:83:47:be
      Module reset reason: Turned on by main processor, Vcc 3.36, flash size 4194304, free heap 39196
      WiFi IP address 192.168.1.130
      Signal strength -41dBm, channel 11, mode 802.11n, reconnections 0
      Clock register 00002002
      Socket states: 0 0 0 0 0 0 0 0
      
      posted in Beta Firmware
      DonStaufferundefined
      DonStauffer
    • RE: Bed PID Tuning: How long should it take?

      The other was also Keenovo, but 400W @24V rather than 750W @120V. This isn't subtle: the insulation on the other one doubled the heat up speed and also stabilized running temperature. The insulation on the Railcore has no effect on either, it seems.

      It's not a huge big deal. Everything works. I just expected different behavior, and wondering if I really got a good PID tuning or not.

      posted in Tuning and tweaking
      DonStaufferundefined
      DonStauffer
    • RE: Wifi/DWC Disconnecting with RRF3.5.2 on Duet2 Wifi Hardware

      @rechrtb I'll try to remember to do that.

      posted in Beta Firmware
      DonStaufferundefined
      DonStauffer
    • RE: Instabilty after if with logical or

      @dc42 I suspect it was just running out of memory, but I haven't tried this particular construct again with more free memory. I'll try it tomorrow.

      posted in Gcode meta commands
      DonStaufferundefined
      DonStauffer
    • RE: Bed PID Tuning: How long should it take?

      @droftarts My experience is different, and it makes sense.

      If you're not losing much heat at all, even while you're heating the bed, it will heat up faster. My experience with aerogel insulation is that it loses very little heat. My other printer will heat up in half the time it did before the insulation.

      posted in Tuning and tweaking
      DonStaufferundefined
      DonStauffer
    • RE: Bed PID Tuning: How long should it take?

      @engikeneer It does not heat up faster or slower. I'm disappointed and I wonder if I can manually tune it better.

      posted in Tuning and tweaking
      DonStaufferundefined
      DonStauffer