Bed.g process drives motors past endstops



  • Hello,

    I am trying to get auto bed leveling working, and I'm running into an issue where the motors push past endstops and crash into the far sides of the X and Y axes.

    Before I run the bed leveling routine, I've already done x, y and z leveling.

    The web GUI won't let me push the motors past the endstops as defined once the home*.g files have been run.

    The problem I face is that once the G30 commands run, my machine lurches into horrible buzzing noises. It seems to be driving past the bounds that were set by the x, y and z endstop detection process. Let me know if there's something I'm missing!

    Here is the rest of my configuration:'
    https://github.com/dirtybirdnj/printrbot-duet-wifi

    Thanks for the advice!

    Here is the gcode in my bed.g file:

    [[language]]
    ; 7 points, 3 factors, probing radius: 150, probe offset (0, 0)
    G30 P0 X0.00 Y150.00 Z-99999 H0
    G30 P1 X129.90 Y-75.00 Z-99999 H0
    G30 P2 X-129.90 Y-75.00 Z-99999 H0
    G30 P3 X0.00 Y75.00 Z-99999 H0
    G30 P4 X64.95 Y-37.50 Z-99999 H0
    G30 P5 X-64.95 Y-37.50 Z-99999 H0
    G30 P6 X0 Y0 Z-99999 S3
    
    

    Here is my config.g file:

    [[language]]
    ; Communication and general
    M111 S0                             	; Debug off
    M550 OldYeller				; Machine name and Netbios name (can be anything you like)
    M551 Preprap                        	; Machine password (used for FTP)
    ;*** If you have more than one Duet on your network, they must all have different MAC addresses, so change the last digits
    M540 P0xBE:0xEF:0xDE:0xAD:0xFE:0xED 	; MAC Address
    ;*** Wifi Networking
    M552 S1					; Enable WiFi. Disabled for setup and testing. Enable once set up on your network.
    
    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
    
    ; Axis and motor configuration
    M569 P0 S1                          ; Drive 0 goes forwards (change to S0 to reverse it)
    M569 P1 S1                          ; Drive 1 goes backwards
    M569 P2 S1                          ; Drive 2 goes forwards
    M569 P3 S1                          ; Drive 3 goes forwards
    M569 P4 S1                          ; Drive 4 goes forwards
    
    M350 X16 Y16 Z16 E16 I1             ; set 16x microstepping with interpolation
    M574 X1 Y1 Z0 S1		    ; set homing switch configuration (Y and y switches, at low end, active high)
    M906 X800 Y800 Z800 E800            ; Set motor currents (mA)
    M201 X800 Y800 Z15 E100             ; Accelerations (mm/s^2)
    M203 X6000 Y6000 Z100 E600          ; Maximum speeds (mm/min)
    M566 X30 Y30 Z30 E20              ; Maximum jerk speeds mm/minute
    M208 X150 Y150 Z100                 ; set axis maxima and high homing switch positions (adjust to suit your machine)
    M208 X-0 Y0 Z0 S1                ; set axis minima and low homing switch positions (adjust to make X=0 and Y=0 the edges of the bed)
    M92 X80 Y80 Z2020 E95               ; set axis steps/mm
    ;M92 E420:420                       ; set extruder 0 and 1 steps/mm
    G21                                 ; Work in millimetres
    G90                                 ; Send absolute coordinates...
    M83                                 ; ...but relative extruder moves
    
    ; Thermistors
    M305 P0 T100000 B3950 R4700 H30 L0	; Put your own H and/or L values here to set the bed thermistor ADC correction
    M305 P1 T100000 B3974 R4700 H30 L0	; Put your own H and/or L values here to set the first nozzle thermistor ADC correction
    M305 P2 T100000 B3974 R4700 H30 L0	; Put your own H and/or L values here to set the second nozzle thermistor ADC correction
    M570 S180				; Hot end may be a little slow to heat up so allow it 180 seconds
    
    ; Fans
    ;M106 P1 H-1 				; disable thermostatic mode for fan 1
    
    ; Tool definitions
    M563 P0 D0 H1 F0:1                      ; Define tool 0 - Heater 1, Fan 0 (extruder) and Fan 1 (bed fan)
    G10 P0 S0 R0                        	; Set tool 0 operating and standby temperatures
    M92 E663:663                       	; Set extruder steps per mm
    
    ; Z probe and compensation definition
    ;*** If you have a switch instead of an IR probe, change P1 to P4 in the following M558 command
    M558 P5 X0 Y0 Z1			; Z probe is an inductive probe and is used for homing 
    G31 X25 Y0 Z0 P500			; Set the zprobe height and threshold (put your own values here)
    
    ;*** If you are using axis compensation, put the figures in the following command
    M556 S78 X0 Y0 Z0                   	; Axis compensation here
    
    M208 S1 Z-0			; set minimum Z
    ;
    T0					; select first hot end
    
    

  • administrators

    Deleted this post because it wasn't good advice for your machine configuration



  • The steps per mm for your Z axis look really odd to me. You did say it homes correctly so maybe it's right but you have them set to 2020. Assuming you are using a "standard" 1.8 degree stepper which gives 200 steps per rev, it would mean 10.1 revolutions of he stepper to get 1mm of movement which if you are using a screw, it would mean a pitch of 0.1mm which is impossible or it's 1mm pitch and you are using 1 to 10.1 gearing which is also odd.

    Edit. Scratch that - my maths were wrong - not awake yet

    2nd Edit. I should have divided by 16 again. I keep forgetting that the firmware calls it steps per mm but in fact it's asking for 1/16th micro steps per mm - always confuses me.
    Anyway, dividing 2020 by 16 then by 200 (assuming 1.8 degree motor) I get 0.63125 which is a strange number because it would equate to a gear ratio of 101:16000.


  • administrators

    Your machine is Cartesian but the bed.g file you are using is for a Delta printer.



  • @deckingman:

    The steps per mm for your Z axis look really odd to me. You did say it homes correctly so maybe it's right but you have them set to 2020. Assuming you are using a "standard" 1.8 degree stepper which gives 200 steps per rev, it would mean 10.1 revolutions of he stepper to get 1mm of movement which if you are using a screw, it would mean a pitch of 0.1mm which is impossible or it's 1mm pitch and you are using 1 to 10.1 gearing which is also odd.

    Yeah, one of the things that's super confusing about the machine itself is that the X and Y axes use metric lead screws, but the Z axis uses standard. I was given this machine by someone… and it's been a very complicated process figuring out exactly what parts it has (nozzle, hotend, etc). There IS a metric upgrade... but I don't know if it was done on my machine.

    https://printrbot.com/shop/z-lead-screw-4-start-upgrade/

    @dc42:

    Your machine is Cartesian but the bed.g file you are using is for a Delta printer.

    Ah, good catch. Thank you. Looks like I have some more reading/research to do tonight 🙂



  • @dirtybirdnj:

    …..............Yeah, one of the things that's super confusing about the machine itself is that the X and Y axes use metric lead screws, but the Z axis uses standard. I was given this machine by someone... and it's been a very complicated process figuring out exactly what parts it has (nozzle, hotend, etc). There IS a metric upgrade... but I don't know if it was done on my machine................

    Ah, a mixture of imperial and metric - that explain things. Anyway, if Z goes up a down by the amount that you tell it, then the steps/mm must be correct.



  • @deckingman:

    Ah, a mixture of imperial and metric - that explain things. Anyway, if Z goes up a down by the amount that you tell it, then the steps/mm must be correct.

    Haha yep it's weird. I found out that this upgrade has NOT been installed on my pb… so I'm going to order this part. One really nice thing is that it'll increase the Z range of my machine to 290mm! Keeping my configuration simpler (all metric) will be a nice benefit too.


Log in to reply