<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Editing homing g code for x/z microswitches</title>
        <description> So I&#039;m using a microswitch for my x and z endstops instead of the traditional IR probe.  I read a few threads saying I had to change M558 from P1/2 to P0, and I did that.  I also changed the Z homing g code file to get rid of the G30 command.  My problem is that when I press &quot;Home Z&quot; on the web interface, my z axis goes up, but when I move it manually in the negative direction, it moves down.  I can&#039;t seem to figure out what I am doing wrong.  Here are my config.g and homez.g files:

Quote; Ormerod 2 config file for dc42 Duet firmware
M111 S0                             ; Debug off
M550 POrmerod 1			        ; Machine name (can be anything you like)
;M551 POrmerod 1                        ; Machine password (currently not used)
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED ; MAC Address
;*** Adjust the IP address and gateway in the following 2 lines to suit your network
M552 P192.168.0.110		 				; IP address (0 = use DHCP)
M554 P192.168.0.1                   ; Gateway
M553 P255.255.255.0                 ; Netmask
M555 P2                             ; Set output to look like Marlin
M575 P1 B57600 S1					; Comms parameters for PanelDue

G21                                 ; Work in millimetres
G90                                 ; Send absolute coordinates...
M83                                 ; ...but relative extruder moves
M574 X1 Y1 Z1 S1					; set endstop configuration (Y endstop only, at low end, active high)
M906 X800 Y1000 Z800 E1000           ; Set motor currents (mA)
M563 P0 D0 H1                       ; Define tool 0
G10 P0 S0 R0                        ; Set tool 0 operating and standby temperatures
M92 E150                        	; Set extruder steps per mm (single nozzle)
;*** If you have a dual-nozzle build, remove or comment out the previous line, and un-comment the following 3 lines
;M563 P1 D1 H2                      ; Define tool 1
;G10 P1 S0 R0                       ; Set tool 1 operating and standby temperatures
;M92 E420:420						; Set extruder steps/mm (dual nozzle)
;*** If you have a modulated IR probe with on-board microcontroller, change P2 to P1 in the following
M558 P0                             ; Use a simple modulated Z probe (change to P1 for an intelligent Z probe)
G31 Z1 P175                      ; Set the probe height and threshold (put your own values here)
;*** If you have a Duet board with 1K thermistor series resistors, change R4700 to R1000 to the following M305 commands
M305 P0 R1000 H0 L0					; Put your own H and/or L values here to set the bed thermistor ADC correction
M305 P1 R1000 H0 L0					; Put your own H and/or L values here to set the first nozzle thermistor ADC correction
M305 P2 R1000 H0 L0					; Put your own H and/or L values here to set the second nozzle thermistor ADC correction
;*** Adjust the XY coordinates in the following M557 commands to suit your build and the position of the IR sensor
M557 P0 X55 Y5                      ; Four... 
M557 P1 X55 Y187                    ; ...probe points...
M557 P2 X217 Y187                   ; ...for bed...
M557 P3 X217 Y5                     ; ...levelling
M557 P4 X110 Y105                 ; 5th probe point for levelling (un-comment this if you are using a dc42 differential IR probe)
;*** if you are using axis compensation, put the figures in the following command
M556 S78 X0 Y0 Z0                   ; Axis compensation here
M201 X800 Y800 Z15 E1000            ; Accelerations (mm/s^2)
M203 X15000 Y15000 Z100 E3600       ; Maximum speeds (mm/min)
M566 X600 Y600 Z30 E20              ; Minimum speeds mm/minute
M208 X220 Y210 Z200					; set axis maxima (adjust to suit your machine)
M208 X0 Y0 Z0 S1					; set axis minimum (adjust to make X=0 the edge of the bed)
;
T0									; select first hot end

QuoteG91
G1 Z5 F200
G1 Z-100 S1 F200
G90

If anyone else is using micro switches for the X/Z endstops, do you mind posting your homing g code?

Thanks!</description>
        <link>https://reprap.org/forum/read.php?340,641584,641584#msg-641584</link>
        <lastBuildDate>Fri, 11 Sep 2026 13:14:01 -0400</lastBuildDate>
        <generator>Phorum 5.2.23</generator>
        <item>
            <guid>https://reprap.org/forum/read.php?340,641584,641736#msg-641736</guid>
            <title>Re: Editing homing g code for x/z microswitches</title>
            <link>https://reprap.org/forum/read.php?340,641584,641736#msg-641736</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>dc42</strong><br />
