Go to Post Congrats! You are an inspiration to us all! - preussrobotics [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 4.00 average. Display Modes
  #1   Spotlight this post!  
Unread 11-02-2015, 18:05
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Programming a limit switch for two buttons

We have two buttons that allow the arms of our robot to move up and down a shaft. One moves up, and one moves down. How to we implement a limit switch so that the arms do not move too far down or too far up?

I've seen the examples from team 358, but they haven't been of much help. I really don't know what to put into the begin vi or the telop(if that's even where it goes).

How does the limit switch know when to stop? How to I put in a limit switch for code that already deviates between -1 and 1? Do I have to use an encoder to determine the rpm?

Thank you for any help you can give us
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2015, 22:04
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,731
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Programming a limit switch for two buttons

Tell us more about your setup, e.g.,
  • What kind of limit switches are you using?
  • Are they mounted to be pressed when the arm is in the up and in the down positions?
  • How are they wired-Normally Open or Normally Closed?
  • What kind of motor controller are you using, e.g., Talon using PWM?
  • How are you controlling the arm motor, e.g., joystick, button?
  • How are the controls expected to work, e.g., push forward on the joystick the arm goes down, pull back and the arm goes up?
  • What have you tried that didn't work? What were the symptoms of the failure?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2015, 09:20
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 573
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: Programming a limit switch for two buttons

And...which programming language are you using?
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2015, 09:25
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,731
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Programming a limit switch for two buttons

Quote:
Originally Posted by MrRoboSteve View Post
And...which programming language are you using?
This is the LabVIEW sub-forum...
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #5   Spotlight this post!  
Unread 12-02-2015, 09:27
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 573
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: Programming a limit switch for two buttons

I need to put a postit on my monitor to check that.
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
Reply With Quote
  #6   Spotlight this post!  
Unread 12-02-2015, 09:42
TylerStaudigel's Avatar
TylerStaudigel TylerStaudigel is offline
Registered User
FRC #0144 (R.O.C.K)
Team Role: Programmer
 
Join Date: Dec 2013
Rookie Year: 2014
Location: United States
Posts: 39
TylerStaudigel is an unknown quantity at this point
Re: Programming a limit switch for two buttons

Check the find examples page under help in labview. It will give you the code for seeing if a limit switch is true or false. After you are able to read the switch think about using a select statement and a case structure to achieve you desired outcome.
Reply With Quote
  #7   Spotlight this post!  
Unread 12-02-2015, 09:46
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Programming a limit switch for two buttons

Quote:
Originally Posted by TBots View Post
I've seen the examples from team 358, but they haven't been of much help. I really don't know what to put into the begin vi or the telop(if that's even where it goes).
Begin.vi gets the Open connected to a RefNum Set (with an incoming arrow) in order to define the hardware pins and give them a name to use later.

Teleop.vi gets pretty much everything else, starting with a RefNum Get (with an outgoing arrow) connected to either a Get or a Set, depending on whether you're reading a sensor or controlling an actuator.
Reply With Quote
  #8   Spotlight this post!  
Unread 12-02-2015, 10:38
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,570
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Programming a limit switch for two buttons

Quote:
Originally Posted by TBots View Post
How does the limit switch know when to stop?
This question in particular clues me in that you need help with the mechanical situation as well as programming.

A limit switch is simply a switch that is engaged as a moving part reaches (or approaches) the design limit of its range of motion. There are a wide variety of designs; click the link to see a nice sample.

Programming and wiring to take advantage of a limit switch is rather simple - you just have to make sure that when the limit switch is engaged, any attempts to move the actuator in that direction are nullified. You still want to allow motion away from that limit, otherwise the actuator will be unusable.

The real key to making a limit switch work well is in selection, placement, and mounting, so that it consistently and reliably knows when to stop.

