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

Need help to set up filament runout sensor

Scheduled Pinned Locked Moved
General Discussion
2
14
1.1k
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.
  • undefined
    PuddingBaer91
    last edited by 29 Jan 2021, 15:29

    Hi
    yesterday i updated my anycubic predator also to a duet wifi 2 board. Now i have the smart effector with the duet board ๐Ÿ™‚ ๐Ÿ™‚

    I managed all to work except the filament runout sensor.
    In my config.g i added this line:

    M591 P2 C"e0stop" S1 D0 ; Activate filament sensor connected to E0 endstop

    if i send M591 D0 to the duet i get "filament=no" if filament is not present and "filament=yes" if it is present. So the sensor itself works fine i think.

    What i want is: run a "anyname.g" - file when a filament sensor change is happened (from active to non active (from filament present to not present))

    To test the sensor working like i want i created in system folder the trigger4.g file which contains the command to enable the part cooling fans to 100 % (Just to test the state change from sensor)

    In config.g i added the lines to call the trigger4.g:

    trigger4.g
    M581 T4 S0 R0 E0 ; trigger for filament runout sensor, T4 = trigger number

    because of R0 it should trigger even when not printing. But if i pull out the filament from the sensor the part cooling will not activate.

    I read the wiki and tried some things but it's not clear to me how i assign a trigger number (T4) to a .g file. May i understood this wrong. Hope you can help me ๐Ÿ™‚ Thank you

    This is my config.g:

    ; Configuration file for Duet WiFi (firmware version 3)
    ; executed by the firmware on start-up
    ;
    ; generated by RepRapFirmware Configuration Tool v3.2.2 on Thu Jan 28 2021 13:01:46 GMT+0100 (Mitteleuropรคische Normalzeit)
    ; General preferences
    G90 ; send absolute coordinates...
    M83 ; ...but relative extruder moves
    M550 P"Anycubic Predator" ; set printer name
    M665 R236.801 L440.51 B185 H414.429 X0.094 Y-0.331 Z0 ; Set delta radius, diagonal rod length, printable radius and homed height
    M666 X0.490 Y-0.110 Z-0.381 A0.00 B0.00 ; put your endstop adjustments here, or let auto calibration find them
    ; Network
    M552 S1 ; enable network
    M586 P0 S1 ; enable HTTP
    M586 P1 S0 ; disable FTP
    M586 P2 S0 ; disable Telnet
    ; Drives
    M569 P0 S0 ; physical drive 0 goes backwards a
    M569 P1 S0 ; physical drive 1 goes backwards b
    M569 P2 S0 ; physical drive 2 goes backwards c
    M569 P3 S1 ; physical drive 3 goes backwards e
    M584 X0 Y1 Z2 E3 ; set drive mapping
    M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation
    M92 X160.00 Y160.00 Z160.00 E415.00 ; set steps per mm
    M566 X1200.00 Y1200.00 Z1200.00 E1200.00 ; set maximum instantaneous speed changes (mm/min)
    M203 X18000.00 Y18000.00 Z18000.00 E1200.00 ; set maximum speeds (mm/min)
    M201 X1000.00 Y1000.00 Z1000.00 E1000.00 ; set accelerations (mm/s^2)
    M906 X950 Y950 Z950 E800 I50 ; set motor currents (mA) and motor idle factor in per cent
    M84 S120 ; Set idle timeout
    ; Axis Limits
    M208 Z0 S1 ; set minimum Z
    ; Endstops
    M574 X2 S1 P"xstop" ; configure active-high endstop for high end on X via pin xstop
    M574 Y2 S1 P"ystop" ; configure active-high endstop for high end on Y via pin ystop
    M574 Z2 S1 P"zstop" ; configure active-high endstop for high end on Z via pin zstop
    ; Z-Probe
    M558 P5 R0.4 C"zprobe.in+zprobe.mod" H5 F600 T6000 ; set Z probe type to effector and the dive height + speeds old 15
    G31 P100 X0 Y0 Z-0.1 ; set Z probe trigger value, offset and trigger height
    M557 R115 S20 ; define mesh grid
    ; Heaters
    M308 S0 P"bedtemp" Y"thermistor" T100000 B4092 ; configure sensor 0 as thermistor on pin bedtemp
    M950 H0 C"bedheat" T0 ; create bed heater output on bedheat and map it to sensor 0
    M307 H0 B0 S1.00 ; disable bang-bang mode for the bed heater and set PWM limit
    M140 H0 ; map heated bed to heater 0
    M143 H0 S120 ; set temperature limit for heater 0 to 120C
    M308 S1 P"e0temp" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 1 as thermistor on pin e0temp
    M950 H1 C"e0heat" T1 ; create nozzle heater output on e0heat and map it to sensor 1
    M307 H1 B0 S1.00 ; disable bang-bang mode for heater and set PWM limit
    M143 H1 S260 ; set temperature limit for heater 1 to 260C
    ; Fans
    M950 F0 C"fan0" Q500 ; create fan 0 on pin fan0 and set its frequency
    M106 P0 C"Part Cooling" S0 H-1 ; set fan 0 name and value. Thermostatic control is turned off
    M950 F1 C"fan1" Q500 ; create fan 1 on pin fan1 and set its frequency
    M106 P1 C"Hotend" S1 H1 T45 ; set fan 1 name and value. Thermostatic control is turned on
    M950 F2 C"fan2" Q500 ; create fan 2 on pin fan2 and set its frequency
    M106 P2 C"Filter Fan" S0 H-1 ; set fan 2 name and value. Thermostatic control is turned off
    ; Tools
    M563 P0 D0 H1 F0 S"Extruder" ; 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
    ; Custom settings are not defined
    ; Miscellaneous
    M307 H0 R0.431 C575.303:575.303 D1.31 S1.00 V24.2 B0 ; PID parameters for heatbed
    M307 H1 R2.452 C213.022:213.022 D6.25 S1.00 V24.1 B0 ; PID parameters for extruder
    M591 P2 C"e0stop" S1 D0 ; Activate filament sensor connected to E0 endstop
    trigger4.g
    M581 T4 S0 R0 E0 ; trigger for filament runout sensor T2 = trigger number
    M501 ; load saved parameters from non-volatile memory

    this is my trigger4.g:

    M106 P0 S255
    
    1 Reply Last reply Reply Quote 0
    • undefined
      Phaedrux Moderator
      last edited by 29 Jan 2021, 18:12

      Please report the results of sending M122 and M98 P"config.g"

      Z-Bot CoreXY Build | Thingiverse Profile

      1 Reply Last reply Reply Quote 0
      • undefined
        PuddingBaer91
        last edited by 29 Jan 2021, 18:21

        @Phaedrux said in Need help to set up filament runout sensor:

        M122

        29.1.2021, 19:20:39 M122
        === Diagnostics ===
        RepRapFirmware for Duet 2 WiFi/Ethernet version 3.2 running on Duet WiFi 1.02 or later
        Board ID: 0JD0M-9P6M2-NW4SN-6J9D2-3SJ6R-9BUBK
        Used output buffers: 2 of 24 (11 max)
        === RTOS ===
        Static ram: 23460
        Dynamic ram: 72804 of which 24 recycled
        Never used RAM 15792, free system stack 189 words
        Tasks: NETWORK(ready,183) HEAT(blocked,295) MAIN(running,452) IDLE(ready,19)
        Owned mutexes: WiFi(NETWORK) HTTP(MAIN)
        === Platform ===
        Last reset 00:01:36 ago, cause: power up
        Last software reset at 2021-01-29 16:11, reason: User, GCodes spinning, available RAM 15792, slot 1
        Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0041f000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a
        Error status: 0x00
        Aux0 errors 0,0,0
        MCU temperature: min 23.7, current 28.5, max 28.7
        Supply voltage: min 24.0, current 24.2, max 24.5, under voltage events: 0, over voltage events: 0, power good: yes
        Driver 0: position 125740, standstill, SG min/max not available
        Driver 1: position 125740, standstill, SG min/max not available
        Driver 2: position 125740, standstill, SG min/max not available
        Driver 3: position 0, standstill, SG min/max not available
        Driver 4: position 0, standstill, SG min/max not available
        Driver 5: position 0
        Driver 6: position 0
        Driver 7: position 0
        Driver 8: position 0
        Driver 9: position 0
        Driver 10: position 0
        Driver 11: position 0
        Date/time: 2021-01-29 19:20:38
        Cache data hit count 116224094
        Slowest loop: 3.48ms; fastest: 0.21ms
        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 1.2ms, write time 0.0ms, max retries 0
        === Move ===
        DMs created 83, maxWait 0ms, bed compensation in use: none, comp offset 0.000
        === MainDDARing ===
        Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
        === AuxDDARing ===
        Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
        === Heat ===
        Bed heaters = 0 -1 -1 -1, chamberHeaters = -1 -1 -1 -1
        === GCodes ===
        Segments left: 0
        Movement lock held by null
        HTTP is ready with "M122 " 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: 15.88ms; fastest: 0.00ms
        Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0), 0 sessions
        HTTP sessions: 1 of 8
        - WiFi -
        Network state is active
        WiFi module is connected to access point
        Failed messages: pending 0, notready 0, noresp 0
        WiFi firmware version 1.25
        WiFi MAC address 40:f5:20:1d:bf:a8
        WiFi Vcc 3.37, reset reason Turned on by main processor
        WiFi flash size 4194304, free heap 27056
        WiFi IP address 192.168.1.43
        WiFi signal strength -74dBm, mode 802.11n, reconnections 0, sleep mode modem
        Clock register 00002002
        Socket states: 0 0 0 0 0 0 0 0
        === Filament sensors ===
        Extruder 0 sensor: no filament
        29.1.2021, 19:21:17 M98 P"config.g"
        HTTP is enabled on port 80
        FTP is disabled
        TELNET is disabled
        Warning: Heater 0 appears to be over-powered. If left on at full power, its temperature is predicted to reach 272C
        Warning: Heater 1 appears to be over-powered. If left on at full power, its temperature is predicted to reach 547C
        Error: Bad command: trigger4.g
        Error: Bad command: trigger4.g
        Error: Bad command: trigger4.g
        Warning: Heater 0 appears to be over-powered. If left on at full power, its temperature is predicted to reach 272C
        Warning: Heater 1 appears to be over-powered. If left on at full power, its temperature is predicted to reach 547C
        1 Reply Last reply Reply Quote 0
        • undefined
          Phaedrux Moderator
          last edited by 29 Jan 2021, 18:24

          Put a ; in front of trigger4.g

          lemme double check the usage of M591 and M581

          Z-Bot CoreXY Build | Thingiverse Profile

          undefined 1 Reply Last reply 29 Jan 2021, 19:19 Reply Quote 0
          • undefined
            PuddingBaer91 @Phaedrux
            last edited by 29 Jan 2021, 19:19

            @Phaedrux the added the ; but no change. I only added this line because i thought this way the T4 parameter is assigned to this file...

            1 Reply Last reply Reply Quote 0
            • undefined
              Phaedrux Moderator
              last edited by 29 Jan 2021, 19:24

              I think the problem is that you are trying to use the same switch for filament sensing and as a trigger at the same time.

              The filament sensor behavior is to send a pause command when the filament is not present.

              If you want to use the switch to trigger a custom macro, you would just use M581.

              It has been requested previously to allow for a custom macro on filament runout and it's on the work list.

              https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M591_Configure_filament_sensing

              https://duet3d.dozuki.com/Wiki/Gcode?revisionid=HEAD#Section_M581_Configure_external_trigger

              So in the meantime, configure as one or the other.

              Z-Bot CoreXY Build | Thingiverse Profile

              undefined 1 Reply Last reply 29 Jan 2021, 19:41 Reply Quote 0
              • undefined
                PuddingBaer91 @Phaedrux
                last edited by 29 Jan 2021, 19:41

                @Phaedrux thank you i will try. Also found that trigger T1 resets the board, T2 pauses and all numbers above executes triggerX.g files. Is this in RRF3 still the case? I can't find this info in the wiki. I found it by google...

                Thank you for your help. Will report the result ๐Ÿ˜‰

                undefined 1 Reply Last reply 29 Jan 2021, 21:51 Reply Quote 0
                • undefined
                  PuddingBaer91
                  last edited by 29 Jan 2021, 21:33

                  Okay now it works. I just deleted the trigger code...
                  A few other questions i dont want to open a new thread:
                  I always calibrated my delta in cold state (heaters off) now if i want to always calibrate before a print starts should i do this in cold state? I ask because if i also want to use mesh compensation i have to do this with heated bed state. Should i also always do a mesh compensation after delta calibration before each print? Or just load a state after calibration?

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    Phaedrux Moderator @PuddingBaer91
                    last edited by 29 Jan 2021, 21:51

                    @PuddingBaer91 said in Need help to set up filament runout sensor:

                    Also found that trigger T1 resets the board, T2 pauses and all numbers above executes triggerX.g files. Is this in RRF3 still the case? I can't find this info in the wiki. I found it by google...

                    It's literally in the link I posted above.

                    Trigger number 0 causes an emergency stop as if M112 had been received. Trigger number 1 causes the print to be paused as if M25 had been received. Any trigger number # greater than 1 causes the macro file sys/trigger#.g to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the M400 command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.

                    @PuddingBaer91 said in Need help to set up filament runout sensor:

                    I always calibrated my delta in cold state (heaters off) now if i want to always calibrate before a print starts should i do this in cold state? I ask because if i also want to use mesh compensation i have to do this with heated bed state. Should i also always do a mesh compensation after delta calibration before each print? Or just load a state after calibration?

                    I think it's usually best to perform any calibration in a hot state to better match the thermal expansion changes that happen during the actual print.

                    Z-Bot CoreXY Build | Thingiverse Profile

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      PuddingBaer91
                      last edited by 30 Jan 2021, 19:39

                      thank you ๐Ÿ™‚

                      Another thing i noticed: If i probe the bed in DWC the z-probe shows most time 0 but sometimes it shows a red 1000. Is this normal? Probe triggers at all cases correct...

                      undefined 1 Reply Last reply 30 Jan 2021, 19:40 Reply Quote 0
                      • undefined
                        Phaedrux Moderator @PuddingBaer91
                        last edited by 30 Jan 2021, 19:40

                        @PuddingBaer91 Yes that's normal. The web interface can't update fast enough for probes that only briefly show the triggered state.

                        Z-Bot CoreXY Build | Thingiverse Profile

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          PuddingBaer91
                          last edited by 30 Jan 2021, 19:44

                          thank you again ๐Ÿ™‚
                          another thing ๐Ÿ˜„

                          If i heat the hot end the probe led flickers. If i set the sensity to 70 it's gone. Is this way okay or do i have to check/change something?

                          undefined 1 Reply Last reply 30 Jan 2021, 20:34 Reply Quote 0
                          • undefined
                            Phaedrux Moderator @PuddingBaer91
                            last edited by 30 Jan 2021, 20:34

                            @PuddingBaer91 said in Need help to set up filament runout sensor:

                            If i set the sensity to 70 it's gone

                            What does this mean?

                            If the probe is still functioning normally I wouldn't worry about the flicker.

                            Z-Bot CoreXY Build | Thingiverse Profile

                            1 Reply Last reply Reply Quote 0
                            • undefined
                              PuddingBaer91
                              last edited by 30 Jan 2021, 22:49

                              i meant the sensity parameter for smart effector:
                              M672 S105:70:185

                              1 Reply Last reply Reply Quote 0
                              7 out of 14
                              • First post
                                7/14
                                Last post
                              Unless otherwise noted, all forum content is licensed under CC-BY-SA