1. Add parameters X0 Y0 Z0 to your M558 command, to tell it that the Z probe is not used to home any axes. Earlier firmware versions need those. In later versions of my firmware fork, the M574 command is enough.<br />
<br />
2. Use the M119 command to test that the Z homing switch is working. A disconnected switch will show as always triggered.</div></blockquote>
<br />
I changed out the z endstop and now it works.  I guess it was either broken, or wired incorrectly.]]></description>
            <dc:creator>gmh39</dc:creator>
            <category>Ormerod</category>
            <pubDate>Sat, 19 Mar 2016 11:11:26 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?340,641584,641613#msg-641613</guid>
            <title>Re: Editing homing g code for x/z microswitches</title>
            <link>https://reprap.org/forum/read.php?340,641584,641613#msg-641613</link>
            <description><![CDATA[ 1. Add parameters X0 Y0 Z0 to your M558 command, to tell it that the Z probe is not used to home any axes. Earlier firmware versions need those. In later versions of my firmware fork, the M574 command is enough.<br />
<br />
2. Use the M119 command to test that the Z homing switch is working. A disconnected switch will show as always triggered.]]></description>
            <dc:creator>dc42</dc:creator>
            <category>Ormerod</category>
            <pubDate>Sat, 19 Mar 2016 05:04:01 -0400</pubDate>
        </item>
        <item>
            <guid>https://reprap.org/forum/read.php?340,641584,641584#msg-641584</guid>
            <title>Editing homing g code for x/z microswitches</title>
            <link>https://reprap.org/forum/read.php?340,641584,641584#msg-641584</link>
            <description><![CDATA[ So I'm using a microswitch for my x and z endstops instead of the traditional IR probe.  I read a few threads saying I had to change M558 from P1/2 to P0, and I did that.  I also changed the Z homing g code file to get rid of the G30 command.  My problem is that when I press "Home Z" on the web interface, my z axis goes up, but when I move it manually in the negative direction, it moves down.  I can't seem to figure out what I am doing wrong.  Here are my config.g and homez.g files:<br />
<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />; Ormerod 2 config file for dc42 Duet firmware<br />
M111 S0                             ; Debug off<br />
M550 POrmerod 1			        ; Machine name (can be anything you like)<br />
;M551 POrmerod 1                        ; Machine password (currently not used)<br />
M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED ; MAC Address<br />
;*** Adjust the IP address and gateway in the following 2 lines to suit your network<br />
M552 P192.168.0.110		 				; IP address (0 = use DHCP)<br />
M554 P192.168.0.1                   ; Gateway<br />
M553 P255.255.255.0                 ; Netmask<br />
M555 P2                             ; Set output to look like Marlin<br />
M575 P1 B57600 S1					; Comms parameters for PanelDue<br />
<br />
G21                                 ; Work in millimetres<br />
G90                                 ; Send absolute coordinates...<br />
M83                                 ; ...but relative extruder moves<br />
M574 X1 Y1 Z1 S1					; set endstop configuration (Y endstop only, at low end, active high)<br />
M906 X800 Y1000 Z800 E1000           ; Set motor currents (mA)<br />
M563 P0 D0 H1                       ; Define tool 0<br />
G10 P0 S0 R0                        ; Set tool 0 operating and standby temperatures<br />
M92 E150                        	; Set extruder steps per mm (single nozzle)<br />
;*** If you have a dual-nozzle build, remove or comment out the previous line, and un-comment the following 3 lines<br />
;M563 P1 D1 H2                      ; Define tool 1<br />
;G10 P1 S0 R0                       ; Set tool 1 operating and standby temperatures<br />
;M92 E420:420						; Set extruder steps/mm (dual nozzle)<br />
;*** If you have a modulated IR probe with on-board microcontroller, change P2 to P1 in the following<br />
M558 P0                             ; Use a simple modulated Z probe (change to P1 for an intelligent Z probe)<br />
G31 Z1 P175                      ; Set the probe height and threshold (put your own values here)<br />
;*** If you have a Duet board with 1K thermistor series resistors, change R4700 to R1000 to the following M305 commands<br />
M305 P0 R1000 H0 L0					; Put your own H and/or L values here to set the bed thermistor ADC correction<br />
M305 P1 R1000 H0 L0					; Put your own H and/or L values here to set the first nozzle thermistor ADC correction<br />
M305 P2 R1000 H0 L0					; Put your own H and/or L values here to set the second nozzle thermistor ADC correction<br />
;*** Adjust the XY coordinates in the following M557 commands to suit your build and the position of the IR sensor<br />
M557 P0 X55 Y5                      ; Four... <br />
M557 P1 X55 Y187                    ; ...probe points...<br />
M557 P2 X217 Y187                   ; ...for bed...<br />
M557 P3 X217 Y5                     ; ...levelling<br />
M557 P4 X110 Y105                 ; 5th probe point for levelling (un-comment this if you are using a dc42 differential IR probe)<br />
;*** if you are using axis compensation, put the figures in the following command<br />
M556 S78 X0 Y0 Z0                   ; Axis compensation here<br />
M201 X800 Y800 Z15 E1000            ; Accelerations (mm/s^2)<br />
M203 X15000 Y15000 Z100 E3600       ; Maximum speeds (mm/min)<br />
M566 X600 Y600 Z30 E20              ; Minimum speeds mm/minute<br />
M208 X220 Y210 Z200					; set axis maxima (adjust to suit your machine)<br />
M208 X0 Y0 Z0 S1					; set axis minimum (adjust to make X=0 the edge of the bed)<br />
;<br />
T0									; select first hot end</div></blockquote>
<br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />G91<br />
G1 Z5 F200<br />
G1 Z-100 S1 F200<br />
G90</div></blockquote>
<br />
If anyone else is using micro switches for the X/Z endstops, do you mind posting your homing g code?<br />
<br />
Thanks!]]></description>
            <dc:creator>gmh39</dc:creator>
            <category>Ormerod</category>
            <pubDate>Fri, 18 Mar 2016 23:56:05 -0400</pubDate>
        </item>
    </channel>
</rss>
