Go to Post And I will most definitely never forget watching this bald, brown thin wisp of a human being charging up to us across the sidelines after the semifinals ended waving his hands and shouting "New Strategy!!!!!! New Strategy!!!!!!" as he rallied the troops for our Finals push. - Travis Hoffman [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-02-2015, 19:49
Minerbotics4827 Minerbotics4827 is offline
Registered User
FRC #4827
 
Join Date: Feb 2015
Location: Michigan
Posts: 6
Minerbotics4827 is an unknown quantity at this point
Basic Limit Switch

Our team wants to have basically a kill switch so that when our arms reach a certain point, they trip the limit switch and make it so we can't move them any further out. Does anyone have an example or explanation for how to code something like this? Thanks
Edit: We are using Gear Motors, which apparently have sensors built in to add this type of control. Does anyone know how this works?

Last edited by Minerbotics4827 : 10-02-2015 at 20:00.
Reply With Quote
  #2   Spotlight this post!  
Unread 10-02-2015, 20:34
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
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,713
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: Basic Limit Switch

Here is a limit switch example.

The newest AndyMark PG motor/gearboxes have an integrated encoder.
If you start from a known position then it's possible to measure to a certain point. There are pitfalls and drawbacks to using an encoder for this. A limit switch is usually more dependable.
Here is an encoder example

There are also working examples of both of these installed with LabVIEW.
From the Getting Started window look under
Support -> Find FRC Example... -> FRC Robotics -> roboRIO-> Sensors
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 10-02-2015 at 20:37.
Reply With Quote
  #3   Spotlight this post!  
Unread 10-02-2015, 20:48
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: Basic Limit Switch

Take a look at Team 358's Limit Switch example.

The "In Range and Coerce" function will limit the motor output so that it can't drive forward if the "forward limit" switch is active, and it can't drive backward if the "backward limit" switch is active. If you don't have both switches, replace the DIO Get and associated select with a constant 1 or -1 into the In Range and Coerce input.
Reply With Quote
  #4   Spotlight this post!  
Unread 11-02-2015, 18:12
Minerbotics4827 Minerbotics4827 is offline
Registered User
FRC #4827
 
Join Date: Feb 2015
Location: Michigan
Posts: 6
Minerbotics4827 is an unknown quantity at this point
Re: Basic Limit Switch

Ok, thanks everyone. It looks like we are going with the encoder for this, but will need to set up a limit switch for something else anyways. Can someone please explain what the values mean for the encoder example and how to connect it to the motor control in the teleop?

Last edited by Minerbotics4827 : 11-02-2015 at 18:28.
Reply With Quote
  #5   Spotlight this post!  
Unread 11-02-2015, 18:22
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: 570
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: Basic Limit Switch

Note that it's common to pair limit switches and encoders in a scenario like yours -- the limit switches are used to detect when the arm is in a known position, which allows you to better interpret the result of the encoder.
__________________
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 11-02-2015, 19:01
Minerbotics4827 Minerbotics4827 is offline
Registered User
FRC #4827
 
Join Date: Feb 2015
Location: Michigan
Posts: 6
Minerbotics4827 is an unknown quantity at this point
Re: Basic Limit Switch

I've figured out how to setup the normal limit switch, however, I am not sure on how to set it up so you can have a button override what the switch does when pressed. Someone helped us set up something similar last year at competition, but our old code got messed up.
Reply With Quote
  #7   Spotlight this post!  
Unread 12-02-2015, 23:10
mshafer1 mshafer1 is offline
Programming Mentor
AKA: Matthew Shafer
FRC #3937 (Breakaway)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2008
Location: Arkansas
Posts: 53
mshafer1 is an unknown quantity at this point
Re: Basic Limit Switch

Quote:
Originally Posted by Minerbotics4827 View Post
I've figured out how to setup the normal limit switch, however, I am not sure on how to set it up so you can have a button override what the switch does when pressed. Someone helped us set up something similar last year at competition, but our old code got messed up.
The attached file is only meant to be suggestive, but would accomplish the task of an override.
It assumes a limit switch that is true if not, remove the not gate.

Basically an override boils down to the limit is not pressed or the override is.

Note: on the comment going to the motor, the value is otherwise zero.
Attached Thumbnails
Click image for larger version

Name:	limitSwitchOverride.png
Views:	51
Size:	31.6 KB
ID:	18318  
Reply With Quote
  #8   Spotlight this post!  
Unread 17-02-2015, 18:42
Minerbotics4827 Minerbotics4827 is offline
Registered User
FRC #4827
 
Join Date: Feb 2015
Location: Michigan
Posts: 6
Minerbotics4827 is an unknown quantity at this point
Re: Basic Limit Switch

Thanks for replying everyone. We have it setup how we want now. We ended up going with two limit switches set as upper and lower limits with the in range and coerce function on labview.
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 08:27.

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