Go to Post Tank tracks are one of those things that keep showing up on FIRST robots, in ways that I dont understand. - KenWittlief [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-2010, 11:41
Racer26 Racer26 is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Beaverton, ON
Posts: 2,229
Racer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond repute
Re: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Quote:
Originally Posted by Omar View Post
I like to use the the greater than/less than on booleans for edge detect
That certainly is elegant.

Theres also a VI in the OpenG toolkit, (can be acquired through the VI Package Manager) which is called "Boolean Trigger" it takes a boolean in, and has a rising edge and falling edge output.

I never much liked Feedback nodes... They make it difficult to comprehend whats going on. To me a shift register makes more visual sense, despite being functionally the same.
Reply With Quote
  #2   Spotlight this post!  
Unread 10-02-2010, 15:25
Omar's Avatar
Omar Omar is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Huntsville, AL
Posts: 122
Omar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of light
Re: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Quote:
Originally Posted by 1075guy View Post
I never much liked Feedback nodes... They make it difficult to comprehend whats going on. To me a shift register makes more visual sense, despite being functionally the same.
I agree, I use Shift Registers far more often than I use Feedback nodes because I too find the feedback node harder to comprehend.

But in this simple application I like the less real estate that the feedback node uses

Posted is another way to implement a Boolean Edge detect that 1075guy speaks of.

Omar
Attached Thumbnails
Click image for larger version

Name:	ShiftReg Edge detect.png
Views:	180
Size:	9.0 KB
ID:	8607  
__________________
Omar
Reply With Quote
  #3   Spotlight this post!  
Unread 10-02-2010, 15:41
Omar's Avatar
Omar Omar is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Huntsville, AL
Posts: 122
Omar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of light
Re: Joystick Button Flip Flop

Just in case someone needs a Flip-Flop latch for a boolean.
Attached Files
File Type: vi Flip Flop.vi (7.7 KB, 56 views)
__________________
Omar
Reply With Quote
  #4   Spotlight this post!  
Unread 10-02-2010, 17:01
D Peterschick D Peterschick is offline
Aggies Robot Team Coach
FRC #2923 (Aggies)
Team Role: Teacher
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Rosalia, Washington
Posts: 2
D Peterschick is an unknown quantity at this point
Re: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

On the response to keep the limit switch with the motor going value from going less than zero? How do we do that?
Software kids are stumped!
Reply With Quote
  #5   Spotlight this post!  
Unread 10-02-2010, 20:19
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: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Quote:
Originally Posted by D Peterschick View Post
On the response to keep the limit switch with the motor going value from going less than zero? How do we do that?
Using the "In Range and Coerce" function makes it easy. The attached image shows the True case, where the value is to be limited. The False case simply wires the value straight through without modification.
Attached Thumbnails
Click image for larger version

Name:	limit switch.jpg
Views:	59
Size:	12.4 KB
ID:	8614  
Reply With Quote
  #6   Spotlight this post!  
Unread 13-02-2010, 15:02
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Re: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Really frustrated!!! We are close to throwing in the towel. Alan you keep saying this is easy, but we have spent countless hours over the past two years trying to get a switch to stop a motor without any success...it may be easy for all of you in this forum but I guarantee that we are not the only ones having this issue. We have been relying on the graciousness of Chief Delphi and LVMastery to get our robot programmed.

Can anyone write and attach a sample program with ALL of the elements included.

Here is what we need:
If button 1 is pressed a motor will spin until the limit switch is closed... AND it will not keep spinning even if the button 1 is pressed...AND it will spin in the opposite direction when button 2 is pressed even if the limit switch is closed.

We're not trying to cop-out we just need to see and example to understand the thinking behind what we are trying to do.
Reply With Quote
  #7   Spotlight this post!  
Unread 13-02-2010, 15:12
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,795
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: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Using a speed controller or a Spike?
Is the motor driven full speed in forward and reverse, e.g., on a Spike?

Does button 2 interrupt what button 1 started, or is the button 1 action stopped solely by the limit switch?

How do you want to stop after button 2 is pressed? Is there a limit switch at the other end too?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #8   Spotlight this post!  
Unread 13-02-2010, 20:08
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Re: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Quote:
Originally Posted by Mark McLeod View Post
Using a speed controller or a Spike?
Is the motor driven full speed in forward and reverse, e.g., on a Spike?

Does button 2 interrupt what button 1 started, or is the button 1 action stopped solely by the limit switch?

How do you want to stop after button 2 is pressed? Is there a limit switch at the other end too?
We are using a speed controller to power a Denso window motor BUT we could use a Spike if it would be easier.

Just to clarify-
We want a ramp to move UP when button 1 is pressed AND only when button 1is pressed. We want the ramp to go DOWN when button 2 is pressed AND only when button two is pressed.

Our issue is we need the ramp to stop when the ramp is all the way down, hence the need for a switch. We don't want to rely on the driver seeing that the ramp is down and letting go of the button in time. The plastic hex output shaft on the Denso window motor is awfully susceptible to shear.

Thanks for the help.
Reply With Quote
  #9   Spotlight this post!  
Unread 14-02-2010, 12:00
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: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Quote:
Originally Posted by grosh View Post
We want a ramp to move UP when button 1 is pressed AND only when button 1is pressed. We want the ramp to go DOWN when button 2 is pressed AND only when button two is pressed.

Our issue is we need the ramp to stop when the ramp is all the way down, hence the need for a switch.
Controlling a motor with a pair of buttons is not difficult. Use the state of the first button to select between the True and False of a case block, wiring a constant zero out of the False case and wiring the desired "UP" motor speed out of the True case. Run that output through another case block controlled by the second button, wiring the value straight through without modification in the False case and wiring the desired "DOWN" motor speed out of the True case. Run that output through the In Range and Coerce select block controlled by the limit switch; I showed an example of that a few posts ago.
Reply With Quote
  #10   Spotlight this post!  
Unread 14-02-2010, 16:55
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Re: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Quote:
Originally Posted by Alan Anderson View Post
Run that output through another case block controlled by the second button, wiring the value straight through without modification in the False case and wiring the desired "DOWN" motor speed out of the True case. Run that output through the In Range and Coerce select block controlled by the limit switch; I showed an example of that a few posts ago.
Alan- Is this what you are describing?
Attached Thumbnails
Click image for larger version

Name:	switch test.jpg
Views:	39
Size:	29.0 KB
ID:	8668  
Reply With Quote
  #11   Spotlight this post!  
Unread 14-02-2010, 18:28
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: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Quote:
Originally Posted by grosh View Post
Alan- Is this what you are describing?
Not quite. I suggest that the motor should be set only once at the end of the process, with just the numeric values that will be set going through the case blocks.

It looks like your ramp runs upward with -1 and downward with +1, so the "down" limit should prevent the value from going positive. Using -1 and 0 as the range limits will let it run upward but not downward when the limit input is active.

(The three "False" cases at the top are just there to show what's going on in the bottom case blocks.)
Attached Thumbnails
Click image for larger version

Name:	ramp.jpg
Views:	43
Size:	34.7 KB
ID:	8671  
Reply With Quote
  #12   Spotlight this post!  
Unread 14-02-2010, 20:50
grosh grosh is offline
Registered User
FRC #2147
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 100
grosh is an unknown quantity at this point
Re: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Thanks for the life-ring. I think I understand how this works now.

Can I ask one more question? Can you explain the logic of the In Range and Coerce for this instance. I have read the context help but don't understand how it works in this instance.

Thanks again!
Reply With Quote
  #13   Spotlight this post!  
Unread 14-02-2010, 22:26
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: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Quote:
Originally Posted by grosh View Post
Can I ask one more question? Can you explain the logic of the In Range and Coerce for this instance. I have read the context help but don't understand how it works in this instance.
In Range and Coerce takes a lower limit, an upper limit, and an input value. It then does two things.

1: It provides an "In Range" boolean output that is True when the value is between the limits, and False when the value is outside the limits. This feature is not used in the code I showed.

2: It provides a "Coerce"d output value that matches the input value when it is inside the limits, but does not exceed the limits in either direction when the input is outside the range. This is how the motor is kept from driving in a particular direction, by making sure the value never goes above 0.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ellipse Finding/Edge Detection Example Code? brianc217 NI LabVIEW 3 20-01-2010 08:57
Full solenoid controll off of one joystick button? m3rc1l3ss NI LabVIEW 2 11-02-2009 02:06
joystick button furiousgeorge Programming 5 07-02-2009 15:57
Ganged Interrupt Edge Detection cprogrammer Programming 8 01-02-2008 10:52
More than one joystick from one port Jmoo Programming 3 26-06-2003 18:01


All times are GMT -5. The time now is 11:47.

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