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

    Simple relay control... or not?

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    8
    43
    2.0k
    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.
    • Nightowlundefined
      Nightowl @droftarts
      last edited by

      Sure can, @droftarts - here you go...

      ; Configuration file for Duet 3 (firmware version 3.3)
      ; executed by the firmware on start-up
      ;
      ; generated by RepRapFirmware Configuration Tool v3.3.10 on Tue Apr 05 2022 16:17:08 GMT+0100 (British Summer Time)

      ; General preferences
      M453 ; set machine to CNC mode
      G90 ; send absolute coordinates...
      M83 ; ...but relative extruder moves
      M550 P"Weeble" ; set printer name

      ; Network
      M552 P0.0.0.0 S1 ; enable network and acquire dynamic address via DHCP
      M586 P0 S1 ; enable HTTP
      M586 P1 S0 ; disable FTP
      M586 P2 S0 ; disable Telnet

      ; Configure Drives
      M569 P0.0 S0 ; physical drive 0.0 goes backwards - X axis
      M569 P0.1 S1 ; physical drive 0.1 goes forwards - Y1 axis
      M569 P0.2 S1 ; physical drive 0.2 goes forwards - Y2 axis
      M569 P0.3 S0 ; physical drive 0.3 goes backwards - Z axis
      M584 X0.0 Y0.1:0.2 Z0.3 ; set drive mapping

      ; Configure Motors
      M350 X16 Y16 Z16 I1 ; configure microstepping with interpolation
      M92 X400 Y400 Z400 ; set steps per mm
      M566 X500 Y500 Z500 ; set maximum instantaneous speed changes (mm/min)
      M203 X2500 Y2500 Z2500 ; set maximum speeds (mm/min)
      M201 X150 Y150 Z150 ; set accelerations (mm/s^2)
      M906 X2400 Y2400 Z 2400 ; set motor currents (mA) 80% of maximum (3000mA)
      M84 S0 ; Disable motor idle current reduction

      ; Axis Limits
      M208 X0 Y0 Z0 S1 ; set axis minima
      M208 X535 Y787 Z100 S0 ; set axis maxima
      ; M208 X0:535 Y0:787 Z0:100 S0 ; set axis minima and maxima

      ; Endstops
      M574 X1 S1 P"io8.in" ; configure switch-type (e.g. microswitch) endstop for low end on X via pin io8.in
      M574 Y2 S1 P"io6.in+io3.in" ; configure switch-type (e.g. microswitch) and dual self-squaring high ends on Y1 via pin io6.in and on Y2 via pin io3.in
      M574 Z2 S1 P"io2.in" ; configure switch-type (e.g. microswitch) endstop for high end on Z via pin io2.in

      ; Z-Probe
      ; M558 P0 H5 F120 T6000 ; disable Z probe but set dive height, probe speed and travel speed
      ; M557 X15:215 Y15:195 S20 ; define mesh grid

      ; Heaters

      ; Fans

      ; Makita and relay configuration
      M950 R0 C"out1+out8" ; enable router relay on out8
      M563 P0 S"Makita" R0 ; assign spindle 0 to tool 0 and name it Makita
      T0 ; select tool 0

      ; AMB spindle configuration
      ; M950 R0 C"xxx" L0:25000 Q1000 ; create spindle with index 0
      ; M563 P1 S"Spindle 1" R0 ; create tool 1 with spindle 0 and name it "Spindle 1"
      ; M453 ; set machine to CNC mode
      ; T1 ; select tool 1
      ; M3 S0
      ; M5 ; stop spindle

      ; Custom settings are not defined

      ; Miscellaneous
      M564 S1 H1 ; Disable jog commands when not homed
      ; M911 S10 R11 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; set voltage thresholds and actions to run on power loss

      Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
      I'm still on my learning curve, so take everything I say with caution!

      RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

      1 Reply Last reply Reply Quote 0
      • Nightowlundefined Nightowl referenced this topic
      • Nightowlundefined Nightowl referenced this topic
      • Nightowlundefined Nightowl referenced this topic
      • Nightowlundefined Nightowl referenced this topic
      • Nightowlundefined Nightowl referenced this topic
      • Nightowlundefined
        Nightowl
        last edited by

        I've got a bit of an update on this, but I'm not sure if it's me, the firmware of the machine...

        When I first start DWC up and send the "M3" command, this shows green in the Console, but the relay doesn't operate. However, if I send "M3 S5000" this also shows green and the relay does operates. Thereafter, entering just "M3" operates the relay. M5 deactivates the relay.
        It sounds like I should be adding an M3 S5000 line somewhere in the config.g file, but wouldn't this operate the relay and, ultimately, the router? I suppose I could follow that with an "M5" line, but it doesn't sound good practice to me!

        Thanks

        Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
        I'm still on my learning curve, so take everything I say with caution!

        RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

        alankilianundefined 1 Reply Last reply Reply Quote 0
        • alankilianundefined
          alankilian @Nightowl
          last edited by

          @nightowl999 From the M3 page:

          M3 can be called without any parameters and will start the spindle of the current tool turning clockwise at the spindle RPM of that tool.
          

          So I guess you should define a spindle speed for your tool using M568, then select the tool and then do M3 and it should start up.

          Give it a try and let us know.

          SeemeCNC Rostock Max V3 converted to V3.2 with a Duet2 Ethernet Firmware 3.2 and SE300

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA