New screen - Page 2


Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24

Thread: New screen

  1. #21
    Member
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    355
    Downloads
    0
    Uploads
    0

    Default Re: New screen

    Quote Originally Posted by bhurts View Post
    The question is do you have or know of how I can turn off and on soft limits in c code and attach it to a toggle button so I can turn them off without changing my initiate file. I tried to turn them off in my homing routine and it worked. At the end of the routine I tried to turn them back on and it didn't work. For me I think a button would be better to toggle them on and off and just leave them out of the homing program.
    Any advice would be great.
    I'm not sure why you'd want to disable/enable softlimits regularly, but it is possible.
    You would need to alter your init.c to contain code to continually monitor the switch and alter the soft limits depending on the state of the switch.

    Something like this within an infinite loop-
    Code:
    if(ReadBit(xx)){  // if switch input high, set softlimits
       ch1->SoftLimitPos=7000;
       ch1->SoftLimitNeg=-278000;
    } else {      // else clear softlimits (set them really high)
       ch1->SoftLimitPos=1e+09;
       ch1->SoftLimitNeg=-1e+09;
    }
    You might want to extend it to add some debounce.



  2. #22
    Member
    Join Date
    Jun 2013
    Location
    USA
    Posts
    1041
    Downloads
    0
    Uploads
    0

    Default Re: New screen

    I really appreciate the help and I will play with the code you gave me. I really don't want to use it regularly but it would be very helpful when I do. If the machine losses connection or I shut down the control when it's not at home soft limits prevent making it to the switch after rebooting. I would just use the button to turn them off so I can jog the axis close enough to the switch to home. Then I would enable them again.

    Thanks
    Ben

    Sent from my HTC6525LVW using Tapatalk



  3. #23
    Member
    Join Date
    Jun 2013
    Location
    USA
    Posts
    1041
    Downloads
    0
    Uploads
    0

    Default Re: New screen

    Also I would only need to disable limits in the direction of home.

    Ben

    Sent from my HTC6525LVW using Tapatalk



  4. #24
    Member
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    355
    Downloads
    0
    Uploads
    0

    Default Re: New screen

    Personally, I would not set soft limits in the init.c.
    I'd leave them at the default 1e+09, and then only set them as part of the homing routine once the machine has homed.



Page 2 of 2 FirstFirst 12

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

New screen

New screen