• Tags
  • Documentation
  • Order
  • Register
  • Login
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.
  • undefined
    Nightowl @dc42
    last edited by 27 Apr 2022, 22:22

    My intention is to 'upgrade' to a milling motor in the not too distant future, @dc42, so I was going to leave the Laser/VFD output for that.

    Doing it this way for now will support both my router and dust collector, and just the dust collector when I've saved enough for the MM.

    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
    • undefined
      Nightowl @alankilian
      last edited by 28 Apr 2022, 16:38

      @alankilian Ah, perhaps not.

      I think I've missed something because, when I send the M3 code from the Console, I get the error:

      M3
      Error: M3: No P parameter and no active tool with spindle.

      Am I supposed to configure this elsewhere in the config.g file?

      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

      undefined 1 Reply Last reply 28 Apr 2022, 16:47 Reply Quote 0
      • undefined
        alankilian @Nightowl
        last edited by 28 Apr 2022, 16:47

        @nightowl999

        From the GCODE page:

        "It is an error if there is no tool active or the active tool does not have a spindle assigned and there is no P parameter provided to define which spindle this should be applied to."

        Maybe you just need to select a tool using a T command? REFERENCE

        Or you need to define a tool using M563 ?

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

        undefined 1 Reply Last reply 28 Apr 2022, 17:01 Reply Quote 1
        • undefined
          Nightowl @alankilian
          last edited by Nightowl 28 Apr 2022, 17:01

          @alankilian Oops, well I haven't defined a tool, so that's probably a good starting point!

          Would it just be a case of adding a single line like this before the M950 line, then:

          M563 P0 R0 S"Makita" ; assign spindle 0 to tool 0 and name it Makita

          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

          1 Reply Last reply Reply Quote 0
          • undefined
            Nightowl
            last edited by 29 Apr 2022, 10:11

            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

            undefined undefined 2 Replies Last reply 29 Apr 2022, 10:34 Reply Quote 0
            • undefined
              jay_s_uk @Nightowl
              last edited by jay_s_uk 29 Apr 2022, 10:34

              @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

              undefined 1 Reply Last reply 29 Apr 2022, 10:55 Reply Quote 0
              • undefined
                droftarts administrators @Nightowl
                last edited by 29 Apr 2022, 10:44

                @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

                undefined 1 Reply Last reply 29 Apr 2022, 10:46 Reply Quote 0
                • undefined
                  Nightowl @droftarts
                  last edited by 29 Apr 2022, 10:46

                  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
                  • undefined
                    Nightowl @jay_s_uk
                    last edited by Nightowl 29 Apr 2022, 10:55

                    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

                    undefined 1 Reply Last reply 29 Apr 2022, 10:56 Reply Quote 0
                    • undefined
                      jay_s_uk @Nightowl
                      last edited by 29 Apr 2022, 10:56

                      @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

                      undefined 1 Reply Last reply 29 Apr 2022, 10:59 Reply Quote 0
                      • undefined
                        Nightowl @jay_s_uk
                        last edited by 29 Apr 2022, 10:59

                        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

                        undefined 1 Reply Last reply 29 Apr 2022, 11:00 Reply Quote 0
                        • undefined
                          jay_s_uk @Nightowl
                          last edited by 29 Apr 2022, 11:00

                          @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

                          undefined 1 Reply Last reply 29 Apr 2022, 11:02 Reply Quote 0
                          • undefined
                            Nightowl @jay_s_uk
                            last edited by 29 Apr 2022, 11:02

                            @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
                            • undefined
                              Nightowl
                              last edited by 29 Apr 2022, 14:01

                              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

                              undefined 1 Reply Last reply 29 Apr 2022, 15:02 Reply Quote 0
                              • undefined
                                droftarts administrators @Nightowl
                                last edited by 29 Apr 2022, 15:02

                                @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

                                undefined 1 Reply Last reply 29 Apr 2022, 15:06 Reply Quote 0
                                • undefined
                                  Nightowl @droftarts
                                  last edited by 29 Apr 2022, 15:06

                                  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
                                  • undefined Nightowl referenced this topic 29 Apr 2022, 16:50
                                  • undefined Nightowl referenced this topic 29 Apr 2022, 16:53
                                  • undefined Nightowl referenced this topic 29 Apr 2022, 17:10
                                  • undefined Nightowl referenced this topic 29 Apr 2022, 17:26
                                  • undefined Nightowl referenced this topic 29 Apr 2022, 17:31
                                  • undefined
                                    Nightowl
                                    last edited by 8 May 2022, 15:21

                                    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

                                    undefined 1 Reply Last reply 8 May 2022, 17:04 Reply Quote 0
                                    • undefined
                                      alankilian @Nightowl
                                      last edited by 8 May 2022, 17:04

                                      @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
                                      35 out of 43
                                      • First post
                                        35/43
                                        Last post
                                      Unless otherwise noted, all forum content is licensed under CC-BY-SA