Many issues with limit switches and homing

Home Forums TinyG TinyG Support Many issues with limit switches and homing

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #4022
    sfeine
    Member

    Machine has 3 limit switches,  all normally closed, located at the top of z, left on x, and front on y, all have been tested with multimeter.

    All of the settings for the machine should be correct and motors move just fine.

    When a g28.2 x0 command is given to the machine (should move axis until it hits switch) machine does not move and returns coor:0,dist:1,momo:1,stat:9.

    Then board becomes unresponsive to any input but reset command (control x or switch press).

    When g28.2 x0 command is issued while limit switch is being held down machine will move the axis twice away from the limit switch before stopping. While moving position updates are displayed and after move is completed if switch is released and re pressed, posx:0.000,coor:1,dist:0,momo:4,stat:3 is returned and machine is still responsive to input.

    Similar results with z axis. g28.2 z0 command issued. Axis moves up twice before stopping (switch position does not matter) and becoming unresponsive. on this axis however switch press does nothing and machine will also continue to move while switch is pressed.

    Y axis behaves in exact same way as x axis.

    All of the settings for the limit switches and what they do should be right, and they should be plugged into the right headers, x-min,y-max,z-min.

    To add to the list of troubles, if the switches are set to both home and be limit switches (option 3) then when issued a g-code command the machine will move a bit then stop and spit out an error after which time it will become unresponsive until reset.

    I have flashed the firmware and the machine is using rev 370.08 (the newest of the master branch) (this is the only firmware version that I have tried) to no avail.

    Any help is defiantly appreciated

    -Sam

     

     

    #4023
    cmagagna
    Member

    Can you post your $, $x, $y, $z settings?

    #4024
    Riley
    Keymaster

    Did you set your switch type?

     

    [st]  switch type                 0 [0=NO,1=NC]

     

    $st=1 would set this to Normally Closed.

    This ONE setting applies to ALL switches.

     

    Riley

    #4030
    sfeine
    Member

    [fb]  firmware build            370.08

    [fv]  firmware version            0.95

    [hv]  hardware version            7.00

    [id]  TinyG ID                    9H3906-PFX

    [ja]  junction acceleration  100000 mm

    [ct]  chordal tolerance           0.010 mm

    [st]  switch type                 1 [0=NO,1=NC]

    [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]

    [tv]  text verbosity              1 [0=silent,1=verbose]

    [qv]  queue report verbosity      0 [0=off,1=filtered,2=verbose]

    [sv]  status report verbosity     1 [0=off,1=filtered,2=verbose]

    [si]  status interval           100 ms

    [ic]  ignore CR or LF on RX       0 [0=off,1=CR,2=LF]

    [ec]  expand LF to CRLF on TX     0 [0=off,1=on]

    [ee]  enable echo                 0 [0=off,1=on]

    [ex]  enable xon xoff             1 [0=off,1=on]

    [baud] USB baud rate              5 [1=9600,2=19200,3=38400,4=57600,5=115200,6=230400]

    [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]

     

    [xam] x axis mode                 1 [standard]

    [xvm] x velocity maximum       1143.000 mm/min

    [xfr] x feedrate maximum       1000.000 mm/min

    [xtm] x travel maximum          400.000 mm

    [xjm] x jerk maximum       20000000 mm/min^3

    [xjh] x jerk homing   1000000000000 mm/min^3

    [xjd] x junction deviation        0.0500 mm (larger is faster)

    [xsn] x switch min                1 [0=off,1=homing,2=limit,3=limit+homing]

    [xsx] x switch max                0 [0=off,1=homing,2=limit,3=limit+homing]

    [xsv] x search velocity         200.000 mm/min

    [xlv] x latch velocity          100.000 mm/min

    [xlb] x latch backoff             4.000 mm

    [xzb] x zero backoff              2.000 mm

     

    [yam] y axis mode                 1 [standard]

    [yvm] y velocity maximum       1143.000 mm/min

    [yfr] y feedrate maximum       1000.000 mm/min

    [ytm] y travel maximum          400.000 mm

    [yjm] y jerk maximum       20000000 mm/min^3

    [yjh] y jerk homing   1000000000000 mm/min^3

    [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         200.000 mm/min

    [ylv] y latch velocity          100.000 mm/min

    [ylb] y latch backoff             4.000 mm

    [yzb] y zero backoff              2.000 mm

     

    [zam] z axis mode                 1 [standard]

    [zvm] z velocity maximum        200.000 mm/min

    [zfr] z feedrate maximum        100.000 mm/min

    [ztm] z travel maximum           75.000 mm

    [zjm] z jerk maximum       20000000 mm/min^3

    [zjh] z jerk homing   1000000000000 mm/min^3

    [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         120.000 mm/min

    [zlv] z latch velocity          100.000 mm/min

    [zlb] z latch backoff             2.000 mm

    [zzb] z zero backoff              2.000 mm

     

    And yes, the master switch setting should be correct…

    #4031
    sfeine
    Member

    Also, the jerk speed is probably not the issue, (it is set very high), as it was doing the same thing before I changed that.

    #4032
    Riley
    Keymaster

    X = min

    Y = max

    Z = max

     

    In your settings you have this configured for your limit switches.  Is your actual switches wired into this same configuration?

    #4035
    sfeine
    Member

    Interesting, I think that the z might be wrong, I will have to check that.

    I hope that the problem is as simple as that…

    #4036
    sfeine
    Member

    Z was wrong, however I fixed it and the same problems persist.

    #4037
    sfeine
    Member

    Interesting, I lowered the homing jerk setting and now when sent a g28.2 the specified axis moves, but will not recognize switch input.

    Still not sure about switch input, but the not moving thing must have been because the jerk value was overloaded or something of that nature.

    More interestingly, if a limit switch is held down while the homing command is given, that axis will move a little away from the direction of the switch before switching directions back towards the switch. After this point switch input still does not stop moving axis.

    If the switch type is changed to NO switches (they are NC switches on the machine), it exhibits similar behavior to the above mentioned case were the switch is held down at the start of homing.

     

    #4038
    Riley
    Keymaster

    Sfeine,

    I am 99.99% sure this is an configuration issue / connection issue.  This is what I want you to do.  set ALL switches to disabled but ONE!

    Set these values to DISABLE everything else.

    $ysn=0
    $ysx=0

    $zsn=0
    $zsx=0

    $asn=0
    $asx=0

    B and C on TinyG (v1 through v7) do not support switches.

    Also 2x verify your $st (switch type) is set correctly.

    Lets use the X as our first test case.  This will help us troubleshoot which axis is causing the issue.  You might not be aware but ANY SWITCH that is triggered during a homing operation will fire as if it were the axis being homed.   Meaning if even ONE switch is not wired right or configured right your WHOLE weekend could be ruined 🙂

    Set these values for X.  This will be our test axis.
    $xsn=0
    $xsx=1
    To be clear this means that we have our switched wired across the XMAX jumpers.  ALL other switch jumpers are disconnected.  EVEN the xmin jumper.

    Ok, whew!  Now we need to attempt to home X.
    Issue a:
    g28.2 x0

    You X axis should move towards your switch.  Note that if it does not you can either change the polarity of your motor in software or reverse the wiring pair on the board motor terminals.

    If this works as expected.  Do this whole thing again but enable Y vs X.   In a perfect world you could use that very same switch for all axis’s since you KNOW that it worked right on the X axis.  This would verify that if all homing operations work with this switch being moved to each jumper pair, the switch is good.  Therefore perhaps another switch is not.  I know this is a bit wordy.  If this does not make sense let me know.  Its basically saying we are testing all homing operations with a “known good switch”.  Try this out and let me know how this works.  If it does not work.  I need details.  We will get this working I assure you bud.

     

    Riley

     

     

     

     

    #4039
    alden
    Member

    One question: If the X limit switch is on the left side of the machine shouldn’t you be using xmin, not xmax? X is left to right, positive travel to the right.

    #4041
    shaileshal
    Member

    I am facing some what similar issue and am unable to understand what really is wrong.

    I have disabled all limit switches of all axis, except Xmin limit switch is enabled and set for ONLY acting as HOMING limit switch.

    **************************************************************

    01/01/2009 02:13:56.638 [TX] – $x<CR><LF>

    01/01/2009 02:13:58.220 [RX] – [xam] x axis mode                 1 [standard]<LF>

    [xvm] x velocity maximum        600.000 mm/min<LF>

    [xfr] x feedrate maximum        600.000 mm/min<LF>

    [xtm] x travel maximum          150.000 mm<LF>

    [xjm] x jerk maximum       20000000 mm/min^3<LF>

    [xjh] x jerk homing        20000000 mm/min^3<LF>

    [xjd] x junction deviation        0.0500 mm (larger is faster)<LF>

    [xsn] x switch min                1 [0=off,1=homing,2=limit,3=limit+homing]<LF>

    [xsx] x switch max                0 [0=off,1=homing,2=limit,3=limit+homing]<LF>

    [xsv] x search velocity         500.000 mm/min<LF>

    [xlv] x latch velocity          100.000 mm/min<LF>

    [xlb] x latch backoff            10.000 mm<LF>

    [xzb] x zero backoff              2.000 mm<LF>

    tinyg [mm] ok> <LF>

    tinyg [mm] ok> <LF>

    **************************************************************

    I have the limit switch connected as NC and set the $st = 1.

    Now we move the slide to some position as below:

    **************************************************************

    01/01/2009 02:14:25.013 [TX] – g1x-20f300<CR><LF>

     

    01/01/2009 02:14:35.048 [RX] – tinyg [mm] ok> <LF>

    line:0,posx:-0.000,posy:0.000,posz:0.000,posa:0.000,feed:0.000,vel:0.272,unit:1,coor:1,dist:0,frmo:0,momo:1,stat:5<LF>

    tinyg [mm] ok> <LF>

    posx:-0.016,vel:27.162<LF>

    posx:-0.124,vel:108.646<LF>

    posx:-0.404,vel:221.503<LF>

    posx:-0.833,vel:286.691<LF>

    posx:-1.324,vel:300.000<LF>

    posx:-1.823<LF>

    posx:-2.298<LF>

    posx:-2.797<LF>

    posx:-3.296<LF>

    posx:-3.796<LF>

    posx:-4.270<LF>

    posx:-4.769<LF>

    posx:-5.269<LF>

    posx:-5.768<LF>

    posx:-6.242<LF>

    posx:-6.742<LF>

    posx:-7.241<LF>

    posx:-7.740<LF>

    posx:-8.215<LF>

    posx:-8.714<LF>

    posx:-9.213<LF>

    posx:-9.713<LF>

    posx:-10.187<LF>

    posx:-10.686<LF>

    posx:-11.186<LF>

    posx:-11.685<LF>

    posx:-12.159<LF>

    posx:-12.659<LF>

    posx:-13.158<LF>

    posx:-13.657<LF>

    posx:-14.132<LF>

    posx:-14.631<LF>

    posx:-15.130<LF>

    posx:-15.605<LF>

    posx:-16.104<LF>

    posx:-16.603<LF>

    posx:-17.103<LF>

    posx:-17.577<LF>

    posx:-18.077<LF>

    posx:-18.576<LF>

    posx:-19.071,vel:294.500<LF>

    posx:-19.520,vel:242.893<LF>

    posx:-19.836,vel:137.506<LF>

    posx:-19.969,vel:45.903<LF>

    posx:-20.000,vel:2.445<LF>

    posx:-20.000,vel:0.000,stat:3<LF>

    **************************************************************

    After this we set this position as home position using following command:

    **************************************************************

    01/01/2009 02:14:41.669 [TX] – g28.1<CR><LF>

     

    01/01/2009 02:14:45.014 [RX] – tinyg [mm] ok> <LF>

    tinyg [mm] ok> <LF>

    **************************************************************

    Now in order to test the HOMING cycle, we move to some other position as follows:

    **************************************************************

    01/01/2009 02:14:48.872 [TX] – g1x50<CR><LF>

     

    01/01/2009 02:14:53.401 [RX] – tinyg [mm] ok> <LF>

    posx:-20.000,vel:0.272,stat:5<LF>

    tinyg [mm] ok> <LF>

    posx:-19.981,vel:29.946<LF>

    posx:-19.867,vel:114.147<LF>

    posx:-19.578,vel:226.052<LF>

    posx:-19.143,vel:288.524<LF>

    posx:-18.651,vel:300.000<LF>

    posx:-18.151<LF>

    posx:-17.676<LF>

    posx:-17.176<LF>

    posx:-16.676<LF>

    posx:-16.177<LF>

    posx:-15.702<LF>

    posx:-15.202<LF>

    posx:-14.702<LF>

    posx:-14.202<LF>

    posx:-13.727<LF>

    posx:-13.228<LF>

    posx:-12.728<LF>

    posx:-12.228<LF>

    posx:-11.753<LF>

    posx:-11.253<LF>

    posx:-10.754<LF>

    posx:-10.254<LF>

    posx:-9.779<LF>

    posx:-9.279<LF>

    posx:-8.779<LF>

    posx:-8.279<LF>

    posx:-7.805<LF>

    posx:-7.305<LF>

    posx:-6.805<LF>

    posx:-6.305<LF>

    posx:-5.830<LF>

    posx:-5.330<LF>

    posx:-4.831<LF>

    posx:-4.356<LF>

    posx:-3.856<LF>

    posx:-3.356<LF>

    posx:-2.856<LF>

    posx:-2.382<LF>

    posx:-1.882<LF>

    posx:-1.382<LF>

    posx:-0.882<LF>

    posx:-0.407<LF>

    posx:0.093<LF>

    posx:0.592<LF>

    posx:1.092<LF>

    posx:1.567<LF>

    posx:2.067<LF>

    posx:2.567<LF>

    posx:3.067<LF>

    posx:3.541<LF>

    posx:4.041<LF>

    posx:4.541<LF>

    posx:5.041<LF>

    posx:5.516<LF>

    posx:6.016<LF>

    posx:6.515<LF>

    posx:7.015<LF>

    posx:7.490<LF>

    posx:7.990<LF>

    posx:8.490<LF>

    posx:8.964<LF>

    posx:9.464<LF>

    posx:9.964<LF>

    posx:10.464<LF>

    posx:10.939<LF>

    posx:11.439<LF>

    posx:11.938<LF>

    posx:12.438<LF>

    posx:12.913<LF>

    posx:13.413<LF>

    posx:13.913<LF>

    posx:14.413<LF>

    posx:14.887<LF>

    posx:15.387<LF>

    posx:15.887<LF>

    posx:16.387<LF>

    posx:16.862<LF>

    posx:17.362<LF>

    posx:17.861<LF>

    posx:18.361<LF>

    posx:18.836<LF>

    posx:19.336<LF>

    posx:19.836<LF>

    posx:20.336<LF>

    posx:20.810<LF>

    posx:21.310<LF>

    posx:21.810<LF>

    posx:22.285<LF>

    posx:22.785<LF>

    posx:23.285<LF>

    posx:23.784<LF>

    posx:24.259<LF>

    posx:24.759<LF>

    posx:25.259<LF>

    posx:25.759<LF>

    posx:26.234<LF>

    posx:26.734<LF>

    posx:27.233<LF>

    posx:27.733<LF>

    posx:28.208<LF>

    posx:28.708<LF>

    posx:29.208<LF>

    posx:29.708<LF>

    posx:30.182<LF>

    posx:30.682<LF>

    posx:31.182<LF>

    posx:31.682<LF>

    posx:32.157<LF>

    posx:32.657<LF>

    posx:33.156<LF>

    posx:33.656<LF>

    posx:34.131<LF>

    posx:34.631<LF>

    posx:35.131<LF>

    posx:35.605<LF>

    posx:36.105<LF>

    posx:36.605<LF>

    posx:37.105<LF>

    posx:37.580<LF>

    posx:38.079<LF>

    posx:38.579<LF>

    posx:39.079<LF>

    posx:39.554<LF>

    posx:40.054<LF>

    posx:40.553<LF>

    posx:41.053<LF>

    posx:41.528<LF>

    posx:42.028<LF>

    posx:42.528<LF>

    posx:43.027<LF>

    posx:43.502<LF>

    posx:44.002<LF>

    posx:44.502<LF>

    posx:45.002<LF>

    posx:45.476<LF>

    posx:45.976<LF>

    posx:46.476<LF>

    posx:46.976<LF>

    posx:47.451<LF>

    posx:47.950<LF>

    posx:48.450<LF>

    posx:48.949,vel:298.914<LF>

    posx:49.395,vel:264.079<LF>

    posx:49.760,vel:174.445<LF>

    posx:49.947,vel:65.256<LF>

    posx:49.998,vel:8.216<LF>

    posx:50.000,vel:0.000,stat:3<LF>

    **************************************************************

    Now we enter the HOMING command :

    **************************************************************

    01/01/2009 02:15:13.450 [TX] – g28<CR><LF>

    **************************************************************

    Then the motor starts moving, after some movement we press the Xmin limit switch and release the same.

    We don’t see that this Homing Limit switch press is not detected, nor the movement is stopped and re-started in opposite direction.

    Below is the output after HOMING command.

    **************************************************************

    01/01/2009 02:15:16.721 [RX] – tinyg [mm] ok> <LF>

    posx:50.000,vel:0.275,momo:0,stat:5<LF>

    tinyg [mm] ok> <LF>

    posx:49.984,vel:27.548<LF>

    posx:49.873,vel:110.193<LF>

    posx:49.578,vel:247.934<LF>

    posx:49.018,vel:413.774<LF>

    posx:48.267,vel:529.477<LF>

    posx:47.332,vel:588.361<LF>

    posx:46.339,vel:600.000<LF>

    posx:45.339<LF>

    posx:44.340<LF>

    posx:43.390<LF>

    posx:42.390<LF>

    posx:41.390<LF>

    posx:40.391<LF>

    posx:39.441<LF>

    posx:38.441<LF>

    posx:37.442<LF>

    posx:36.492<LF>

    posx:35.492<LF>

    posx:34.493<LF>

    posx:33.493<LF>

    posx:32.543<LF>

    posx:31.544<LF>

    posx:30.544<LF>

    posx:29.544<LF>

    posx:28.595<LF>

    posx:27.595<LF>

    posx:26.595<LF>

    posx:25.596<LF>

    posx:24.646<LF>

    posx:23.646<LF>

    posx:22.647<LF>

    posx:21.647<LF>

    posx:20.698<LF>

    posx:19.698<LF>

    posx:18.698<LF>

    posx:17.699<LF>

    posx:16.749<LF>

    posx:15.749<LF>

    posx:14.750<LF>

    posx:13.750<LF>

    posx:12.800<LF>

    posx:11.801<LF>

    posx:10.801<LF>

    posx:9.851<LF>

    posx:8.852<LF>

    posx:7.852<LF>

    posx:6.853<LF>

    posx:5.903<LF>

    posx:4.903<LF>

    posx:3.904<LF>

    posx:2.904<LF>

    posx:1.954<LF>

    posx:0.955<LF>

    posx:-0.045<LF>

    posx:-1.045<LF>

    posx:-1.994<LF>

    posx:-2.994<LF>

    posx:-3.994<LF>

    posx:-4.993<LF>

    posx:-5.943<LF>

    posx:-6.943<LF>

    posx:-7.942<LF>

    posx:-8.942<LF>

    posx:-9.891<LF>

    posx:-10.891<LF>

    posx:-11.891<LF>

    posx:-12.890<LF>

    posx:-13.840<LF>

    posx:-14.840<LF>

    posx:-15.839<LF>

    posx:-16.789,vel:599.725<LF>

    posx:-17.766,vel:569.628<LF>

    posx:-18.644,vel:484.229<LF>

    posx:-19.333,vel:343.733<LF>

    posx:-19.755,vel:179.132<LF>

    posx:-19.946,vel:66.185<LF>

    posx:-19.998,vel:9.917<LF>

    posx:-20.000,vel:0.000,stat:3<LF>

    **************************************************************

    We have ensured that the motor polarity is correct to the direction the motor is moving.

    What can be the reason for this kind of behaviour ????

    I have gone through the Homing troubleshooting wiki but nothing is helping.

    Kindly provide whether this is a problem or what????

    #4043
    alden
    Member

    I think you are not using homing correctly. See this page:
    https://github.com/synthetos/TinyG/wiki/TinyG-Homing

    The G28 and G28.1 commands are movement commands. Finding the home position is G28.2

    G28.1 will “remember” an absolute position. G28 will return to that position (same for G30.1 and G30)

    In order to actually home the machine in X only, send G28.2 x0

    Please try that and see if you get the correct results.

    Alden

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