Go to Post guarantees don't mean anything when you're dealing with FRC good sir ;) - Zuelu562 [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 12-03-2012, 15:55
dcarswell's Avatar
dcarswell dcarswell is offline
FRC Mentor/Old Dominion University
AKA: DeAndre Carswell
FRC #3359 (Royal Robotics)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2006
Location: Portsmouth, VA
Posts: 36
dcarswell is an unknown quantity at this point
Exclamation REED SWITCH TROUBLE IN TELE-OP

Our reed switch isn't working the way we want it to, and we were wondering was there anything wrong in the code ? We have a water wheel mechanism on our robot that holds the game pieces until we press the button and it moves forward, we want everytime that we press the button the water wheel which is hooked to a speed controller..moves forward until the reed switch is triggered and then to stop the motor..and with us pressing the button again, the same tasks happens.

Thank you very much.

Here is our code in the Periodic Tasks.vi:
Attached Thumbnails
Click image for larger version

Name:	Reed Switch Code.jpg
Views:	48
Size:	74.2 KB
ID:	12292  
Reply With Quote
  #2   Spotlight this post!  
Unread 12-03-2012, 16:22
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,833
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: REED SWITCH TROUBLE IN TELE-OP

I'd think that code would have a problem clearing the Reed switch.
If the reed switch is on, from the start or from the last time it stopped the sequence, then it will prevent it from ever running again.

You need a frame or a loop (tied to the one you already have) that makes sure the reed switch turns off before looking for an ON again.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 12-03-2012 at 16:26.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-03-2012, 16:42
dcarswell's Avatar
dcarswell dcarswell is offline
FRC Mentor/Old Dominion University
AKA: DeAndre Carswell
FRC #3359 (Royal Robotics)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2006
Location: Portsmouth, VA
Posts: 36
dcarswell is an unknown quantity at this point
Re: REED SWITCH TROUBLE IN TELE-OP

Quote:
Originally Posted by Mark McLeod View Post
I'd think that code would have a problem clearing the Reed switch.
If the reed switch is on, from the start or from the last time it stopped the sequence, then it will prevent it from ever running again.

You need a frame or a loop (tied to the one you already have) that makes sure the reed switch turns off before looking for an ON again.
So if I added a frame after the motor has turned on, with the reed switch cutting off, then would it stop, and would the code work ?
Reply With Quote
  #4   Spotlight this post!  
Unread 12-03-2012, 18:01
dcarswell's Avatar
dcarswell dcarswell is offline
FRC Mentor/Old Dominion University
AKA: DeAndre Carswell
FRC #3359 (Royal Robotics)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2006
Location: Portsmouth, VA
Posts: 36
dcarswell is an unknown quantity at this point
Re: REED SWITCH TROUBLE IN TELE-OP

And another question that I had is that if I am calling all this in the Periodic Tasks, do I need to call it in the Tele-Op also ? Right now we have the code in both. The reed switch code pictured above in the PT.vi, and establishing which button to push in the TO.vi, and what speed the motor should be..
Reply With Quote
  #5   Spotlight this post!  
Unread 12-03-2012, 18:16
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,833
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: REED SWITCH TROUBLE IN TELE-OP

The code should be in a single place, not several places. That'd be like two people trying to type on a keyboard at the same time using the same keys.
It'll interfere with itself otherwise, and the long pauses would disable Teleop.

Periodic Tasks is the right place for a sequence like this.
  1. Check for start of sequence (joystick)
  2. Turn motor on/check for reed switch OFF
  3. Check for reed switch ON
  4. Turn motor OFF
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #6   Spotlight this post!  
Unread 12-03-2012, 18:30
dcarswell's Avatar
dcarswell dcarswell is offline
FRC Mentor/Old Dominion University
AKA: DeAndre Carswell
FRC #3359 (Royal Robotics)
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2006
Location: Portsmouth, VA
Posts: 36
dcarswell is an unknown quantity at this point
Re: REED SWITCH TROUBLE IN TELE-OP

Okay I understand what you are saying referring to the calling it in both places. Thank you on that. Now I'm not quite sure if we actually checked to see if it was on in the added sequence we just made ?
Attached Thumbnails
Click image for larger version

Name:	Example for Delphi.jpg
Views:	24
Size:	88.2 KB
ID:	12297  
Reply With Quote
  #7   Spotlight this post!  
Unread 12-03-2012, 19:07
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,833
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: REED SWITCH TROUBLE IN TELE-OP

The reed switch check will depend on if it's wired to be Normally-Closed (NC) or Normally-Open (NO). Many types of switches give you the option.

The code as you have it is good for a switch that's wired to be NO. The output of the DIO Get will be true when the switch is off and false when the switch is on.

You might still need to have your original check for when the joystick button is released, before allowing the sequence to queue up again.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
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 22:12.

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