Noob… Z axis homes, but when a print begins it goes lower



  • OK, sorry for the noob question. Ive dug through thread after thread but gcodes are escaping me at the moment.
    I have a wanhao I3 that I tore apart and kept only the frame, lead screws, belts, E motor, end stops and power supply. I replaced the rest with 4 17HS16-2004S motors (X/Y/Z) and the DuetWifi. I also re-wired it from head to toe to make sure the gauge is correct etc. Now that I finally have it all back together it fires up and moves around. The problem is that I can home it, level the bed (no z probe yet till I can print the mount) and everything looks great… but as soon as I go to print anything from Cura using the previous printer settings (which Z height etc should be the same) or from Simplify3D, as soon as it goes to print it seems to dive lower than the homed Z setting and has unfortunately dug some nasty scratches into the bed.
    Is there a gcode I am missing somewhere or a config somewhere I did wrong? My motor settings are:

    ; Drives
    M569 P0 S1                                                                 ; Drive 0 goes forwards
    M569 P1 S1                                                                 ; Drive 1 goes forwards
    M569 P2 S0                                                                 ; Drive 2 goes backwards
    M569 P3 S0                                                                 ; Drive 3 goes backwards
    M350 E16 I0                                                                ; Configure microstepping without interpolation
    M350 X16 Y16 Z16 I1                                                        ; Configure microstepping with interpolation
    M92 X80 Y80 Z400 E100                                                      ; Set steps per mm
    M566 X900 Y900 Z12 E120                                                    ; Set maximum instantaneous speed changes (mm/min)
    M203 X12000 Y12000 Z1200 E3000                                             ; Set maximum speeds (mm/min)
    M201 X1000 Y1000 Z100 E5000                                                ; Set accelerations (mm/s^2)
    M906 X1800 Y1800 Z1800 E855 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 X200 Y200 Z180 S0                                                     ; Set axis maxima
    
    ; Endstops
    M574 X1 Y1 Z1 S0                                                           ; Set active low endstops
    
    ; Z-Probe
    M558 P0 H5 F120 T6000                                                      ; Set Z probe type to switch and the dive height + speeds
    G31 P500 X0 Y0 Z2.5                                                        ; Set Z probe trigger value, offset and trigger height
    M557 X25:175 Y25:175 S20                                                   ; Define mesh grid
    
    

    I know the lead screws are a TR8x8 so I got 400 for my steps/mm. Belt pulley is a 20T 2mm pitch. Am I missing something?


  • administrators

    Please post your homeall.g and homez.g files.



  • homeall.g

    ; homeall.g
    ; called to home all axes
    ;
    ; generated by RepRapFirmware Configuration Tool on Sat Apr 07 2018 15:34:24 GMT-0600 (Mountain Daylight 
    Time)
    G91                     ; relative positioning
    G1 Z5 F6000 S2          ; lift Z relative to current position
    G1 S1 X-205 Y-205 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)
    G1 X5 Y5 F6000          ; go back a few mm
    G1 S1 X-205 Y-205 F360  ; move slowly to X and Y axis endstops once more (second pass)
    G1 S1 Z-185 F1800 S1    ; move Z down stopping at the endstop
    G90                     ; absolute positioning
    G92 Z2.5                ; set new Z position
    ;G1 Z5 F100 S2          ; uncomment this line to lift the nozzle after homing
    

    Here is the homez.g

    ; homez.g
    ; called to home the Z axis
    ;
    ; generated by RepRapFirmware Configuration Tool on Sat Apr 07 2018 15:34:24 GMT-0600 (Mountain Daylight 
    Time)
    G91               ; relative positioning
    G1 Z5 F6000 S2    ; lift Z relative to current position
    G1 S1 Z-185 F1800 ; move Z down until the switch triggers
    G92 Z2.5          ; set Z position to trigger height
    
    ; Uncomment the following lines to lift Z after probing
    ;G91              ; relative positioning
    ;G1 Z5 F100 S2    ; lift Z relative to current position
    ;G90              ; absolute positioning


  • You set z to 2.5 after it hits the end stop with the G92. This means the bed will be able to travel "2.5" beyond where the endstop is that could lead to colliding of the bed and nozzle. Have you tried printing with the G92 Z2.5 commented out with ";" in front?

    The key is to set it such that Z = 0 when the nozzle touches the bed as simplify 3D will usually move the bed -.01 per .1mm by default, so .18z for a .2mm layer height. If the nozzle touches at 2.5, then the bed will move 2.32mm at the start of each print to get to the z = .18.

    I had this problem when I first started out. In simplify3D you can also set the first layer height.



  • Ah I see..
    So in my home files I use relative to get to the stops. My Z hits the stop which should bottom me out and I should be able to level at this point as this should be the Z0 absolute. I then set the Z but tell at an offset of 2.5mm lower than where my Z stop was triggered.
    Then when my print starts, it tries to go to Z0 which is now actually Z0+2.5mm+first layer print height?
    Is it best to get the home on Z to be 1mm above the print surface, then set the layer height for the first layer off that in the software?



  • @coreyz I think I see what you are trying to do, unless I am missing something. The issue is that you would want to tell it its really at -2.5mm. The reason is that if you open the gcode file you will see that z is set to "0.18" for example. That means the printer sees that it is at 2.5mm and moves the bed closer to the nozzle to get it to 0.18". at -2.5mm it will move the bed down 2.5mm+.18 to get to position. I personally find it better level the bed to .1mm at z-0 and then let the slicer do the rest.


  • administrators

    By putting G92 Z2.5 after the G1 S1 Z-185 commands in homeall.g and homez.g you are telling the firmware that when the Z endstop triggers, the head is 2.5mm above the bed. If it's actually lower than that at the trigger point, change the figure 2.5 to the actual height of the nozzle above the bed when the endstop triggers. See https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Homing_Z.



  • Thanks BP and David, got it all sorted out. I think my brain was still fried from wiring and whatnot to comprehend what the Gcode was doing. Ive gotten it all working great now. Even added in a wipe in my startup script for priming the print. Learned a bunch with this and I really do appreciate your help!

    Now, on to print that bracket for the bltouch!


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.