Welcome! Log In Create A New Profile

Advanced

Editing homing g code for x/z microswitches

Posted by gmh39 
Editing homing g code for x/z microswitches
March 18, 2016 11:56PM
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:

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

Quote

G91
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!


greghoge.com

HUGE 3D PRINTER PARTS SALE!!!
Re: Editing homing g code for x/z microswitches
March 19, 2016 05:04AM
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.

2. Use the M119 command to test that the Z homing switch is working. A disconnected switch will show as always triggered.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Editing homing g code for x/z microswitches
March 19, 2016 11:11AM
Quote
dc42
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.

2. Use the M119 command to test that the Z homing switch is working. A disconnected switch will show as always triggered.

I changed out the z endstop and now it works. I guess it was either broken, or wired incorrectly.


greghoge.com

HUGE 3D PRINTER PARTS SALE!!!
Sorry, only registered users may post in this forum.

Click here to login