Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. RockB
    • Profile
    • Following 0
    • Followers 0
    • Topics 19
    • Posts 62
    • Best 1
    • Controversial 0
    • Groups 0

    RockB

    @RockB

    1
    Reputation
    2
    Profile views
    62
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    RockB Unfollow Follow

    Best posts made by RockB

    • Connecting a laser distance sensor to Duet3 6HC

      Hello,
      I wanted to know if it is possible to connect a laser distance sensor (https://www.automationdirect.com/adc/shopping/catalog/sensors_-z-_encoders/photoelectric_sensors/distance_measuring_sensors/opt2002) left behind from a previous project.
      The sensor has allowable input voltage of 18-30 VDC and provides analog output: either 0-10V or 4-20 mA

      I am planning to use this to take periodic measurements of a rotating cylindrical shaft (this will be 4th rotary axis) before and after printing on this.

      posted in Duet Hardware and wiring
      RockBundefined
      RockB

    Latest posts made by RockB

    • RE: Bed Heater Unexpected Behaviour

      @dc42 @droftarts any suggestions?

      posted in Duet Hardware and wiring
      RockBundefined
      RockB
    • RE: Bed Heater Unexpected Behaviour

      @droftarts Looking at the SSR, the it doesn't seem like bed heater turns OFF when LED turns OFF. Is there a good way to test this?

      posted in Duet Hardware and wiring
      RockBundefined
      RockB
    • RE: Bed Heater Unexpected Behaviour

      @dc42 There is no start.g file. However, I have start and end G-codes in slicer. The start G-code in Slicer is

      M98 P"StartPrint.g"
      

      The contents of StartPrint.g are as follows:

      M106 P2 S1			; Set fan (LED)
      G21			; Set Units to Millimeters
      M290 R0 S0
      G28			; Home all
      M703			; Configure filament
      G0 Z10 F3600			; Move
      M190			; Wait for bed temperature to reach target temp
      M116 P0			; Wait
      M98 P"0:/data/initData"			; Call Macro/Subprogram
      M400			; Wait for current moves to finish
      M290 R1 S{global.dato0}			; Baby stepping
      G0 X1 Y0 Z0.2 F3600			; Move
      G1 Y40 E35 F180			; Move
      G92 E0			; Set Position
      M400			; Wait for current moves to finish
      

      The initData sets variable to 0

      set global.dato0 = 0
      

      The End G-Code in my slicer is

      M98 P"EndPrint.g"
      

      The contents of EndPrint.g are as follows;

      M400			; Wait for current moves to finish
      G91			; Set to Relative Positioning
      G0 E-10 F6000			; Move
      G92 E0			; Set Position
      G0 Z10 F3000			; Move
      G90			; Set to Absolute Positioning
      T0			; Select Tool
      G0 F3000 X{move.axes[0].min} Y{move.axes[1].max} Z{move.axes[2].max}			; Move
      G10 P0 S0 R0			; Tool Temperature Setting
      M140 S0			; Set Bed Temperature (Fast) or Configure Bed Heater
      M106 P1 S0			; Set fan
      M106 P2 S0			; Set fan (LED) - turn OFF
      M84			; Stop idle hold
      M400			; Wait for current moves to finish
      
      if global.delete = 1
        echo >"0:/sys/autopower.g" ";Powerloss handling"			; Delete a file on the SD card
        set global.delete = 0			; Variable assignment
      
      M98 P"0:/data/initData"
      if global.dato0 != move.axes[2].babystep			; microsteps changed
        echo >"0:/data/initData" "set global.dato0 = "^{move.axes[2].babystep}			; Set or Report Current Probe status
      
      M98 P"0:/data/R_end"			; Call Macro/Subprogram
      M400			; Wait for current moves to finish
      

      I have attached a sample G-code file. Test.gcode

      posted in Duet Hardware and wiring
      RockBundefined
      RockB
    • RE: Bed Heater Unexpected Behaviour

      @dc42 That is correct, heater seems to turn off when homing and when print job is started. The Z-axis is homed using a simple end stop/micro-switch (the platform presses against the switch to register Z0)

      Here is the config.g

      ; General Preferences
      G90			; Set to Absolute Positioning
      M83			; Set extruder to relative mode
      M669 K1			; Set kinematics type and kinematics parameters
      M550 P"My Printer"			; Set Name
      
      ; Network
      M98 P"0:/data/network"			; Enable/disable network interface
      ;M552 S1			; Enable/disable network interface
      M586 P0 S1			; Configure network protocols: Enable HTTP
      M586 P1 S0			; Configure network protocols: Disable FTP
      M586 P2 S0			; Configure network protocols: Disable Telnet
      
      ; Drivers
      M569 P0 S0			; Set motor driver direction
      M569 P1 S0			; Set motor driver direction
      M569 P2 S1			; Set motor driver direction
      M569 P3 S0			; Set motor driver direction
      M584 X0 Y1 Z2 E3			; Set drive mapping
      M350 Z32 I0			; Set microstepping mode
      M350 I1 X16 Y16 E16			; Set microstepping mode
      M92 X100 Y100 Z800 E250			; Set axis steps per unit
      M566 X300 Y300 Z12 E500			; Set allowable instantaneous speed change
      M203 X3000 Y3000 Z3000 E6000			; Set maximum feedrate (mm/min) 
      M201 X500 Y500 Z24 E800			; Set max acceleration (mm/s^2) 
      M906 I30 X320 Y320 Z320 E1500			; Set motor currents (mA) 
      M84 S60			; Set Idle Time-out
      
      ; Axis limits
      M208 S1 X0 Y0 Z-0.7			; Set axis min travel 
      M208 S0 X140 Y135 Z150			; Set axis max travel 
      
      ; End stops
      M574 X1 S1 P"xstop"			; Set endstop configuration
      M574 Y2 S1 P"ystop"			; Set endstop configuration
      M574 Z1 S1 P"zstop"			; Set endstop configuration
      M950 J1 C"!e0stop"			; Create GPIO/servo pin
      M581 P1 T2 R1			; Configure external trigger#.g
      
      ; Z Probe
      M558 P0 H1.7 F120 T6000			; Set Z probe type
      M557 P3:3 X{15,move.axes[0].max-15} Y{15,move.axes[1].max-15}			; Set Z probe point or define probing grid
      G31 K0 P500 X0 Y0 Z0			; Set or Report Current Probe status
      
      ; Heaters
      M308 S0 P"bedtemp" Y"thermistor" B4138 T100000			; Set or report sensor parameters
      M950 H0 C"bedheat" Q10 T0			; Create heater pin, 10Hz PWM 
      M143 H0 S125			; Maximum heater temperature
      M570 H0 S0 P300 T15			; Configure heater fault detection
      M140 H0			; Set Bed Temperature (Fast) or Configure Bed Heater
      M307 H0 R0.740 K0.402:0.000 D3.89 E1.35 S1.00 B0; Autotune on 04/25 - PID mode
      ;M307 H0 R2.430 K0.560:0.000 D5.50 E1.35 S1.00 B1; - original in config-override.g
      
      M308 S1 P"e0temp" Y"thermistor" R4700 T100000 B3950 A"Heater1"			; Set or report sensor parameters
      M950 H1 C"e0heat" T1			; Create heater pin
      M143 H1 S300			; Maximum heater temperature
      M307 H1 B0 S1.00			; Set or report heating process parameters
      
      M308 S2 P"e1temp" Y"thermistor" R4700 T100000 B3950 A"Heater2"			; Set or report sensor parameters
      M950 H2 C"e1heat" T2			; Create heater pin
      M143 H2 S200			; Maximum heater temperature
      M307 H2 B0 S1.00			; Set or report heating process parameters
      
      M302 P0 S185 R150			; Allow cold extrudes
      
      M308 S10 Y"mcu-temp" A"MCU"			; Set or report sensor parameters
      M308 S11 Y"drivers" A"Drivers"			; Set or report sensor parameters
      M308 S12 Y"dhthumidity" A"Humedad"			; Set or report sensor parameters
      
      ; Fans
      M950 F0 C"fan0" Q500 T1			; Create fan pin
      M106 P0 S1 T45 H1 C"Fan Tool"			; Set fan configuration 
      M950 F1 C"fan1" Q500			; Create fan pin
      M106 P1 S0 H-1 C"Layer Fan"			; Set fan configuration
      M950 F2 C"exp.heater3" Q500			; Create fan pin
      M106 P2 C"LED" S255			; Set fan configuration
      M950 F8 Q500 T1 C"fan2"			; Set fan configuration
      M106 P8 S1 T160 C"Filter" H1			; Set fan configuration
      ;M950 F8 Q500			; Set fan configuration
      ;M106 P8 S1 T160 C"Filter"			; Set fan configuration
      
      ; Tools
      M563 P0 D0 F1 H1 S"Tool1"			; Define tool  
      G10 P0 X0 Y0 Z0			; Set workplace coordinate offset or tool offset
      G10 P0 R0 S0			; Set initial tool temperature
      
      ; LCD
      M575 P1 S1 B57600			; Set serial comms parameters
      
      ; Global Variables (not modifiable)
      global delete = 0			; Global variable declaration "runonce.g"
      global dato0 = 0			; Global variable declaration
      global dato1 = 0			; Global variable declaration
      global dato2 = 0			; Global variable declaration
      global dato3 = 0			; Global variable declaration
      global dato4 = 0			; Global variable declaration
      global areaX = 145
      global areaY =  135
      
      ; Always at the end
      M911 S23 R23.5 P"M98 P""0:/sys/autosave.g"""			; Configure auto save on loss of power
      M501			; Read stored parameters
      T0 P0			; Tool selection by default
      M98 P"0:/data/height_map"			; Load the height map from file and activate mesh bed compensation
      M98 P"0:/sys/autopower.g"			; Read the file in case of power outage
      

      Here is homeall.g

      ; homeall.g
      ; call home all the axes
      
      M106 P2 S1			; Set fan
      
      G91			; Set to Relative Positioning
      G1 H2 Z1 F3000			; Move
      G1 H1 F6000 X{-move.axes[0].max -- move.axes[0].min} Y{move.axes[1].max}			; Move
      G1 H1 F6000 X{-move.axes[0].max}			; Move
      G1 H1 F6000 Y{move.axes[1].max}			; Move
      G1 X5 Y-5 F6000			; Move
      G1 H1 F360 X{-move.axes[0].max/2}			; Move
      G1 H1 F360 Y{move.axes[1].max/2}			; Move
      G1 H1 Z{-move.axes[2].max} F3000			; Move
      G1 H2 Z5 F3000			; Move
      G1 H1 Z{-move.axes[2].max} F360			; Move
      G90			; Set to Absolute Positioning
      G92 Z0			; Set Position
      M400			; Wait for current moves to finish
      

      When I had initially changed to PID control, I had just changed B1 to B0 in M307 command (from auto-tune) for bed heater. I have now updated the M950 to include Q10 parameter.

      I want to illustrate what is happening with bed heater in the graph below:

      36da08b5-165b-4c77-b30b-788121856ecd-image.png

      Very bizarre behaviour and not sure what is causing this. Going back to previous suggestions for troubleshooting,

      To answer your previous question: "does your SSR have an LED to indicate that the control circuit is receiving power? If so, is it illuminated while the bed temperature is dropping, before the heater fault is raised?"
      Yes, I observed the LED indicators on the SSR during operation. While the temperature is dropping, the control side LED remains ON, indicating that the control circuit is receiving power. However, the load side LED is OFF during this time.

      After running the M703 command, both the control and load side LEDs cycle rapidly (turning ON and OFF) as expected while heating to the target temperature. Interestingly, once I home the printer or begin a print job, the LED activity slows significantly — and at times, the load side LED remains OFF altogether.

      posted in Duet Hardware and wiring
      RockBundefined
      RockB
    • RE: Bed Heater Unexpected Behaviour

      @dc42 I updated the heater control mode from Bang-bang to PID in the config.g file using the results from a previous auto-tuning cycle (M303 H0 S65).
      The parameters I applied were:

      M307 H0 R0.740 K0.402:0.000 D3.89 E1.35 S1.00 B1
      

      Unfortunately, I am still observing the same issue — the bed temperature drops.

      Interestingly, after switching the bed heater to PID control in config.g and removing the redundant bed heater settings from config-override.g, the bed maintained the setpoint temperature (65°C) correctly after running M703.

      However, the bed temperature immediately began to drop once I homed all axes — even before starting a print job.
      If no additional actions are taken after running M703, the bed heater maintains temperature without any issues. This behavior seems increasingly bizarre.

      I also double-checked the first few lines of the G-code. There is nothing that would turn off or modify the bed heater during the first layer or afterward.
      This seems to rule out issues #1 and #3 from your troubleshooting list. I will next check on #2 (the LED status on the SSR) and report back.

      For some context, the printer workflow (not configured by me) is such that users first run a filament load macro (M703), which calls the filament-specific config.g file. This file contains:

      ; Set the thermostatic fan
      M106 P0 S1 H1 T45
      ; Set the extruder flow rate
      M92 E325
      ; Set the head temperatures
      G10 P0 S215 R150
      ; Set the bed temperature
      M140 S65
      

      The slicer profile (Simplify3D) provided by the manufacturer is set to ignore temperature commands (i.e. temperature controllers are turned off in Simplify3D), so all temperature settings are managed either via filament macros or manually at the printer.

      The slicer profile (simplify3D) for this particular printer is configured by manufacturer (again not by me) to ignore temperature controls and all temperature controls are embedded into filament config.g or directly controlled at printer.

      Any suggestions on what might be causing this?

      posted in Duet Hardware and wiring
      RockBundefined
      RockB
    • RE: Bed Heater Unexpected Behaviour

      @sebkritikel Its a standard rectangular silicone AC bed heater 150W @ 110V. Using an SSR to control the bed heater. Didn't have an issue in the past and was working fine.

      Temperature does drop down and Duet throws a heater fault
      e8945baf-0a48-417a-9d0f-c27b3b33ecea-image.png

      posted in Duet Hardware and wiring
      RockBundefined
      RockB
    • RE: Bed Heater Unexpected Behaviour

      @droftarts Firmware version is 3.4.5

      Here is the M122 response

      === Diagnostics ===
      RepRapFirmware for Duet 2 WiFi/Ethernet version 3.4.5 (2022-11-30 19:36:12) running on Duet WiFi 1.02 or later
      Board ID: 0JD2M-9F8TA-GJ4TD-6J9FG-3S86N-1RPG6
      Used output buffers: 8 of 26 (26 max)
      === RTOS ===
      Static ram: 23836
      Dynamic ram: 76316 of which 388 recycled
      Never used RAM 8180, free system stack 110 words
      Tasks: NETWORK(notifyWait,35.8%,242) HEAT(notifyWait,3.2%,165) Move(notifyWait,0.6%,268) MAIN(running,59.2%,421) IDLE(ready,1.1%,30), total 100.0%
      Owned mutexes: WiFi(NETWORK)
      === Platform ===
      Last reset 70:58:01 ago, cause: software
      Last software reset at 2025-04-25 12:15, reason: User, GCodes spinning, available RAM 9228, slot 0
      Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00417000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a
      Error status: 0x0c
      Aux0 errors 0,0,0
      Step timer max interval 0
      MCU temperature: min 28.3, current 30.4, max 35.9
      Supply voltage: min 23.6, current 24.0, max 24.3, under voltage events: 0, over voltage events: 0, power good: yes
      Heap OK, handles allocated/used 99/8, heap memory allocated/used/recyclable 2048/124/58, gc cycles 1
      Events: 0 queued, 0 completed
      Driver 0: standstill, SG min 0
      Driver 1: standstill, SG min 0
      Driver 2: standstill, SG min 0
      Driver 3: standstill, SG min 0
      Driver 4: standstill, SG min n/a
      Driver 5: 
      Driver 6: 
      Driver 7: 
      Driver 8: 
      Driver 9: 
      Driver 10: 
      Driver 11: 
      Date/time: 2025-04-28 11:13:20
      Cache data hit count 4294967295
      Slowest loop: 205.61ms; fastest: 0.12ms
      I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0
      === Storage ===
      Free file entries: 10
      SD card 0 detected, interface speed: 20.0MBytes/sec
      SD card longest read time 3.9ms, write time 19.6ms, max retries 0
      === Move ===
      DMs created 83, segments created 21, maxWait 235090516ms, bed compensation in use: mesh, comp offset 0.000
      === MainDDARing ===
      Scheduled moves 224, completed 224, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 2], CDDA state -1
      === AuxDDARing ===
      Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
      === Heat ===
      Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0
      Heater 0 is on, I-accum = 0.0
      Heater 1 is on, I-accum = 0.5
      === GCodes ===
      Segments left: 0
      Movement lock 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
      Autopause is idle in state(s) 0
      Code queue is empty
      === Network ===
      Slowest loop: 51.88ms; fastest: 0.00ms
      Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0)
      HTTP sessions: 1 of 8
      = WiFi =
      Network state is active
      WiFi module is providing access point 
      Failed messages: pending 0, notready 0, noresp 0
      WiFi firmware version 1.27
      WiFi MAC address 46:17:93:34:19:50
      WiFi Vcc 3.35, reset reason Power up
      WiFi flash size 2097152, free heap 23432
      WiFi IP address 192.168.1.114
      Connected clients 1
      Clock register 00002002
      Socket states: 0 0 0 0 0 0 0 0
      

      When I send M140 when job is running, I get

      Bed heater 0 (slot 0) is currently at 62.4°C
      

      At this point the temp has already dropped from 65C - which is the setpoint for the bed.
      Below temperature graph shows the same - Blue line is the bed temperature
      d23e053f-0709-4564-be18-4d1f8666bdc4-image.png

      The pause.g is below

      ; pause.g
      ; called when a print from the SD card is paused
      
      M83			; Set extruder to relative mode
      G1 E-5 F6000			; Move
      G91			; Set to Relative Positioning
      G1 Z1 F360			; Move
      G90			; Set to Absolute Positioning
      G1 F6000 X{move.axes[0].min} Y{move.axes[1].min} Z{move.axes[2].max}			; Move
      M107			; Fan Off
      set global.dato0 = job.duration
      echo >"0:/data/temp" ";Recorded Temperature"			; Echo command
      echo >>"0:/data/temp" "G10 P0 S"^heat.heaters[1].active^":"^heat.heaters[2].active^" R"^heat.heaters[1].standby^":"^heat.heaters[2].standby			; Echo command
      

      The 0:/data/temp contains

      G10 P0 S0.0:0.0 R0.0:0.0
      

      And eventually, after a while I get an error message
      323d58a5-6606-4b85-a1f5-e17a7e0c8722-image.png

      posted in Duet Hardware and wiring
      RockBundefined
      RockB
    • RE: Bed Heater Unexpected Behaviour

      @fcwilt I believe it’s the default config in Reprap firmware where bed heaters use bang bang and extruders use PID.

      posted in Duet Hardware and wiring
      RockBundefined
      RockB
    • Bed Heater Unexpected Behaviour

      Hello,
      Using a Duet Wifi Board to control a core XY printer. The bed heater is configured to work in bang-bang mode. The bed heater is defined as below in config.g:

      ; Heaters
      M308 S0 P"bedtemp" Y"thermistor" B4138 T100000			; Set or report sensor parameters
      M950 H0 C"bedheat" T0			; Create heater pin
      M143 H0 S125			; Maximum heater temperature
      M307 H0 B1 S1.00			; Set or report heating process parameters
      M570 H0 S0 P300 T15			; Configure heater fault detection
      M140 H0			; Set Bed Temperature (Fast) or Configure Bed Heater
      

      The bed heater was auto-tuned using

      M303 H0 S65
      

      Which resulted in

      M307 H0 R0.740 K0.402:0.000 D3.89 E1.35 S1.00 B0
      

      I had to change B0 to B1 to ensure bang-bang mode. This was saved to config-override.g using M500. config.g has M501 at the end.

      The bed heater operates normally while setting a target temperature through DWC — it heats to the desired temperature and holds steady. However, once a print job begins, the bed temperature slowly decreases, as though the heater is no longer active. The DWC shows that bed heater is infact in an active state but temperature just keeps dropping. Prior to starting the print, the bed consistently maintains the set temperature. Interestingly, if I pause the print, the bed temperature climbs back up to the set point and stays stable. But when printing resumes, the temperature once again gradually drops.

      Seems to be occurring after M303 autotune cycle and was working fine before this.

      Any suggestions on what is causing this?

      posted in Duet Hardware and wiring
      RockBundefined
      RockB
    • RE: Heater Fault - Temperature raising slowly

      @Phaedrux said in Heater Fault - Temperature raising slowly:

      What command did you use to tune the extruder heater?

      M303 H2 S230
      

      Are the ambient conditions different now than from the tuning?

      No.

      posted in Duet Hardware and wiring
      RockBundefined
      RockB