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
      last edited by

      I'm still having some difficulty getting this 'simple' thing to work, but I have made some progress, thanks to you guys on here!

      I've revisited my config.g file and come up with this to configure the relay:

      ; 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

      Now, when entering M3 in the command line I don't any errors at all - but the relay doesn't activate, so nothing happens.

      I know I'm getting there, but I must have missed something!

      Any further help would be appreciated.

      Thank you

      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

      jay_s_ukundefined droftartsundefined 2 Replies Last reply Reply Quote 0
      • jay_s_ukundefined
        jay_s_uk @Nightowl
        last edited by jay_s_uk

        @nightowl999 try adding L1 to the M950 and then sending M3 S1 rather than just M3

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        Nightowlundefined 1 Reply Last reply Reply Quote 0
        • droftartsundefined
          droftarts administrators @Nightowl
          last edited by

          @nightowl999 Apologies if you have already stated this, I can't see it in the thread, but what firmware version are you on? Send M115 and post the response. Earlier versions of RRF 3.x dealt with assigning spindle outputs differently. See https://docs.duet3d.com/en/User_manual/Reference/Gcodes/M453

          Ian

          Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

          Nightowlundefined 1 Reply Last reply Reply Quote 0
          • Nightowlundefined
            Nightowl @droftarts
            last edited by

            Hi @droftarts.
            The result is...
            m115
            FIRMWARE_NAME: RepRapFirmware for Duet 3 MB6HC FIRMWARE_VERSION: 3.4.0 ELECTRONICS: Duet 3 MB6HC v1.01 or later FIRMWARE_DATE: 2022-03-15 18:57:26

            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 @jay_s_uk
              last edited by Nightowl

              Tried that, @jay_s_uk, but got the following error:

              Error: M3: Requested spindle RPM out of range.

              I also tried S0, which didn't produce an error, but didn't operate the relay, either 😞

              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

              jay_s_ukundefined 1 Reply Last reply Reply Quote 0
              • jay_s_ukundefined
                jay_s_uk @Nightowl
                last edited by

                @nightowl999 ok, attempt 2.
                Remove the L1 from the M950.
                And just send something like M3 S4000 (I know we don't have RPM control)

                Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                Nightowlundefined 1 Reply Last reply Reply Quote 0
                • Nightowlundefined
                  Nightowl @jay_s_uk
                  last edited by

                  Well, that worked @jay_s_uk!

                  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

                  jay_s_ukundefined 1 Reply Last reply Reply Quote 0
                  • jay_s_ukundefined
                    jay_s_uk @Nightowl
                    last edited by

                    @nightowl999 great, so any S value should activate the spindle. So just make sure your gcode has that an you'll be fine.
                    M5 should then turn it off

                    Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                    Nightowlundefined 1 Reply Last reply Reply Quote 0
                    • Nightowlundefined
                      Nightowl @jay_s_uk
                      last edited by

                      @jay_s_uk

                      Yep, S1 doesn't work, but S1000 does.

                      For some reason, and I haven't done anything but add then remove the L1 you suggested earlier, using just M3 works now!

                      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
                        last edited by

                        OK, so I really don't know what's going on here.

                        AS per my last post, M3 and M5 activated and deactivated the relay.

                        Since shutting down and restarting the Duet after lunch, M£ doesn't work again - even combining that with an S1000 or S5000 command.

                        This is very perplexing!

                        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

                        droftartsundefined 1 Reply Last reply Reply Quote 0
                        • droftartsundefined
                          droftarts administrators @Nightowl
                          last edited by

                          @nightowl999 can you post your full config.g?

                          Ian

                          Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                          Nightowlundefined 1 Reply Last reply Reply Quote 0
                          • 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