585,977 active members*
4,113 visitors online*
Register for free
Login
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2013
    Posts
    62

    Homing using limit and encoder index pulse?

    Hi,

    Does anyone have any sample code showing how to use the limit switchs and encoder index pulse to generate an accurate home position?

    Currently I have my limit switches set to kill drive I assume I need to change them to Dissalow drive into limit so I can run them to the limit then back off slowly until I see the encoder index pulse?

    Cheers

    Chris

  2. #2
    Join Date
    May 2006
    Posts
    4045
    Hi Chris,

    To home to an index is pretty basic. It just involves an extra step after detecting the Limit to continue (or reverse) and wait for the index input.

    I've attached a parameterized function that should do this. Add the function to your home.c program and call it specifying all the listed parameters.

    HTH
    Regards
    TK
    http://dynomotion.com

  3. #3
    Join Date
    May 2013
    Posts
    62
    Hi Tom,

    So
    axis = 0 for x, 1 for y, 2 for z etc (if channel 0 is x axis etc)
    speed = is in encoder counts per second? (encoder for position feedback)
    dir = +1 or -1?
    bit = 136 for first opto in? (do I remove the ! if my limits are active low?)
    indexspeed = is in encoder counts per second? (encoder for position feedback)
    indexbit = how do i reference this when it is connected to JP2 CHA_DIFFPLUS_4 etc?
    Polarity = I dont see this used?
    offset = is in encoder counts?

    Cheers

    Chris

  4. #4
    Join Date
    May 2006
    Posts
    4045
    Hi Chris,

    axis = 0 for x, 1 for y, 2 for z etc (if channel 0 is x axis etc)
    yes

    speed = is in encoder counts per second? (encoder for position feedback)
    yes

    dir = +1 or -1?
    yes

    bit = 136 for first opto in? (do I remove the ! if my limits are active low?)
    yes, depends how it is wired

    with the ! it reads "wait while bit is not true"
    without the ! it reads "wait while bit is true"

    try both ways

    indexspeed = is in encoder counts per second? (encoder for position feedback)
    yes

    indexbit = how do i reference this when it is connected to JP2 CHA_DIFFPLUS_4 etc?
    IO bit 36...43

    Polarity = I don't see this used?
    oops, see new attachment

    offset = is in encoder counts?
    yes

    HTH
    Regards
    TK
    http://dynomotion.com

Similar Threads

  1. homing to index pulse
    By spoiledbrat in forum SmoothStepper Motion Control
    Replies: 0
    Last Post: 09-16-2012, 10:21 PM
  2. using encoder index for homing and a axes position
    By rokag3 in forum CNC Machine Related Electronics
    Replies: 22
    Last Post: 10-16-2009, 12:57 PM
  3. Spindle RPM control - Do I need an index pulse?
    By Lexx0001 in forum LinuxCNC (formerly EMC2)
    Replies: 8
    Last Post: 03-27-2009, 07:42 AM
  4. How to use index pulse for homing purpose
    By Zig in forum LinuxCNC (formerly EMC2)
    Replies: 2
    Last Post: 03-28-2008, 08:16 AM
  5. spindle index, encoder, home/limit switch
    By Wm McNett in forum CNC Machine Related Electronics
    Replies: 10
    Last Post: 01-13-2006, 01:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •