Homing cycle is not reliable

Home Forums TinyG TinyG Support Homing cycle is not reliable

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11978
    jrcandy
    Participant

    Hi there,
    I’m having a frustrating and mysterious problem when homing my TinyG machine. Basically sometimes it homes ok sometimes it crashes. Regardless of which axis.

    For example:
    G28.2 x0. Homes x ok. I send G28.2 x0 again and this time it crashes (log of this behaviour below) so I have to reset the board
    G28.2 z0. Homes z ok. I send G28.2 z0 again, homes ok again. Repeat a few times, it does it ok. Now I send G28.2 x0, homes X ok. I send G28.2 z0 again and it crashes, reset board.
    – I send G28.2 z0 x0 y0. It homes z first ok, x ok, then y crashes. Have to reset the board. Then I send G28.2 y0 and homes Y ok

    I have added a large Zero backoff to limit X as I read that it looked like there was a firmware bug creating problems when the limit switch is pressed while still accelerating but that doesn’t seem to be the issue

    The other firmware bug I’ve read about in which “TinyG starts to monitor the switches only after the homing sequence is fully started” also is not the whole problem, as sometimes I start from a pressed position and it does back off ok before coming back to hit it again

    Here I was also trying to get some clues

    My settings are (which by the way I don´t know how to send $$ via Universal Gcode Sender, had to send it via Chilipeppr):

    $$
    {“ej”:””}
    [fb] firmware build 440.20
    [fv] firmware version 0.97
    [hp] hardware platform 1.00
    [hv] hardware version 8.00
    [id] TinyG ID 9U6538-TWK
    [ja] junction acceleration 100000 mm
    [ct] chordal tolerance 0.0100 mm
    [sl] soft limit enable 0
    [st] switch type 1 [0=NO,1=NC]
    [mt] motor idle timeout 2.00 Sec
    [ej] enable json mode 0 [0=text,1=JSON]
    [jv] json verbosity 4 [0=silent,1=footer,2=messages,3=configs,4=linenum,5=verbose]
    [js] json serialize style 1 [0=relaxed,1=strict]
    [tv] text verbosity 1 [0=silent,1=verbose]
    [qv] queue report verbosity 1 [0=off,1=single,2=triple]
    [sv] status report verbosity 1 [0=off,1=filtered,2=verbose]
    [si] status interval 250 ms
    [ec] expand LF to CRLF on TX 0 [0=off,1=on]
    [ee] enable echo 0 [0=off,1=on]
    [ex] enable flow control 1 [0=off,1=XON/XOFF, 2=RTS/CTS]
    [baud] USB baud rate 5 [1=9600,2=19200,3=38400,4=57600,5=115200,6=230400]
    [net] network mode 0 [0=master]
    [gpl] default gcode plane 0 [0=G17,1=G18,2=G19]
    [gun] default gcode units mode 1 [0=G20,1=G21]
    [gco] default gcode coord system 1 [1-6 (G54-G59)]
    [gpa] default gcode path control 2 [0=G61,1=G61.1,2=G64]
    [gdi] default gcode distance mode 0 [0=G90,1=G91]
    [1ma] m1 map to axis 0 [0=X,1=Y,2=Z…]
    [1sa] m1 step angle 1.800 deg
    [1tr] m1 travel per revolution 8.0000 mm
    [1mi] m1 microsteps 8 [1,2,4,8]
    [1po] m1 polarity 0 [0=normal,1=reverse]
    [1pm] m1 power management 2 [0=disabled,1=always on,2=in cycle,3=when moving]
    [2ma] m2 map to axis 1 [0=X,1=Y,2=Z…]
    [2sa] m2 step angle 1.800 deg
    [2tr] m2 travel per revolution 8.0000 mm
    [2mi] m2 microsteps 8 [1,2,4,8]
    [2po] m2 polarity 0 [0=normal,1=reverse]
    [2pm] m2 power management 2 [0=disabled,1=always on,2=in cycle,3=when moving]
    [3ma] m3 map to axis 2 [0=X,1=Y,2=Z…]
    [3sa] m3 step angle 1.800 deg
    [3tr] m3 travel per revolution 8.0000 mm
    [3mi] m3 microsteps 8 [1,2,4,8]
    [3po] m3 polarity 0 [0=normal,1=reverse]
    [3pm] m3 power management 2 [0=disabled,1=always on,2=in cycle,3=when moving]
    [4ma] m4 map to axis 3 [0=X,1=Y,2=Z…]
    [4sa] m4 step angle 1.800 deg
    [4tr] m4 travel per revolution 360.0000 mm
    [4mi] m4 microsteps 8 [1,2,4,8]
    [4po] m4 polarity 0 [0=normal,1=reverse]
    [4pm] m4 power management 2 [0=disabled,1=always on,2=in cycle,3=when moving]
    [xam] x axis mode 1 [standard]
    [xvm] x velocity maximum 800 mm/min
    [xfr] x feedrate maximum 800 mm/min
    [xtn] x travel minimum -75.000 mm
    [xtm] x travel maximum 75.000 mm
    [xjm] x jerk maximum 20 mm/min^3 * 1 million
    [xjh] x jerk homing 100 mm/min^3 * 1 million
    [xjd] x junction deviation 0.0500 mm (larger is faster)
    [xsn] x switch min 0 [0=off,1=homing,2=limit,3=limit+homing]
    [xsx] x switch max 1 [0=off,1=homing,2=limit,3=limit+homing]
    [xsv] x search velocity 500 mm/min
    [xlv] x latch velocity 100 mm/min
    [xlb] x latch backoff 50.000 mm (just changed these 2 as per your suggestion)
    [xzb] x zero backoff 10.000 mm
    [yam] y axis mode 1 [standard]
    [yvm] y velocity maximum 2000 mm/min
    [yfr] y feedrate maximum 800 mm/min
    [ytn] y travel minimum 0.000 mm
    [ytm] y travel maximum 260.000 mm
    [yjm] y jerk maximum 20 mm/min^3 * 1 million
    [yjh] y jerk homing 40 mm/min^3 * 1 million
    [yjd] y junction deviation 0.0500 mm (larger is faster)
    [ysn] y switch min 0 [0=off,1=homing,2=limit,3=limit+homing]
    [ysx] y switch max 1 [0=off,1=homing,2=limit,3=limit+homing]
    [ysv] y search velocity 400 mm/min
    [ylv] y latch velocity 100 mm/min
    [ylb] y latch backoff 5.000 mm
    [yzb] y zero backoff 0.000 mm
    [zam] z axis mode 1 [standard]
    [zvm] z velocity maximum 800 mm/min
    [zfr] z feedrate maximum 800 mm/min
    [ztn] z travel minimum 0.000 mm
    [ztm] z travel maximum 75.000 mm
    [zjm] z jerk maximum 20 mm/min^3 * 1 million
    [zjh] z jerk homing 40 mm/min^3 * 1 million
    [zjd] z junction deviation 0.0500 mm (larger is faster)
    [zsn] z switch min 0 [0=off,1=homing,2=limit,3=limit+homing]
    [zsx] z switch max 1 [0=off,1=homing,2=limit,3=limit+homing]
    [zsv] z search velocity 200 mm/min
    [zlv] z latch velocity 100 mm/min
    [zlb] z latch backoff 5.000 mm
    [zzb] z zero backoff 0.000 mm
    [aam] a axis mode 3 [radius]
    [avm] a velocity maximum 230400 deg/min
    [afr] a feedrate maximum 230400 deg/min
    [atn] a travel minimum -1.000 deg
    [atm] a travel maximum -1.000 deg
    [ajm] a jerk maximum 5760 deg/min^3 * 1 million
    [ajh] a jerk homing 11520 deg/min^3 * 1 million
    [ajd] a junction deviation 0.0500 deg (larger is faster)
    [ara] a radius value 0.1989 deg
    [asn] a switch min 1 [0=off,1=homing,2=limit,3=limit+homing]
    [asx] a switch max 0 [0=off,1=homing,2=limit,3=limit+homing]
    [asv] a search velocity 600 deg/min
    [alv] a latch velocity 100 deg/min
    [alb] a latch backoff 5.000 deg
    [azb] a zero backoff 2.000 deg
    [bam] b axis mode 0 [disabled]
    [bvm] b velocity maximum 3600 deg/min
    [bfr] b feedrate maximum 3600 deg/min
    [btn] b travel minimum -1.000 deg
    [btm] b travel maximum -1.000 deg
    [bjm] b jerk maximum 20 deg/min^3 * 1 million
    [bjd] b junction deviation 0.0500 deg (larger is faster)
    [bra] b radius value 1.0000 deg
    [cam] c axis mode 0 [disabled]
    [cvm] c velocity maximum 3600 deg/min
    [cfr] c feedrate maximum 3600 deg/min
    [ctn] c travel minimum -1.000 deg
    [ctm] c travel maximum -1.000 deg
    [cjm] c jerk maximum 20 deg/min^3 * 1 million
    [cjd] c junction deviation 0.0500 deg (larger is faster)
    [cra] c radius value 1.0000 deg
    [p1frq] pwm frequency 100 Hz
    [p1csl] pwm cw speed lo 1000 RPM
    [p1csh] pwm cw speed hi 2000 RPM
    [p1cpl] pwm cw phase lo 0.125 [0..1]
    [p1cph] pwm cw phase hi 0.200 [0..1]
    [p1wsl] pwm ccw speed lo 1000 RPM
    [p1wsh] pwm ccw speed hi 2000 RPM
    [p1wpl] pwm ccw phase lo 0.125 [0..1]
    [p1wph] pwm ccw phase hi 0.200 [0..1]
    [p1pof] pwm phase off 0.100 [0..1]
    [g54x] g54 x offset -0.000 mm
    [g54y] g54 y offset 0.000 mm
    [g54z] g54 z offset 0.000 mm
    [g54a] g54 a offset 0.000 deg
    [g54b] g54 b offset 0.000 deg
    [g54c] g54 c offset 0.000 deg
    [g55x] g55 x offset 75.000 mm
    [g55y] g55 y offset 75.000 mm
    [g55z] g55 z offset 0.000 mm
    [g55a] g55 a offset 0.000 deg
    [g55b] g55 b offset 0.000 deg
    [g55c] g55 c offset 0.000 deg
    [g56x] g56 x offset 0.000 mm
    [g56y] g56 y offset 0.000 mm
    [g56z] g56 z offset 0.000 mm
    [g56a] g56 a offset 0.000 deg
    [g56b] g56 b offset 0.000 deg
    [g56c] g56 c offset 0.000 deg
    [g57x] g57 x offset 0.000 mm
    [g57y] g57 y offset 0.000 mm
    [g57z] g57 z offset 0.000 mm
    [g57a] g57 a offset 0.000 deg
    [g57b] g57 b offset 0.000 deg
    [g57c] g57 c offset 0.000 deg
    [g58x] g58 x offset 0.000 mm
    [g58y] g58 y offset 0.000 mm
    [g58z] g58 z offset 0.000 mm
    [g58a] g58 a offset 0.000 deg
    [g58b] g58 b offset 0.000 deg
    [g58c] g58 c offset 0.000 deg
    [g59x] g59 x offset 0.000 mm
    [g59y] g59 y offset 0.000 mm
    [g59z] g59 z offset 0.000 mm
    [g59a] g59 a offset 0.000 deg
    [g59b] g59 b offset 0.000 deg
    [g59c] g59 c offset 0.000 deg
    [g92x] g92 x offset 0.000 mm
    [g92y] g92 y offset 0.000 mm
    [g92z] g92 z offset 0.000 mm
    [g92a] g92 a offset 0.000 deg
    [g92b] g92 b offset 0.000 deg
    [g92c] g92 c offset 0.000 deg
    [g28x] g28 x position 0.000 mm
    [g28y] g28 y position 0.000 mm
    [g28z] g28 z position 0.000 mm
    [g28a] g28 a position 0.000 deg
    [g28b] g28 b position 0.000 deg
    [g28c] g28 c position 0.000 deg
    [g30x] g30 x position 0.000 mm
    [g30y] g30 y position 0.000 mm
    [g30z] g30 z position 0.000 mm
    [g30a] g30 a position 0.000 deg
    [g30b] g30 b position 0.000 deg
    [g30c] g30 c position 0.000 deg
    tinyg [mm] ok>
    {“Lbs”:0}
    {“r”:{“ej”:1},”f”:[1,0,10,7782]}

    Starting from the leftmost position (in my setup x is positive to left, negative to right), and pressing the limit switch, I send G28.2 x0 via UGS and I get:

    >>> g28.2 x0
    {“r”:{},”f”:[1,0,9,4402]}
    {“sr”:{“stat”:9,”dist”:1,”coor”:0}}
    {“sr”:{“posx”:-0.187,”mpox”:-0.200,”vel”:162.33}}
    {“sr”:{“posx”:-1.555,”mpox”:-1.555,”vel”:472.61}}
    {“sr”:{“posx”:-3.542,”mpox”:-3.583,”vel”:500.00}}
    {“sr”:{“posx”:-5.580,”mpox”:-5.580,”vel”:491.20}}
    {“sr”:{“posx”:-7.104,”mpox”:-7.122,”vel”:214.98}}
    {“sr”:{“posx”:-7.417,”mpox”:-7.417,”vel”:1.11}}
    {“sr”:{“posx”:-7.417,”mpox”:-7.417,”vel”:0.00}}
    {“sr”:{“posx”:-6.505,”mpox”:-6.505,”vel”:495.49}}
    {“sr”:{“posx”:-4.465,”mpox”:-4.465,”vel”:500.00}}
    {“sr”:{“posx”:-2.701,”mpox”:-2.701,”vel”:189.91}}
    {“sr”:{“posx”:-2.598,”mpox”:-2.598,”vel”:0.00}}
    {“sr”:{“posx”:-2.898,”mpox”:-2.898,”vel”:100.00}}
    {“sr”:{“posx”:-3.306,”mpox”:-3.306}}
    {“sr”:{“posx”:-3.714,”mpox”:-3.714}}
    {“sr”:{“posx”:-4.114,”mpox”:-4.114}}
    {“sr”:{“posx”:-4.522,”mpox”:-4.522}}
    {“sr”:{“posx”:-4.747,”mpox”:-4.747,”vel”:0.01}}
    {“sr”:{“posx”:-5.700,”mpox”:-5.700,”vel”:497.46}}
    {“sr”:{“posx”:-7.734,”mpox”:-7.734,”vel”:500.00}}
    {“sr”:{“posx”:-9.726,”mpox”:-9.726}}
    {“sr”:{“posx”:-11.761,”mpox”:-11.761}}
    {“sr”:{“posx”:-13.795,”mpox”:-13.795,”vel”:498.77}}
    {“sr”:{“posx”:-14.747,”mpox”:-14.747,”vel”:0.10}}
    {“sr”:{“posx”:150.000,”mpox”:150.000,”vel”:0.00}}
    {“sr”:{“posx”:0.000,”mpox”:0.000,”stat”:3,”dist”:0,”coor”:1}}

    which homed it all right. Note it started with the switch pressed so it does back off to the right until it’s not pressed anymore, up to x -7.417. Note it reached seek speed of 500. Then it moves to the left, at speed 500, to press the switch, which it does at about X-2.5. Then it keeps moving to the right at speed 100 for the latch backoff distance, seems the switch opens again at x”:-4.747. Then it moves more for the zero backoff of 10, at speed 500, until it reaches x”:-14.747. SO FAR SO GOOD

    Now let’s send the same command again..

    >>> g28.2 x0
    {“r”:{},”f”:[1,0,9,4402]}
    {“sr”:{“stat”:9,”dist”:1,”coor”:0}}
    {“sr”:{“posx”:0.200,”mpox”:0.200,”vel”:162.33}}
    {“sr”:{“posx”:1.555,”mpox”:1.555,”vel”:472.61}}
    {“sr”:{“posx”:3.583,”mpox”:3.583,”vel”:500.00}}
    {“sr”:{“posx”:5.583,”mpox”:5.583}}
    {“sr”:{“posx”:7.625,”mpox”:7.625}}
    {“sr”:{“posx”:9.625,”mpox”:9.625}}
    {“sr”:{“posx”:11.664,”mpox”:11.664,”vel”:492.70}}
    {“sr”:{“posx”:13.211,”mpox”:13.211,”vel”:230.49}}
    {“sr”:{“posx”:13.541,”mpox”:13.541,”vel”:1.60}}
    {“sr”:{“posx”:13.542,”mpox”:13.542,”vel”:0.00}}
    {“sr”:{“posx”:14.494,”mpox”:14.494,”vel”:497.46}}

    Remember we were 10 mm away from the switch. It starts moving left (x positive direction) again, in 3.5 mm it looks it reached max seek velocity of 500. Around x10 it hits the switch as expected and starts decelerating until it stops momentarily at x13.542. The issue comes here, when it sets the speed to 500, when it should be 100, but worst of all it goes left again instead of right, colliding with the switch

    very strange!

    Thank you all

    #11979
    cmcgrath5035
    Moderator

    There is a lot of info to look at, some quick suggestions
    Have you read wiki at https://github.com/synthetos/TinyG/wiki/Homing-and-Limits-Description-and-Operation ?

    You have enabled limits at X max, Y max, Z max, which is unusual, but should work.

    I travel is “-“, by convention, so Zmax should be 0 and Z min -75.
    It will take some deeper analysis to see if that explains some of your behavior

    #11980
    jrcandy
    Participant

    Hi, thanks for the reply
    I’ll keep investigating, I have read the wiki, but what puzzles me is that sometimes it works well and then later it doesn’t

    #11981
    cmcgrath5035
    Moderator

    When you run a g28.2 x0 and it completes correctly, what is the resulting X position? Seems it should be x=75, your Xmax parameter setting

    #11982
    jrcandy
    Participant

    Hi, I will check, but I have to solve a bigger issue now… : https://www.youtube.com/watch?v=amP-Si6v8rI
    (I rechecked the power wires). It does it without a motor plugged into motor1, and with a motor plugged too (and different motors, so issue is not with the motor)

    Thanks

    • This reply was modified 2 years, 10 months ago by jrcandy.
    #11986
    cmcgrath5035
    Moderator

    RE: your YouTube – Each enabled motor should display green leds for $mt seconds upon reset, that is, all motors will be energized to hold current 0,0,0 position for that period of time. For your setup, that should be 2 seconds. The flickering over long term is odd. The fact that the one led stays on longer than 2 seconds seems to say either a foreign voltage (off board) is making it back to the tinyG motor leads of, perhaps, the motor driver device has been compromised. Tray enabling all 4 motors and observed the 2 second led behavior.

    I had a chance finally to look closely at your homing sequence run, posted in your initial item.
    Looking at these three lines from your initial homing run.
    ——-
    ….
    {“sr”:{“posx”:-14.747,”mpox”:-14.747,”vel”:0.10}}
    {“sr”:{“posx”:150.000,”mpox”:150.000,”vel”:0.00}}
    {“sr”:{“posx”:0.000,”mpox”:0.000,”stat”:3,”dist”:0,”coor”:1}}
    ——-
    I’ll disagree that the homing was successful, at least as I understand your homing intentions.
    You have set the X(max) switch as the “home” for X.
    The end result of homing has set that location as X=0.
    From your setup parameters, you want to set the machine up with a X total range of 150, presumably you intend to operate the machine zero centered using the g55 coordinate system. So Xmax location should be 150, if I understand your intentions.
    It appears that the second to last “sr” above achieved that, but then
    in the final “sr” that has become the zero location.

    I also wonder if your manual pressing of the limit switches is adding confusion, as it seems to imply that only open or closed states matter.
    You may find that low-high and high low transitions are important to the the firmware. Try by manually jogging the machine away from the limits and re-sending your g28.2

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.