Go to Post For all of you thinking three alliances... how big of a pain would it be to have three different bumper colors? - Jon Stratis [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 17-01-2015, 15:32
Intern Intern is offline
Registered User
FRC #3596
 
Join Date: Jan 2014
Location: South Milwaukee
Posts: 17
Intern is an unknown quantity at this point
Has anyone figured out limit switches for 2015

i do not know how to code limit switches in 2015 labview, can someone comment a picture and show me how to do it, i have it done in begin all i need is teleop
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2015, 16:02
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: Has anyone figured out limit switches for 2015

What do you want the limit switch to do? Describe exactly what you want the robot to do when the switch is open and when it is closed, and we can help you program it to do that.
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2015, 16:13
Intern Intern is offline
Registered User
FRC #3596
 
Join Date: Jan 2014
Location: South Milwaukee
Posts: 17
Intern is an unknown quantity at this point
Re: Has anyone figured out limit switches for 2015

when the limit switch is pressed i want the cim motor to stop going that direction so it doesn't de-rail
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2015, 16:35
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: Has anyone figured out limit switches for 2015

That's a pretty typical use of a limit switch. Here's how I would do it, using an In Range and Coerce function. When the switch value is not true, the motor control is allowed to vary between -1 and +1. When the switch is true, the motor is only allowed to be between -1 and 0, keeping it from traveling any farther forward.
Attached Thumbnails
Click image for larger version

Name:	limit switch.png
Views:	251
Size:	21.6 KB
ID:	17884  
Reply With Quote
  #5   Spotlight this post!  
Unread 18-01-2015, 13:40
andboyer andboyer is offline
Registered User
FRC #4984
 
Join Date: Jan 2014
Location: CA
Posts: 4
andboyer is an unknown quantity at this point
What motor controllers are you using? With the new controller you can connect the limit switch directly to the controller and it will function without any additional code. https://www.google.com/url?sa=t&sour...dAP2YN2BXa9lJQ
Reply With Quote
  #6   Spotlight this post!  
Unread 20-01-2015, 17:37
1uan 1uan is offline
Registered User
AKA: Juan Halleran
FRC #2152 (S*M*A*S*H)
Team Role: Programmer
 
Join Date: Oct 2014
Rookie Year: 2012
Location: Port Orange
Posts: 18
1uan is an unknown quantity at this point
Re: Has anyone figured out limit switches for 2015

How do you get the motor control dbl to show up
Reply With Quote
  #7   Spotlight this post!  
Unread 21-01-2015, 00:59
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: Has anyone figured out limit switches for 2015

Quote:
Originally Posted by 1uan View Post
How do you get the motor control dbl to show up
In my snippet, that was just a placeholder to represent the value you want to send to the motor. How you come up with that value is up to you. You can get it from a joystick axis, or select between different values based on joystick buttons, or compute it using PID based on sensor feedback, or anything you want.
Reply With Quote
  #8   Spotlight this post!  
Unread 21-01-2015, 09:54
1uan 1uan is offline
Registered User
AKA: Juan Halleran
FRC #2152 (S*M*A*S*H)
Team Role: Programmer
 
Join Date: Oct 2014
Rookie Year: 2012
Location: Port Orange
Posts: 18
1uan is an unknown quantity at this point
Re: Has anyone figured out limit switches for 2015

thank you for the explanation
Reply With Quote
  #9   Spotlight this post!  
Unread 04-02-2015, 18:15
TheJuanRing's Avatar
TheJuanRing TheJuanRing is offline
Registered User
FRC #1997
 
Join Date: Feb 2015
Location: Kansas
Posts: 2
TheJuanRing is an unknown quantity at this point
Re: Has anyone figured out limit switches for 2015

hey this is kind of a followup, but has anyone figured out how to do it with c++???
Reply With Quote
  #10   Spotlight this post!  
Unread 04-02-2015, 19:18
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 521
ozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant future
Re: Has anyone figured out limit switches for 2015

This might help....the examples are in Java, but the class names are pretty similar.

http://wpilib.screenstepslive.com/s/...ommit=S earch
Reply With Quote
  #11   Spotlight this post!  
Unread 05-02-2015, 16:16
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: Has anyone figured out limit switches for 2015

Quote:
Originally Posted by ozrien View Post
This might help....the examples are in Java, but the class names are pretty similar.

http://wpilib.screenstepslive.com/s/...ommit=S earch
Here are some more examples in LabVIEW, both the limit switch tutorial and the state machine tutorial use a limit switch scenario.
Website of LabVIEW Tutorials for FRC
Reply With Quote
  #12   Spotlight this post!  
Unread 05-02-2015, 17:20
TheJuanRing's Avatar
TheJuanRing TheJuanRing is offline
Registered User
FRC #1997
 
Join Date: Feb 2015
Location: Kansas
Posts: 2
TheJuanRing is an unknown quantity at this point
Re: Has anyone figured out limit switches for 2015

Quote:
Originally Posted by mshafer1 View Post
Here are some more examples in LabVIEW, both the limit switch tutorial and the state machine tutorial use a limit switch scenario.
Website of LabVIEW Tutorials for FRC
Quote:
Originally Posted by ozrien View Post
This might help....the examples are in Java, but the class names are pretty similar.

http://wpilib.screenstepslive.com/s/...ommit=S earch


thanks, both of you guys, for the examples, it is a huge amount better than what i had before
(•‿•)
Edit: In hind sight I really should have thought about searching for that on the WPILib website

Last edited by TheJuanRing : 05-02-2015 at 17:32.
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:59.

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