LimitSwitch and the KFLOP


Results 1 to 6 of 6

Thread: LimitSwitch and the KFLOP

  1. #1
    Registered
    Join Date
    Mar 2007
    Location
    US
    Posts
    217
    Downloads
    0
    Uploads
    0

    Default LimitSwitch and the KFLOP

    The LimitSwitch set-up of the KFlop is made more difficult than it needs to be by the descriptions of the various bits. If you can imagine a 32 bit number as nothing more than 32 switches in a "Panel Box", and you label each switch with something distinct like "Kitchen Light", "Back Porch Light", "Oven", then when the Kitchen Light goes out and someone says, "Check the Breaker Box", you don't try all 32 breakers, you just check the one labeled "Kitchen Light". If someone labeled the breaker box with descriptions like: "Large Room North", "North Room", "Small North", "Room North"; you might try to figure out which room the kitchen was, or you might just start flipping breakers. The lower 5 bits that define what is going on all are described as "Stop", "Motor", "Kill" and the user is left just "flipping breakers".

    I think i have it sorted out, so here it goes:

    From the "help", the explanation for "LimitSwitch" is as follows:


    32-bit hexadecimal value:

    Bit 0 1=Stop Motor on Neg Limit, 0=Ignore Neg limit

    Bit 1 1=Stop Motor on Pos Limit, 0=Ignore Pos limit

    Bit 2 Neg Limit Polarity 0=stop on high, 1=stop on low

    Bit 3 Pos Limit Polarity 0=stop on high, 1=stop on low

    Bits 4-7 Action - 0 Kill Motor Drive

    1 Disallow drive in direction of limit

    2 Stop movement

    Bits 16-23 Neg Limit Bit number

    Bits 24-31 Pos Limit Bit number

    Example

    LimitSwitch2 0C0D0003
    Breaking this down we have:

    Code:
                 XX xx xX XX 
                 || || || ||
                 || || || |  -----------> XXXX
                 || || || |               ||||
                 || || || |               ||| ----> 1 = Stop Motor On Neg Limit  0 = Ignore Neg Limit
                 || || || |               || -----> 1 = Stop Motor on Pos Limit, 0 = Ignore Pos Limit
                 || || || |               | ------> Neg Limit 0 = Stop on High  1 = Stop on Low 
                 || || || |                -------> Pos Limit 0 = Stop on High  1 = Stop on Low
                 || || || |
                 || || ||  ------------->xx00 ----> Kill Motor Drive
                 || || ||                xx01 ----> Disallow Drive in direction of limit 
                 || || ||                xx10 ----> Stop Movement
                 || || ||  
                 || || | --------------->xxxx ----> Not Used
                 || ||  ---------------->xxxx ----> Not Used
                 || ||
                 ||  ------------------->XXXX ----> Negative Limit Bit Number (8 Bit Number Corresponding to I/O Bit Number associated with Neg Limit)
                 || 
                  ---------------------->XXXX ----> Positive Limit Bit Number (8 Bit Number Corresponding to I/O Bit Number associated with Pos Limit)
                  
    Legend: 
    0 = Low              
    1 = High
    X = Low or High
    x = Not Used

    And the Example, broken down:

    Code:
    LimitSwitch2 0C 0D 00 03
                 || || || ||
                 || || || |  -----------> 0011
                 || || || |               ||||
                 || || || |               ||| ----> 1 = Stop Motor On Neg Limit                      
                 || || || |               || -----> 1 = Stop Motor on Pos Limit                      
                 || || || |               | ------> Neg Limit Stop on High  
                 || || || |                -------> Pos Limit Stop on High
                 || || || |
                 || || ||  ------------->0000 ----> Kill Motor Drive
                 || || ||  
                 || || | --------------->0000 ----> Not Used
                 || ||  ---------------->0000 ----> Not Used
                 || ||
                 ||  ------------------->00001101-> Negative Limit Set to Bit# 0x0D (13 dec)                                                              
                 || 
                  ---------------------->00001100-> Positive Limit Set to Bit# 0x0C (12 dec)
    So, in "English", Limit Switch 2 "Kills" the motor drive AND Stops the Motor when either Bit 12 or 13 go "High".

    I am a bit unclear on the difference between "Stop Motor" and "Kill Motor Drive". The permutations I can think of are as follows:

    #1
    Bits 0-1 Enable or Disable the Neg/Pos limit switches
    Bits 2-3 Determine the Limit Condition Polarity
    Bits 4-5 Determine what action occurs if Bit 0/1 is enabled AND a limit action occurs

    #2
    Bits 0-1 Enable or Disable Pulses Sent to the Motor when a Limit Condition Occurs
    Bits 2-3 Determine the Limit Condition Polarity
    Bits 4-5 Redundantly determine what action occurs regardless if Bit 0/1 is enabled AND a limit action defined by bits 2-3 occurs

    #3
    Bits 0-1 Enable or Disable Pulses Sent to the Motor when a Limit Condition Occurs
    Bits 2-3 Redundantly Stops the Motor when the Limit Condition Polarity is met
    Bits 4-5 Redundantly determines what action occurs regardless if Bit 0/1 is enabled AND a limit action based on Bits 2-3 occurs

    While I strongly suspect case #1 is correct, the wording is quite confusing, so I thought I might seek some clarification.

    It is important to remember that ALL Axis can use the same "switch chain", that is, if you have positive and negative limit switches connected in series for all three Axis, each Axis being "set up" for the KFlop would use exactly the same LimitSwitch settings. As an Example:

    All Limit Switches connected together in series:

    LimitSwitch0 = 0C0C0003 // X-Axis, Chan0, I/O Bit 12 (202,113,027 dec)
    LimitSwitch1 = 0C0C0003 // Y-Axis, Chan1, I/O Bit 12 (202,113,027 dec)
    LimitSwitch2 = 0C0C0003 // Z-Axis, Chan2, I/O Bit 12 (202,113,027 dec)

    Each Axis Limit Switches Connected in Series (but NOT with Each Other):

    LimitSwitch0 = 0C0C0003 // X-Axis, Chan0, I/O Bit 12
    LimitSwitch1 = 0D0D0003 // Y-Axis, Chan1, I/O Bit 13
    LimitSwitch2 = 0E0E0003 // Z-Axis, Chan2, I/O Bit 14

    And, Finally, for All Limit Switches Run Separately (None in Series):
    LimitSwitch0 = 0C0D0003 // X-Axis, Chan0, I/O Bit 12 & 13
    LimitSwitch1 = 0E0F0003 // Y-Axis, Chan1, I/O Bit 14 & 15
    LimitSwitch2 = 10110003 // Z-Axis, Chan2, I/O Bit 16 & 17

    Tom, PLEASE correct any mistakes.

    Fish

    Similar Threads:


  2. #2
    Registered judleroy's Avatar
    Join Date
    Dec 2006
    Location
    USA
    Posts
    406
    Downloads
    0
    Uploads
    0

    Default

    You can see a description of all the limit switch options in the help files for the k-motion/k-flop Executive software screens. It's listed in the configuration and flash help file. It explains exactly what happens for each of the three options. They are all correct. You just pick the one that best suits your needs.
    Judleroy



  3. #3
    Registered
    Join Date
    Mar 2007
    Location
    US
    Posts
    217
    Downloads
    0
    Uploads
    0

    Default

    Judleroy,

    Yep, that is much, much clearer than the "Help File" from the Console which is exactly as I quoted it, lol. For Clarity here is the help referenced by Judleroy:

    KMotion has the ability to monitor limit switch inputs for each axis and stop motion when a physical limit switch is detected. The limit switch options allow this feature to be enabled or disabled for each limit (positive or negative), what specific bit to be monitored for each limit, what polarity of the bit indicates contact with the limit, and what action to perform when a limit is detected.

    Select Watch Limit to enable limit switch monitoring.

    Select Stop when low to select negative true logic for the limit (motion will be stopped when a low level is detected).

    Specify a bit no. for which bit is to be monitored for the limit condition. See the Digital IO Screen for current I/O bit status and a recommended bit assignment for limit switches (bits 12 through 19). If in a particular application it isn't critical to determine which Limit Switch (either positive or negative, or even which axis) the number of digital I/O bits consumed by limit switches may be reduced by "wire ORing" (connecting in parallel) multiple switches together. In this case, the same bit number may be specified more than one place.

    The Action drop down specifies what action should be performed when a limit is encountered.

    Kill Motor Drive - will completely disable the axis whenever the limit condition is present. Note that it will not be possible to re-enable the axis (and move out of the limit) while the limit condition is still present and this mode remains to be selected.

    Disallow drive into limit - will disable the axis whenever the limit condition is present and a motion is made into the direction of the limit. This mode will allow the axis to be re-enabled while inside the limit and will allow a move away from the limit.

    Stop Movement - this action will keep the axis enabled, but will freeze the commanded position as soon as the limit is detected, and stop any motion trajectory in progress for the axis.

    Furthermore, in all the above cases and a limit condition is detected, if the axis belongs to the set of axis in the coordinated group, then any coordinated motion trajectory will be halted.
    Putting the two help files together I think I have a good grasp on it :-)

    Thanks!

    Fish



  4. #4
    Registered
    Join Date
    Sep 2015
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default Re: LimitSwitch and the KFLOP

    hello im using kflop with konnect
    so im using virtual bits extended 1024 and 1025
    if i convert them to hex ill get 400 and 401
    how should i write my limitswitch2= 0x...
    thanks



  5. #5
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: LimitSwitch and the KFLOP

    Hi charbely27,

    An extended mode bit has been added to allow the Bit numbers to be specified in separate 32 bit integer parameters. See the description in KMotionDef.h. Or the simplest method is to use the KMotion.exe Configuration Screen and let KMotion.exe generate and export the C Code for you.

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  6. #6
    Registered
    Join Date
    Sep 2015
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default Re: LimitSwitch and the KFLOP

    thank you



Tags for this Thread

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

LimitSwitch and the KFLOP

LimitSwitch and the KFLOP