SOLVED G1 Issues



  • Nearing the end of setting up my new Core XY but have run into a strange problem with the various Homing routines.

    If I turn the printer on and attempt to move any of the axes with either a home command or a G1 command, all of a sudden nothing happens.

    If however I send M564 SO H0, then G1 commands work as do the Homing routines with one exception. In the Home All routine X Y and Z all home but the routine stops and leaves the head in the middle of the bed .
    Current Config G is:
    ; General preferences
    G90 ; send absolute coordinates...
    M83 ; ...but relative extruder moves
    M669 K1 ; select CoreXY mode

    ; Network
    M552 S1 ; enable network
    M586 P0 S1 ; enable HTTP
    M586 P1 S0 ; disable FTP
    M586 P2 S0 ; disable Telnet
    M552 S1 ; enable WiFi

    ; Drives
    M569 P0 S0 ; physical drive 0 goes backwards
    M569 P1 S0 ; physical drive 1 goes backwards
    M569 P2 S1 ; physical drive 2 goes forwards
    M569 P3 S1 ; physical drive 3 goes forwards
    M584 X0 Y1 Z2 E3 ; set drive mapping
    M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation
    M92 X80.00 Y80.00 Z3176 E932.00 ; set steps per mm
    M566 X900.00 Y900.00 Z60.00 E120.00 ; set maximum instantaneous speed changes (mm/min)
    M203 X6000.00 Y6000.00 Z180.00 E1200.00 ; set maximum speeds (mm/min)
    M201 X500.00 Y500.00 Z20.00 E250.00 ; set accelerations (mm/s^2)
    M906 X400 Y400 Z800 E800 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 X300 Y300 Z300 S0 ; set axis maxima

    ; Endstops
    M574 XY S3 ; configure sensorless endstop for X and Y
    M915 XY R0 F0 ; Set up sensorless homing
    M574 Z1 S2 ; configure Z-probe endstop for low end on Z

    ; Z-Probe
    M950 S0 C"exp.heater7" ; create servo pin 0 for BLTouch
    M558 P9 C"^zprobe.in" H5 F120 T6000 ; set Z probe type to bltouch and the dive height + speeds
    G31 P500 X59 Y0 Z0.90 ; set Z probe trigger value, offset and trigger height
    M557 X15:215 Y15:195 S20 ; define mesh grid

    ; Heaters
    M308 S0 P"bedtemp" Y"Thermistor" T113800 B4138 ; configure sensor 0 as thermistor on pin bedtemp
    M950 H0 C"bedheat" T0 ; create bed heater output on bedheat and map it to sensor 0
    ;M307 H0 B0 S1.00 ; enable bang-bang mode for the bed heater and set PWM limit
    M140 H0 ; Set Bed Tempersture(Fast)
    M143 H0 S120 ; set temperature limit for Heated Bed to 120C
    M307 H0 R1.224 C143.9 D3.52 S1.0 ;PID Tune 31 Jan 21
    M308 S1 P"e0temp" Y"thermistor" T100000 ; configure sensor 1 as thermistor on pin e0temp
    M950 H1 C"e0heat" T1 ; create nozzle heater output on e0heat and map it to sensor 1
    M307 H1 R1.991 C245.5 D7.44 S1.00 V12.0 ; PID Tune 8 Feb 21
    M143 H1 S280 ; set temperature limit for heater 1 to 280C

    ; Fans
    ;M950 F0 C"Blower" Q500 ; create fan 0 on pin fan0 and set its frequency
    ;M106 P0 S0 H-1 ; set fan 0 value. Thermostatic control is turned off
    ;M950 F1 C"Hot End" Q500 ; create fan 1 on pin fan1 and set its frequency
    ;M106 P1 S1 H1 T45 ; set fan 1 value. Thermostatic control is turned on

    ; Tools
    M563 P0 D0 H1 F0 ; define tool 0
    G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets
    G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C

    ; Miscellaneous
    M575 P1 S1 B57600 ; enable support for PanelDue

    Current Homeall is:
    homeall.g
    ; called to home all axes
    ;

    M400 ; make sure everything has stopped before we make changes
    M402 ; Retract BL Touch

    M915 X Y S2 R0 F0 ; set X and Y to sensitivity 2, do nothing when stall, unfiltered
    M574 X1 Y1 S3 ; set endstops to use motor stall
    G91 ; use relative positioning
    G1 Z5 F1200 ; Lower bed 5mm

    G1 H1 X-325 Y-325 F3600 ; move right/back 325mm, stopping at the endstop

    G1 X5 Y5 ; move away from home

    ;;;;;;;;; X or Y is homed at this point, now home the other axis

    G1 H1 X-325 F3600 ; move towards axis minimum
    G1 H1 Y-325 F3600 ; move towards axis minimum
    G1 X5 Y5 ; move away from home
    ;;;;;;;;;;;;;;;;; Now Home Z
    G90 ; absolute positioning
    G1 X150 Y150 F2000 ; move head to bed center
    G30 ; Lower head, stop when probe triggered and set Z to trigger height
    G91 ;relative positioning
    G1 X0 Y0 F2000 S2 ;Return head to home position

    M400 ; make sure everything has stopped before we reset the motor currents

    G90 ; back to absolute positioning



  • Looks like the last home move in your homeall.g:

    G1 X0 Y0 F2000 S2 ;Return head to home position
    

    is being made using relative co-ordinates and so will do nothing. Also I'm not sure you need the S2 parameter on that move?



  • @gloomyandy

    Thanks for that. That has fixed the final part of the Homeall routine.

    But still don't know why nothing moves until I give the M564 SO HO command.



  • @Pierre52 said in G1 Issues:

    @gloomyandy

    Thanks for that. That has fixed the final part of the Homeall routine.

    But still don't know why nothing moves until I give the M564 SO HO command.

    You've got this line in your homeALL.g file...

    G1 Z5 F1200 ; Lower bed 5mm

    At that point if Z has not been homed you should get a un-homed axis error.

    Try this instead...

    G1 H2 Z5 F1200


    You also have this...

    G1 X5 Y5 ; move away from home

    ;;;;;;;;; X or Y is homed at this point, now home the other axis

    If only X or Y is homed then that G1 command should cause a un-homed axis error.


    Frederick



  • @fcwilt thanks for the input. I'll give that a try.

    Still looking to resolve the no move without M564 tho


  • Moderator

    @Pierre52 said in G1 Issues:

    Still looking to resolve the no move without M564 tho

    Is the stall being detected instantly perhaps? Is it marking the axis as homed afterwards?



  • Yep pretty much instantly


  • Moderator

    Tune your sensitivity?



  • @Pierre52 said in G1 Issues:

    @fcwilt thanks for the input. I'll give that a try.

    Still looking to resolve the no move without M564 tho

    Well in the code I commented about you were twice attempting to move un-homed axes.

    The M564 allows you to do this but you really should not have to use M564.

    Did you try the changes I mentioned?

    Frederick



  • @Phaedrux "Tune your sensitivity" Sorry but you have just exceeded my level of expertise.



  • @fcwilt Apologies Frederick but I was tied up with a bunch of other stuff yesterday.

    I added H2 to the G1 command (what does H2 actually do as it doesn't feature in the RepRap decode?).

    With H2 added the Home All command now starts the sequence but when the closest of x or y is reached the procedure stops at the end of this line in Homeall:
    G1 H1 X-325 Y-325 F3600 ; move right/back 325mm, stopping at the endstop

    More confusing, If Y is closest to home then the procedure stops as above with Y homed but the Dashboard shows X is homed but Y isn't.



  • @Pierre52 said in G1 Issues:

    @fcwilt Apologies Frederick but I was tied up with a bunch of other stuff yesterday.

    I added H2 to the G1 command (what does H2 actually do as it doesn't feature in the RepRap decode?).

    With H2 added the Home All command now starts the sequence but when the closest of x or y is reached the procedure stops at the end of this line in Homeall:
    G1 H1 X-325 Y-325 F3600 ; move right/back 325mm, stopping at the endstop

    More confusing, If Y is closest to home then the procedure stops as above with Y homed but the Dashboard shows X is homed but Y isn't.

    Something is wrong.

    I don't normally home X and Y at the same time but to be sure I understood the behavior I modified by homeALL.g file to do so

    This is what I did (the numbers are for my printer)...

    G91                   ; relative moves
    G1 H1 X210 Y-210 F1200; 1st pass - this moved until BOTH endstops were triggered
    G1 X-20 Y+20          ; back off a bit
    G1 H1 X30 Y-30 F300   ; 2nd pass - this also moved until BOTH endstops were triggered
    

    If your are endstops are configured correctly and are working that is all you should need to do to home X AND Y.

    I did not show any code to move Z - just wanted to focus on X and Y.

    HOWEVER you are using stalling to home - I don't know if that works the same.

    I liken homing with stalling to stopping your car by running into the car in front of you - I prefer using the brakes. 😉

    Frederic


  • Moderator

    @Pierre52 said in G1 Issues:

    M915 X Y S2 R0 F0 ; set X and Y to sensitivity 2, do nothing when stall, unfiltered

    You've got a command to configure stallguard, but you'll need to tune the sensitivity and motor current to get reliable movement and stalls.

    https://duet3d.dozuki.com/Wiki/Stall_detection_and_sensorless_homing



  • @fcwilt and @Phaedrux apologies for not responding sooner but I have been away for several days.
    I have tried all of your suggestions but seem no closer to solving this. In fact I have been experimenting like crazy will all of the homing files to see if I could even get one of them to work.

    The weirdest thing is that I am currently getting perfect homing on X Y and Z with this Home All file below but using M564.

    Even though I have the same M915, and M574 in Config.G, If I comment them out in this file nothing happens.

    Even more weirdly, Z is homing in the center of the bed even though it is commented out in this version of Home All. I can only presume that the Home Z file is run after this one.

    It also seems that a G91 line after the probe has been triggered stops any further movement command from being executed. I have put the Home Z file below the Home G

    Homeall.g
    M400 ; make sure everything has stopped before we make changes

    M564 S0 H0
    M915 X Y S2 R0 F0 ; set X and Y to sensitivity 2, do nothing when stall, unfiltered
    M574 X1 Y1 S3 ; set endstops to use motor stall
    G91 ; use relative positioning
    G1 Z5 F1200 ; Lower bed 5mm

    G1 H1 X-325 F3600 ; Move X to Home
    G1 X5 ; move away from home Left end stop

    G1 H1 Y-325 F3600 ; move Y to home

    G1 Y5 ; move away from home
    G90

    ;homez.g
    ; called to home the Z axis
    ;
    ; generated by RepRapFirmware Configuration Tool v3.2.2 on Fri Jan 22 2021 13:39:52 GMT+1300 (New Zealand Daylight Time)

    M400 ; make sure everything has stopped before we make changes
    M402 ; Retract BL Touch

    G91 ; use relative positioning

    G1 Z5 F1200 ; Lower bed 5mm to enure clear of Z Probe

    G90 ; absolute positioning
    G1 X150 Y150 F4000 ; move head to bed center
    G30 ; Lower head, stop when probe triggered and set Z to trigger height
    G91 ; relative positioning

    G1 X0 Y0 F4000 ; Return head to home position

    M400 ; make sure everything has stopped before we reset the motor currents

    G90 ; back to absolute position



  • @Pierre52 said in G1 Issues:

    Even though I have the same M915, and M574 in Config.G, If I comment them out in this file nothing happens.

    That simply makes no sense at all. If the appear in config.g and they have to be duplicated somewhere else then something else you are doing is canceling them out.

    Even more weirdly, Z is homing in the center of the bed even though it is commented out in this version of Home All. I can only presume that the Home Z file is run after this one.

    homeall.g all will not call homeZ.g unless you are doing something in homeall.g that makes that happen - it does not happen on it's own.


    About homing in general:

    There are movement commands specifically designed to be used to home the axes in your machine. You need to learn to use them and not just use M564 to allow everything to happen.

    You can use relative G1 H1 commands to move an un-homed axis towards it's endstop and stop when the endstop is triggered. The endstop can be of any type including "stalling".

    You can use relative G1 H2 commands to move an un-homed axis as needed to home another axis - such as making sure Z is clear of the bed before homing X or Y.


    Your homeall.g file:

     M400                  ; make sure everything has stopped before we make changes
     M564 S0 H0
     M915 X Y S2 R0 F0     ; set X and Y to sensitivity 2, do nothing when stall, unfiltered
     M574 X1 Y1 S3         ; set endstops to use motor stall
     G91                   ; use relative positioning
     G1 Z5 F1200           ; Lower bed 5mm
     G1 H1 X-325 F3600     ; Move X to Home
     G1 X5                 ; move away from home Left end stop
     G1 H1  Y-325 F3600    ; move Y to home
     G1  Y5                ; move away from home
     G90
    

    OK let us discuss your homeall.g file line by line:

    line 1 is fine
    line 2 should not be needed if the rest of the file is correct
    line 3 should be fine if you have the command parameters correct
    line 4 should be fine if you have the command parameters correct
    line 5 is fine
    line 6 is will not work without the M564 above. Use G1 H2 as mentioned.
    line 7 is fine
    line 8 is fine but I don't know why you have it
    line 9 is fine
    line 10 is fine but I don't know why you have it
    line 11 is fine

    Now nowhere in that file did you home Z and it's supposed to be homed in your homeall.g file. Why did you not home Z?


    Your homez.g file:

    M400                  ; make sure everything has stopped before we make changes
    M402                  ; Retract BL Touch
    G91                   ; use relative positioning
    G1 Z5 F1200           ; lower bed 5mm to enure clear of Z Probe
    G90                   ; absolute positioning
    G1 X150 Y150 F4000    ; move head to bed center
    G30                   ; Lower head, stop when probe triggered and set Z to trigger height
    G91                   ; relative positioning
    G1 X0 Y0 F4000        ; Return head to home position
    M400                  ; make sure everything has stopped before we reset the motor currents
    G90                   ; back to absolute position
    

    OK let us discuss your homez.g file line by line:

    line 1 makes no sense you since don't actually change anything that might need it
    line 2 is not needed as BLTouch probes are deployed/retracted automatically as needed
    line 3 is fine
    line 4 will not work as Z may not be homed at this point. Use G1 H2 as mentioned.
    line 5 is fine
    line 6 may not work as X or Y may not be homed at this point use G1 H2 as mentioned.
    line 7 should work - the probe should move toward the bed and stop when activated
    line 8 is fine
    line 9 may not work as X or Y may not be homed at this point use G1 H2 as mentioned.
    line 10 makes no sense you since don't actually change anything that might need it
    line 11 is fine


    If you find yourself wanting to use M564 that should be a warning to you that you are very likely doing something wrong.

    When in doubt - ask us.

    Frederick



  • @fcwilt . Than you Frederick I have finally got an explanation of what H2 does in the G90 command. I have been searching for this for ages and your explanations of H1 and H2 above finally made sense of everything. I was also having some fun getting my head around where and when if should be using G90 vs G91.

    I have now rebuilt my Home all file and everything now works exactly as it should. No need for M594 any more.

    The working Home all looks like this:

    M400 ; make sure everything has stopped before we make changes

    M915 X Y S2 R0 F0 ; set X and Y to sensitivity 2, do nothing when stall, unfiltered
    M574 X1 Y1 S3 ; set end stops to use motor stall
    G91 ; use relative positioning
    G1 H2 Z5 F1200 ; Lower bed 5mm

    G1 H1 X-325 F3600 ; Move X to Home
    G1 H1 Y-325 F3600 ; move Y to home

    G90 ; Use Absolute positioning
    G1 X150 Y150 F4000 ; Move head to center of bed
    G30 ; Lower Head, Stop when probe triggered and set Z to trigger height

    G1 X0 Y0 F4000 ; Return Head to Home



  • @Pierre52

    Glad to hear you finally got it sorted.

    You know of course that you are supposed to have separate .g files to home X, Y and Z.

    • homeX.g
    • homeY.g
    • homeZ.g

    You want to see my homeALL.g file?

    M98 P"homeZ.g"
    M98 P"homeX.g"
    M98 P"homeY.g"
    

    Yes it doesn't "optimize" homing as some folks do, such as homing X and Y at the same time but it does keep it simpler for my aging mind - the code to home a given axis exists in only one file.

    Frederick



  • @fcwilt Hi Frederick. Yes I did cut the relevant parts into X Y and Z homing files. Your input has also significantly reduced the number of lines in each. Thanks again for all your help.

    Cheers
    Peter



  • @Pierre52 said in G1 Issues:

    @fcwilt Hi Frederick. Yes I did cut the relevant parts into X Y and Z homing files. Your input has also significantly reduced the number of lines in each. Thanks again for all your help.

    Cheers
    Peter

    Always glad to help when I can - and if I cannot help I will try to not make things worse. 😉

    Frederick


Log in to reply