As you will probably notice, many of the limit switch designs feature a rather long arm which is in contact with the switch button somewhere near its fulcrum. This is because you don't want the switch receive the force of the moving actuator, just report it. Often, the switch body is mounted beside the actuators path, not in the path. Alternately, the limit switch can be mounted inside/behind the mechanical stop so that only the plunger or arm reach into the path of the load.

Selecting a style and mount for a limit switch is best approached creatively. I'll spend the rest of this post in a litany of examples; perhaps one of them will inspire you. There are also two examples shown in the attached images.

Our robot this year has twelve limit switches, in three distinct styles:
  1. We have two switches to detect as we're beginning to drive onto the scoring platform. These are actually optical interrupts mounted inside the front plate. We mounted some 3/16" steel pins on springs and passed them through holes in the KOP chassis intended for #10 machine screws. When we hit the ramp, the pins are pushed up between the sensor arms and interrupt the light path.
  2. Our lift has four switches. One is at each end, and another is about five inches inside of these. These are roller switches (similar to the ones pictured with the cams below), and are mounted so that the lift plate pushes the rollers to the side as it reaches the locations. The "warning" switches will enforce a reduced speed towards the nearby limits.
  3. We have six plunger style switches (similar to many refrigerator light switches) mounted on the front of our lift plate which activate when we make contact with a tote or RC. We have so many because of the corrugated pattern on the side of the totes; they are wired in pairs so that they only use three DIO ports.

Around the house and car:
  • The switch that turns the refrigerator light on and off when you open and close the door.
  • the switch in the car door that does the same thing with the dome light. Some cars also have these in the tailgate/trunk, hood, glove box, or fuel door, either for task lighting or to trigger a warning light on the dashboard.
  • the switches in the doors of the washer and dryer and microwave oven which shut off hazardous processes when the doors are open. Copiers, printers, food processors, and a variety of appliances have these sort of switches.
  • inside the toilet tank. In most cases there's no electricity; it's a water valve that's being switched when the water reaches a limit
  • if you have an older-style thermostat on your heater/AC, it's really a mercury limit switch. There's a bimetallic strip that coils and uncoils as it heats and cools, which changes the angle of the mercury switch. When the angle reaches a certain limit, the mercury rolls to the other side of the switch, opening or closing a circuit
Attached Thumbnails
Click image for larger version

Name:	mechanical-limit-switch.gif
Views:	8
Size:	18.4 KB
ID:	18298  Click image for larger version

Name:	cr201.jpg
Views:	7
Size:	26.2 KB
ID:	18299  
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #9   Spotlight this post!  
Unread 12-02-2015, 16:23
TBots TBots is offline
Registered User
FRC #3350
 
Join Date: Sep 2014
Location: Texarkana
Posts: 39
TBots is an unknown quantity at this point
Re: Programming a limit switch for two buttons

This is what our limit switch looks like: https://encrypted-tbn3.gstatic.com/i...r0xYWMp2FzsgSw

We have one at the top of our robot that becomes closed when the arms hit it. We may or may not add one to the bottom of the robot for the same effect. We are using talon via PWM. The arms are controlled to go up and down with two separate buttons on a PS3 controller. We are using labview.

We haven't tested anything with the limit switch since we've not been able to complete the programming. The main problem is that we can't figure out how to combine the examples titled switch and limit switch. One appears to show both the begin and teleop stages, but the other only show teleop. We can't figure out how to allow our motor to stop when the switch is true.
Reply With Quote
  #10   Spotlight this post!  
Unread 12-02-2015, 16:54
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Programming a limit switch for two buttons

Quote:
Originally Posted by TBots View Post
The main problem is that we can't figure out how to combine the examples titled switch and limit switch. One appears to show both the begin and teleop stages, but the other only show teleop. We can't figure out how to allow our motor to stop when the switch is true.
The Begin.vi part is common to every example that uses switch inputs. Replace the Teleop.vi part with the code in the example, suitably modified for your purposes.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:57.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi