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

    Spindle Control on 6HC

    Scheduled Pinned Locked Moved
    CNC
    5
    14
    585
    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.
    • Xamationundefined
      Xamation
      last edited by

      Re: Spindle Controll with M950

      Hello everybody,
      i can't drive a spindle with a duet 3D 6HC
      I used a frequency-voltage converter card on output Out9 (Laser / VFD) but I can't detect any PWM signal.
      the config file is the following:

      ; 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 Fri Dec 17 2021 15:27:41 GMT+0100 (Ora standard dell’Europa centrale)
      
      ; General preferences
      M575 P1 S1 B57600                       ; enable support for PanelDue
      G90                                     ; send absolute coordinates...
      M453                           			; CNC Mode 
      M83                                    ; ...but relative extruder moves
      M550 P"XAM-CNC01"                      	; set printer name
      M929 P"logEventi.txt" S1
      
      
      ; Network
      M552 P192.0.0.47 S1                     ; enable network and acquire dynamic address via DHCP
      M553 P255.255.255.0						; set netmask				
      M554 P192.0.0.1							; set gateway
      M586 P0 S1                              ; enable HTTP
      M586 P1 S0                              ; disable FTP
      M586 P2 S0                              ; disable Telnet
      
      ; Drives
      
      M569 P0.0 S1                            ; physical drive 0.0 goes forwards
      M569 P0.1 S1                            ; physical drive 0.1 goes forwards
      M569 P0.2 S1                            ; physical drive 0.2 goes forwards
      M584 X0.0 Y0.1 Z0.2 P3            		; set drive mapping
      
      M350 X16 Y16 Z16 I1		                ; configure microstepping with interpolation
      M92 X640.00 Y640.00 Z640.00 E420.00     ; set steps per mm
      M566 X900.00 Y900.00 Z60.00 E120.00     ; set maximum instantaneous speed changes (mm/min)
      M203 X600.00 Y6000.00 Z180.00 E1200.00  ; set maximum speeds (mm/min)
      M201 X50.00 Y50.00 Z20.00 E250.00       ; set accelerations (mm/s^2)
      M906 X800 Y800 Z800 E800 I30            ; set motor currents (mA) and motor idle factor in per cent
      M84 S30                                 ; Set idle timeout
      
      ; Axis Limits
      M208 X0 Y0 Z0 S1                        ; set axis minima
      M208 X395 Y600 Z70 S0                   ; set axis maxima
      
      ; Endstops
      M574 X1 S1 P"!io1.in" 					; configure active-low endstop for low end on X via pin io0.in
      M574 Y1 S1 P"!io2.in"					; configure active-low endstop for low end on Y via pin io1.in
      M574 Z1 S1 P"!io3.in" 					; configure active-low endstop for low end on Z via pin io3.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
      
      ; Inserito ultimamente
      
      ; Tools
      M563 P0 F0								; define tool 0
      G10 P0 X0 Y0 U0 Z0						; set tool 0 axis offset
      G10 P0 R0 S0							; set initial tool 0 active and standby temperature to 0C
      
      ; CNC
      
      M950 F8 C"nil"							; free up fan out 8
      M950 F7 C"nil"							; free up fan out 7
      M950 R0 C"OUT9+!io4.out+out7" L24000   ; configure CNC mode and set PWM+ON/FWD+REV R set max spindle RPM	
      
      G54
      M564 S H0
      M575 P1 S1 B57600
      

      the sequence of operations I do is as follows:
      I turn on the device;
      I connect to the Duet IP address;
      I make the zero point of all the axes;
      I set the RPM of the Spindle 0 to 10000
      I try to send and press the OFF key corresponding to Active but nothing happens

      Thanks to those who can help me
      Angelo

      dc42undefined Nightowlundefined 2 Replies Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @Xamation
        last edited by dc42

        @xamation you need to declare the spindle using M950 before you create the tool, then when you create the tool using M563 include the R spindle number parameter. After selecting the tool using T0 you should be able to control the spindle.

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        Xamationundefined 1 Reply Last reply Reply Quote 1
        • Xamationundefined
          Xamation @dc42
          last edited by

          @dc42 Hi,
          I updated the code so you suggested me.
          The config file is updated with the M950 and then M563 commands.
          Everything still doesn't work. I also changed the string M568 P0 F0 with
          M568 P0 F1000 but it does not go.

          ; CNC Mode (Firmware 3.3)
          M453         										; CNC Mode 
          
          ;Configure Tool 0 as the CNC Spindle
          M950 R0 C"OUT9+!io4.out+out7" Q2000 L0:25400	 	; Create spindle index 0, PWM frequency 2KHz, max rpm = 25.4K ( tweaked to yield 24K) 
          												   	; and the following connections:
          													; 	spindle speed PWM pin	: exp.9 pin
                                                              ;	spindle run pin 		: exp.4
                                                              ;	spindle direction pin 	: exp.7
          M563 P0 R0 S"Spindle"                              	; Create Tool 0 with Spindle 0 and call it Spindle 
          G10  P0 X0 Y0 Z0                                    ; Set Tool 0 axis offsets
          M568 P0 F0										; Set Tool 0 to default RPM of 0
          T0													; Select Tool 0
          
          
          G54
          M564 S H0
          M575 P1 S1 B57600
          
          

          Where am I wrong?

          Phaedruxundefined 1 Reply Last reply Reply Quote 0
          • Phaedruxundefined
            Phaedrux Moderator @Xamation
            last edited by

            @xamation said in Spindle Control on 6HC:

            Where am I wrong?

            Can you send M98 P"config.g" to check the syntax?

            Z-Bot CoreXY Build | Thingiverse Profile

            Xamationundefined 1 Reply Last reply Reply Quote 0
            • Xamationundefined
              Xamation @Phaedrux
              last edited by

              @phaedrux @phaedrux in the config file I have not entered any M98 command.
              To activate the spindle, after turning on the machine, I make the zero point of all the axes (X,Y,Z) and send the command M3 P0 S1000 through the web interface

              jay_s_ukundefined Phaedruxundefined 2 Replies Last reply Reply Quote 0
              • jay_s_ukundefined
                jay_s_uk @Xamation
                last edited by

                @xamation this is my spindle section from my config.

                M453 
                M950 R0 C"e0heat+e1heat+e2heat" Q100 L6000:24000				; CNC mode and spindle settings
                
                ; Tools
                M563 P0 R0 S"Spindle"                              				; define tool 0
                

                and i can control the spindle ok using M3 etc.
                sending m3 s6000 turns the spindle on at 6000 RPM.

                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

                1 Reply Last reply Reply Quote 0
                • Phaedruxundefined
                  Phaedrux Moderator @Xamation
                  last edited by

                  @xamation said in Spindle Control on 6HC:

                  in the config file I have not entered any M98 command.

                  You misunderstand me. What I want you to do is send M98 P"config.g" in the gcode console in DWC and copy and paste the response you get here so we can see if there are any syntax errors in your config.

                  Z-Bot CoreXY Build | Thingiverse Profile

                  Xamationundefined 1 Reply Last reply Reply Quote 0
                  • Xamationundefined
                    Xamation @Phaedrux
                    last edited by

                    @phaedrux I solved the promise. I installed the update to version 3.4 and it seems to work. I updated some commands but it reports the error: Error: bad drive number

                    Phaedruxundefined 1 Reply Last reply Reply Quote 0
                    • Phaedruxundefined
                      Phaedrux Moderator @Xamation
                      last edited by

                      @xamation said in Spindle Control on 6HC:

                      . I updated some commands but it reports the error: Error: bad drive number

                      Can you be more specific? Show us what you changed.

                      Z-Bot CoreXY Build | Thingiverse Profile

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

                        Hi @xamation,

                        Would you be kind enough to explain why you have three pin names in the M950 line for the spindle like this so I can understand why, please
                        M950 R0 C"e0heat+e1heat+e2heat" Q100 L6000:24000

                        I'm very new to 'programming' the Duet3, but I'm wondering if this (which I haven't tested yet because my milling motor hasn't arrived) will work:

                        ; AMB spindle configuration
                        M950 R0 C"out9" 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

                        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 1 Reply Last reply Reply Quote 0
                        • jay_s_ukundefined
                          jay_s_uk @Nightowl
                          last edited by

                          @nightowl999 the first pin sets the speed using PWM, second one sets the spindle to forward, 3rd one sets the spindle to reverse

                          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

                            Thanks, @jay_s_uk.

                            OK, so I'm guessing (assuming everything's configured correctly) the g-code file sends an M3 S2000 command, for example, and the first configured pinout would signal that to the spindle to turn on and run at 2000rpm.

                            I don't envisage (!) ever using the spindle to rotate in any direction other than its default rotational direction, so I shouldn't need to use the other two pinouts, should I?

                            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 the second pin enables the spindle

                              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 Nightowl

                                @jay_s_uk Got it, 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

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