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

    How to setup the microswitch as an endstop and Z probe?

    Scheduled Pinned Locked Moved
    General Discussion
    3
    11
    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.
    • Railnoldsundefined
      Railnolds
      last edited by Railnolds

      Hi.
      I have a microswitch on my carriage X. I need to setup it to work as Z endstop and Z probe at the same time.
      The configuration in my config file is:

      M574 Z1 S1 P"zstop"
      
      ; Z-Probe
      M558 P4 X0 Y0 Z1 H3 F220 T10000   ; Set Z probe to switch and set dive height H, probe speed F and travel speed T
      G31 P200 X-2.75 Y-39 Z0           ; Set Z probe trigger value, offset and trigger height
      M557 X10:285 Y10:230 S30          ; Define mesh grid 
      M376 H5 			  ; Hnnn Height (mm) over which to taper off the bed compensation
      

      For this configuration the microswitch is working well as Z endstop. But when I try to use command G29 to build the heat bed mesh, I got the error "Error: G29: Z probe 0 not found"

      What is my mistake? Could somebody help me to setup the microswitch correcly?
      The firmware is 3.1.1 (2020-05-19b2).

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

        If your firmware is 3.1.1 your command syntax is incorrect. For isntance, you need to define the signal pin in your M558 command. Also, M558 X Y Z haven't been used since 1.15.

        https://duet3d.dozuki.com/Wiki/Gcode#Section_M558_Set_Z_probe_type

        Verify your firmware version with M115 and then alter your syntax to suit. I suggest getting a sample config set from the web configurator to compare against.

        https://configtool.reprapfirmware.org/Start

        Z-Bot CoreXY Build | Thingiverse Profile

        Railnoldsundefined 1 Reply Last reply Reply Quote 0
        • Railnoldsundefined
          Railnolds @Phaedrux
          last edited by Railnolds

          @Phaedrux , thank you fpr your reply.
          Yes, my firmware is 3.1.1.
          I changed my config like

          M574 Z0 P"nil"			      ; no Z endstop switch, free up Z endstop input
          
          ; Z-Probe
          M558 P5 C"zstop" H5 F220 T10000       ; Z probe connected to Z endstop input and set dive height H, probe speed F and travel speed T
          G31 P200 X-2.75 Y-39 Z0	              ; Set Z probe trigger value, offset and trigger height
          M557 X10:285 Y10:230 S30              ; Define mesh grid 
          M376 H5 			      ; Hnnn Height (mm) over which to taper off the bed compensation
          

          But I still feel that something wrong again. Now I cant home Z axis.

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

            Post your full config.g and your homeall.g. maybe homez.g too.

            Z-Bot CoreXY Build | Thingiverse Profile

            Railnoldsundefined 1 Reply Last reply Reply Quote 0
            • Railnoldsundefined
              Railnolds @Phaedrux
              last edited by

              @Phaedrux

              config.g

              ; General preferences
              M80					     ; Turn on printer
              G21					     ; Work in millimiters
              G90                                          ; Send absolute coordinates...
              M83                                          ; ...but relative extruder moves
              
              M667 S1                                      ; Select CoreXY mode
              M550 DreamsCube				     ; Set the machine name
              
              ; Network
              M550 P"DreamsCube"                           ; Set machine name
              M552 S1                                      ; Enable network
              M587 S"SSN" P"password"                      ; Configure access point. You can delete this line once connected
              M586 P0 S1                                   ; Enable HTTP
              M586 P1 S0                                   ; Disable FTP
              M586 P2 S0                                   ; Disable Telnet
              
              ; Drives
              M569 P0 S1                                   ; X 
              M569 P1 S1                                   ; Y
              M569 P2 S0                                   ; Z
              M569 P5 S0                                   ; Extruder 3 goes backwards
              M569 P6 S0			             ; Extruder 2 goes backwards
              
              M584 X0 Y1 Z2 E9:7:6:5 	                     ; set drive mapping
              
              M350 X16 Y16  E16 I1                         ; Configure microstepping with interpolation
              M350 Z8 I0
              
              M92 X80.60 Y80.60 Z400.00 E415.00            ; Set steps per mm Z400  1208.00 E387.00
              M566 X900.00 Y900.00 Z10.00 E120.00          ; Set maximum instantaneous speed changes (mm/min) Jerk
              M203 X12000.00 Y12000.00 Z1500.00 E3000.00   ; Set maximum speeds (mm/min)
              M201 X3000.00 Y3000.00 Z300.00 E1500.00      ; Set accelerations (mm/s^2)
              M906 X900 Y900 Z1300 E900:900:900:900 I60    ; Set motor currents (mA) and motor idle factor in per cent
              
              M84 S0                                       ; Disable motor idle current reduction
              
              ; -------------- Tool changer motor ---------------------------------------------------------------------
              M569 P4 S1                                   ; Physical drive 4 goes forwards
              M584 U4				             ; Motor connected to E1 port on Duet2 WiFi
              M350 U4 I1			             ; Microstepping with interpolation for toolchanger motor
              M92  U30.578				     ; Set steps per mm				     
              M566 U50				     ; Set maximum instantaneous speed changes (mm/min) Jerk
              M203 U3000.00				     ; Set maximum speeds (mm/min)
              M201 U800.00 				     ; Set accelerations (mm/s^2)
              M906 U1000.00 I100			     ; Set motor currents (mA) and motor idle factor in per cent
              M208 U0:40                                  ; Set Elastic Lock (U axis) max rotation angle
              M574 U1 S1 P"e1stop"                         ; Set homing switch configuration for toolchange lock. Both switches should be wired NC and in series.
              
              ;--------------------------------------------------------------------------------------------------------
              
              ; Axis Limits
              M208 X0 Y0 Z0 S1                             ; Set axis minima
              M208 X290 Y230 Z190 S0                       ; Set axis maxima
              
              ; Endstops
              M574 X1 S1 P"xstop" 			     ; configure active-high endstop (microswich) for high end on X via pin xstop
              M574 Y1 S1 P"ystop" 			     ; configure active-high endstop (microswich) for high end on Y via pin ystop
              ;M574 Z1 S1 P"zstop" 			     ; configure active-high endstop (microswich) for high end on Z via pin zstop
              M574 Z0 P"nil"                 		 ; no Z endstop switch, free up Z endstop input
              
              ; Z-Probe
              M558 P5 C"zstop" H5 F220 T10000              ; Z probe connected to Z endstop input
              G31 P200 X-2.75 Y-39 Z0			     ; Set Z probe trigger value, offset and trigger height
              M557 X10:285 Y10:230 S30                     ; Define mesh grid 
              M376 H5 			             ; Hnnn Height (mm) over which to taper off the bed compensation
              
              ; HEATED BED
              M308 S0 P"bedtemp" Y"thermistor" A"Bed Temp" T100000 B4138 ; configure Sensor 0 as thermistor on pin bedtemp
              M950 H0 C"bedheat" T0                          ; create bed heater output on pin bedheat and map it to Sensor 0
              M143 H0 S120                                   ; set temperature limit for Heater 0 to 120C
              M307 H0 A306.3 C 396.9 D1.3 V24.1 B0 S1.00     ; disable bang-bang mode for Heater 0 and set PWM limit, PWN power 1
              M301 H0 P173.9 I7.568 D161.9		       ; PID parameters for Heater 0
              M140 H0 S0                                     ; map heated bed to heater 0
              
              ; -------------------------------Tools------------------------------------------------------------------------
              
              ; -------------------------------Tool 0
              M308 S1 P"duex.e3temp" Y"thermistor" A"Tool 0 Temp" T100000 B4138 R4700  ; configure Sensor 1 as thermistor on pin duex.e3temp
              M950 H1 C"duex.e3heat" T1                               ; create nozzle Heater 1 output on duex.e3heat and map it to Sensor 1
              M143 H1 S260 	                                        ; set temperature limit for Heater 1 to 260C
              M307 H1 A625 C253.8 D3.4 S0.8 V24.1 B0                  ; disable bang-bang mode for Heater 1 and set PWM limit, PWN power 0.8 A628.1
              M301 H1 P25 I0.734 D75.0		       		; PID parameters for Heater 1 P21.4 I0.734 D50.5
              
              M950 F1 C"duex.fan3" Q500                               ; create Fan 1 on pin duex.fan3(Tool 0 hotend fan)
              M106 P1 S0 H1 X190 T150 C"Tool 0 HotEnd" 	        ; Tool 0 HotEnd blowing fan. Thermostatic control is turned on for Heater 1
              M106 P1 S0				     		; Turn off Tool 0 HotEnd blowing fan.
              
              M950 F0 C"fan0" Q500                                    ; create Fan 0 on pin fan0 (Tool 0 model fan)
              M106 P0 S0 H-1 C"Tool 0 Model"   		        ; Tool 0 Model blowing fan. Thermostatic control is turned off
              
              M563 P0 D0 H1 F0:1 S"Tool 0"                   		; Define tool 0
              G10 P0 X0.2 Y0.15 Z-9                           	; Set tool 0 axis offsets 0.2 0.15
              G10 P0 R0 S0                                 		; Set initial tool 0 active and standby temperatures to 0C
              
              ; -------------------------------Tool 1
              M308 S2 P"duex.e4temp" Y"thermistor" A"Tool 1 Temp" T100000 B4138 R4700  ; configure Sensor 2 as thermistor on pin duex.e4temp
              M950 H2 C"duex.e4heat" T2                               ; create nozzle Heater 2 output on duex.e4heat and map it to Sensor 2
              M143 H2 S260 	                                        ; set temperature limit for Heater 2 to 260C
              M307 H2 A630 C251.7 D4.7 S0.8 V24.1 B0                ; disable bang-bang mode for Heater 2 and set PWM limit, PWN power 0.8 A584.6 C251.7 D4.7
              M301 H1 P16.5 I0.7 D70		       			; PID parameters for Heater 2 P16.5 I0.482 D53.8
              
              M950 F3 C"fan1" Q500                                    ; create Fan 3 on pin fan2 (Tool 1 hotend fan)
              M106 P3 S0 H2 X255 T150 C"Tool 1 HotEnd" 	        ; Tool 1 HotEnd blowing fan. Thermostatic control is turned on for Heater 2
              M106 P3 S0				     		; Turn off Tool 1 HotEnd blowing fan.
              
              M950 F2 C"fan2" Q500                                    ; create Fan 2 on pin fan1 (Tool 1 model fan)
              M106 P2 S0 H-1 C"Tool 1 Model"   		        ; Tool 1 Model blowing fan. Thermostatic control is turned off
              
              M563 P1 D1 H2 F2:3 S"Tool 1"                   		; Define tool 1
              G10 P1 X-0.15 Y-0.2 Z-9.35                          	; Set tool 1 axis offsets -8.83
              G10 P1 R0 S0                                 		; Set initial tool 1 active and standby temperatures to 0C
              
              ; -------------------------------Tool 2
              M308 S3 P"duex.e5temp" Y"thermistor" A"Tool 2 Temp" T100000 B4138 R4700  ; configure Sensor 3 as thermistor on pin duex.e6temp
              M950 H3 C"duex.e5heat" T3                               ; create nozzle Heater 3 output on duex.e6heat and map it to Sensor 3
              M143 H3 S260 	                                        ; set temperature limit for Heater 3 to 260C
              M307 H3 A410.3 C175.5 D4 S0.8 V24.1 B0                  ; disable bang-bang mode for Heater 3 and set PWM limit, PWN power 0.8
              
              M950 F5 C"duex.fan4"                                    ; create Fan 5 on pin duex.fan4 (Tool 2 hotend fan) Q500 
              M106 P5 S0 H3 L255 T150 C"Tool 2 HotEnd" 	        ; Tool 2 HotEnd blowing fan. Thermostatic control is turned on for Heater 3
              ;M106 P5 S0				     		; Turn off Tool 2 HotEnd blowing fan.
              
              M950 F4 C"duex.fan5" Q500                                ; create Fan 4 on pin duex.fan5 (Tool 2 model fan)
              M106 P4 S0 H-1 C"Tool 2 Model"   		        ; Tool 2 Model blowing fan. Thermostatic control is turned off
              
              M563 P2 D2 H3 F4:5 S"Tool 2"                   		; Define tool 3
              G10 P2 X0 Y0 Z-8.78                          	        ; Set tool 1 axis offsets -8.83
              G10 P2 R0 S0                                 		; Set initial tool 1 active and standby temperatures to 0C
              
              ; -------------------------------Tool 3
              M308 S4 P"e1temp" Y"thermistor" A"Tool 3 Temp" T100000 B4138 R4700  ; configure Sensor 4 as thermistor on pin duex.e2temp
              M950 H4 C"duex.e2heat" T4                               ; create nozzle Heater 4 output on duex.e2heat and map it to Sensor 4
              M143 H4 S260 	                                        ; set temperature limit for Heater 4 to 260C
              M307 H4 A515.7 C198.5 D4.4 S0.8 V24.1 B0                ; disable bang-bang mode for Heater 4 and set PWM limit, PWN power 0.8
              
              M950 F7 C"duex.fan6"                                    ; create Fan 7 on pin duex.fan6 (Tool 3 hotend fan)
              M106 P7 S0 H4 X250 T150 C"Tool 3 HotEnd" 	        ; Tool 3 HotEnd blowing fan. Thermostatic control is turned on for Heater 4
              M106 P7 S0				     		; Turn off Tool 3 HotEnd blowing fan.
              
              M950 F6 C"duex.fan7" Q500                               ; create Fan 6 on pin duex.fan7 (Tool 3 model fan)
              M106 P6 S0 H-1 C"Tool 3 Model"   		        ; Tool 3 Model blowing fan. Thermostatic control is turned off
              
              M563 P3 D3 H4 F6:7 S"Tool 3"                   		; Define tool 3
              G10 P3 X0.15 Y0 Z-9.23                          	; Set tool 1 axis offsets
              G10 P3 R0 S0                                 		; Set initial tool 1 active and standby temperatures to 0C
              
              M950 H6 C"nil" 			; disable heater 5 and free up the associated pin
              M950 S1 C"duex.e6heat"		; 
              

              homez.g

              G91 			    ; relative mode
              G1 H2 Z4 F500 		    ; raise head 4mm to ensure it is above the switch trigger height
              G90 			    ; back to absolute mode
              G1 X150 Y140 F6000 	    ; put the head wherever you want it to be when you home Z (omit this line if it doesn't matter)
              G91 			    ; relative mode
              G1 H1 Z-200 F1000 	    ; move Z down until the switch triggers
              G1 Z4 F1000       	    ; go back a few mm
              G1 H1 Z-205 F250       	; move slowly to Z axis endstop once more (second pass)
              G90 			    ; back to absolute mode
              G92 Z0   		    ; tell the firmware that we are at Z=0mm
              
              1 Reply Last reply Reply Quote 0
              • jay_s_ukundefined
                jay_s_uk
                last edited by

                @Railnolds You need to change your homez and homeall to use the probe as the endstop.
                This is achieved by using G30.
                Below is my homez, which uses the probe.

                ; homez.g
                ; called to home the Z axis
                ;
                ; generated by RepRapFirmware Configuration Tool v2.1.4 on Mon Dec 09 2019 17:42:21 GMT+0000 (Greenwich Mean Time)
                
                ; ################# Home Z Preparation ################
                
                G91 															; Relative mode
                G1 H2 Z5 F5000													; Lower the bed
                G90																; Back to absolute positioning
                G1 X0 Y0 F10000 		 										; Move to the center of the bed
                
                ; ################# Home Z Preparation ################
                
                M558 F250 				 										; Set the probing speed
                G30					 											; Probe a single point
                M558 F30 				 										; Set a slower probing speed
                G30					 											; Probe a single point
                

                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

                Railnoldsundefined 1 Reply Last reply Reply Quote 1
                • Railnoldsundefined
                  Railnolds @jay_s_uk
                  last edited by Railnolds

                  @jay_s_uk thank you.
                  Additionally, the microswitch should be connected to the probe pin, not to the zstop pin, am I right?
                  Now I connect it to the probe_in pin and change my config like this

                  M574 Z1 S2                           ; configure Z-probe endstop for low end on Z
                  
                  ; Z-Probe
                  M558 P5 C"^zprobe.in" H5 F220 T10000      ; Z probe connected to Z probe pin and set dive height H, probe speed F and travel speed T
                  G31 P200 X-2.75 Y-39 Z0		     ; Set Z probe trigger value, offset and trigger height
                  M557 X10:285 Y10:230 S30             ; Define mesh grid 
                  M376 H5 		             ; Hnnn Height (mm) over which to taper off the bed compensation
                  

                  And also changed my homez.g file according to your suggestion.

                  Now it is working, and also I can build the mesh of my bed.

                  Thank all for your help!

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

                    You're welcome.
                    RRF3 is flexible enough that it doesn't really matter which connector is used. You could use the zstop or the probe and it would still work as long as the config.g matched

                    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

                    Railnoldsundefined 1 Reply Last reply Reply Quote 0
                    • Railnoldsundefined
                      Railnolds @jay_s_uk
                      last edited by Railnolds

                      @jay_s_uk but in config tool is noted that "A switch is used to determine the distance between nozzle and bed. This switch must be connected to the Z probe terminal and not to the Z endstop switch terminal!"
                      And config tool generate the config file to connect the probe to the zprobe.in pin.
                      So now I am not sure that it can work if it is connected to zstop pin.

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

                        I believe that is a hangover from RRF2 and is a comment that should not be related to RRF3. @chrishamm / @wilriker something to be changed in the configtool I would suggest
                        I have raised an issue on github as that same comment also appears for the duet 3 which doesn't even have a zprobe port!

                        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

                        Railnoldsundefined 1 Reply Last reply Reply Quote 0
                        • Railnoldsundefined
                          Railnolds @jay_s_uk
                          last edited by

                          @jay_s_uk , I hope you are right. Thank you

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