586,060 active members*
4,221 visitors online*
Register for free
Login
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2015
    Posts
    10

    Limit Switches/Estop

    Hey Tom,

    I am wondering how to wireup and set limit switches in Kmotion. I have just a typical Normally NO or NC limit switches. Would I wire these to any IO pin? for instance If I wanted to wire these for my first axis to say... IO 29/30. would I hook one wire up to 3.3V on Kflop and have the switch signal this? For instance If I wire it as NC(normally Closed) would I select the box under Configuration>Limit Switch option to "stop when low" because when the switch is engaged it should be Low? And If I wire it NO I would leave this box unchecked? Also underneath that check box it says "Bit No." is this referring to the IO on the kflop? in this case 29/30? Or in C LimitSwitchNegBit=29; <-- is this the IO on the Kflop?

    I am also a little confused on how to setup the Estop. Is this done by using the watchdog.c file in the directory? If so do I need to include the bit number into "xxx" for the Estop in this if/else statement?

    if (ch0->Enable && ch1->Enable && ch2->Enable)
    {
    SetBit(xxx); // yes they are, enable the amplifier
    }
    else
    {
    ClearBit(xxx); // no at least one is disabled, disable the amplifier
    }

  2. #2
    Join Date
    May 2006
    Posts
    4045

    Re: Limit Switches/Estop

    Hi Elocremarc,

    I am wondering how to wireup and set limit switches in Kmotion. I have just a typical Normally NO or NC limit switches. Would I wire these to any IO pin? for instance If I wanted to wire these for my first axis to say... IO 29/30. would I hook one wire up to 3.3V on Kflop and have the switch signal this? For instance If I wire it as NC(normally Closed) would I select the box under Configuration>Limit Switch option to "stop when low" because when the switch is engaged it should be Low? And If I wire it NO I would leave this box unchecked?
    For noise immunity most systems run limits at 24V and optically isolate them from the digital electronics. Most all of our option boards (ie our Konnect) provide some opto isolated inputs as well as many 3rd party boards and modules. But if you wish to connect directly to KFLOP's 3.3V LVTTL inputs you will need to have a circuit that drives high (>2.8V) and low (<0.4V). In general a simple switch will only drive one way. KFLOP JP4 and JP6 both have 8 150 ohm pull down resistors on the first 8 inputs. Including the IO 29 and 30 you mention. In this case putting a switch to 3.3V (as you describe) will force the pin high and when the switch is open the pin will be forced low by the internal resistor.

    Its common to use NC switches so that a break in any wiring will act as a tripped limit switch. So in that case a tripped limit will then drive the KFLOP pin low, so select the Limit Option "Stop when low".

    If your environment is noisy and the wiring picks up noise the result may be false limit switch trips. You can see this as Console messages indicating something like: "Neg Limit Stop Axis:0" when the axis isn't actually in the limit. In this case adding a 0.1uF ceramic capacitor between the input and KFLOP DC GND as close as possible to KFLOP will usually filter out the noise.


    Also underneath that check box it says "Bit No." is this referring to the IO on the kflop? in this case 29/30? Or in C LimitSwitchNegBit=29; <-- is this the IO on the Kflop?
    Yes


    I am also a little confused on how to setup the Estop. Is this done by using the watchdog.c file in the directory? If so do I need to include the bit number into "xxx" for the Estop in this if/else statement?

    if (ch0->Enable && ch1->Enable && ch2->Enable)
    {
    SetBit(xxx); // yes they are, enable the amplifier
    }
    else
    {
    ClearBit(xxx); // no at least one is disabled, disable the amplifier
    }
    I'm not sure what aspect of EStop you are referring to? Normally an EStop is an external signal that kills power and so forth. The EStop signal is also wired as an input to the Controller to inform it that EStop has occurred so that the Controller can disable its axes and stop Interpreting GCode etc... In that case your example is backwards. That example is showing a means of sending a signal out whenever the Axes are disabled for any reason. This is often used to disable external amplifiers whenever KFLOP is not controlling them.

    Here is an example to monitor an EStop input and to disable axes when it is asserted.

    Code:
    #include "KMotionDef.h"
    
    main()
    {
        for (;;)  //loop forever
        {
            WaitNextTimeSlice();
    
            // if ESTOP present disable any enabled Axis ??
    #define ESTOP_BIT 180
            if (ReadBit(ESTOP_BIT))
            {
                if (ch0->Enable) DisableAxis(0);  // axis still enabled?  - Disable it
                if (ch1->Enable) DisableAxis(1);  // axis still enabled?  - Disable it
                if (ch2->Enable) DisableAxis(2);  // axis still enabled?  - Disable it
            }
        }
    }
    HTH
    Regards
    TK
    http://dynomotion.com

Similar Threads

  1. Replies: 3
    Last Post: 11-05-2013, 02:54 AM
  2. E-Stop,Limit Switches - Car door open switches ?
    By TrickyCNC in forum DIY CNC Router Table Machines
    Replies: 14
    Last Post: 04-19-2012, 09:55 PM
  3. The relationship of limit switches to home switches.
    By MikeAber in forum CNC Machine Related Electronics
    Replies: 4
    Last Post: 11-04-2004, 08:28 PM
  4. Limit switches and home switches
    By viktorcnc in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 2
    Last Post: 08-03-2004, 12:11 PM
  5. Home switches and limit switches.
    By ynneb in forum CNC Machine Related Electronics
    Replies: 5
    Last Post: 04-08-2004, 11:32 PM

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
  •