Go to Post All in all, you get what you celebrate. The more we celebrate the under-served parts of our team the more students step up and make that part great. - Alpha Beta [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 26-01-2009, 19:50
psychomonkey psychomonkey is offline
Mr. February
AKA: Seth Rhodes
FRC #1592 (Bionic Tigers)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Fairbanks, Alaska
Posts: 23
psychomonkey is an unknown quantity at this point
Exclamation FOLLOWING the target using labview

Hello all!
I am the new programmer for Team 1592 "The Bionic Tigers". I have been given the task of providing the brains for the robot this year. So far I have gotten the axis camera to search for and track both pink and green (both combinations). The trouble that I am having right now is that I cannot figure out how to get the robot to drive to the target. I have thought it out logically and come to the conclusion that I should use the servo positions combined with the gyro to correct position of the robot. My problem right now is that I don't know how to create an If/Then statement in labview. For example: If x <90 drive right and if x >90 drive left. You get what I'm saying. This is the only thing hindering my progress. If somebody could do me a favor and send me a sample vi for following the target, that would be much appreciated. After that, I can make it shoot in autonomous.

P.S. This is my first year, so go easy on me.
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2009, 20:58
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: FOLLOWING the target using labview

You can certainly do that, but as you mentioned, LV doesn't have an if/else, so it will look a bit different.

The easiest way to configure this is to wire the number to a case -- The LV case switches on Booleans, integers, enumerations, and even strings. So you can wire up the number, and then specify which numbers map to which case diagram. For your usage, you'd click on the text on top of the case, and type in ..90 for one, then switch to the other and set to default or 91.. or some combination.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 26-01-2009, 21:04
rpcoe rpcoe is offline
Registered User
FRC #0028
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: East Hampton, NY
Posts: 5
rpcoe is an unknown quantity at this point
Re: FOLLOWING the target using labview

Labview has a multitude of comparison VI's which will compare 2 values and and provide a Boolean T/F depending on if x>y, x<y etc. See comparison template.
Reply With Quote
  #4   Spotlight this post!  
Unread 11-02-2009, 01:17
psychomonkey psychomonkey is offline
Mr. February
AKA: Seth Rhodes
FRC #1592 (Bionic Tigers)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Fairbanks, Alaska
Posts: 23
psychomonkey is an unknown quantity at this point
Question Re: FOLLOWING the target using labview

Thank you for your help. I still haven't been able to successfully follow the target, but I'm still getting ideas. I have figured out how to write a global variable to use between the x axis of the camera in basic robot main vi and autonomous. I have also now decided that having a set number such as 90 degrees would be too specific for the bot and I should create a window for it to accept. I have put "In Range and Coerce" vi's into my autonomous case structure. What I would like to know now is how to get it to turn until it is in the correct "window". I could use a for loop, but that would require me to set a number of repetitions for the loop. What is the quickest way to correct my position? any sample vi's would be of GREAT assistance, saying as I am a visual learner.
Reply With Quote
  #5   Spotlight this post!  
Unread 11-02-2009, 03:08
Bomberofdoom's Avatar
Bomberofdoom Bomberofdoom is offline
Biggest FIRST addict in Israel
AKA: Nir Levanon
FRC #2230 (Zcharia's Angels)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 471
Bomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond reputeBomberofdoom has a reputation beyond repute
Send a message via MSN to Bomberofdoom
Re: FOLLOWING the target using labview

Use the Select function from the boolean pallete in the block diagram.

If the gyro/camera axis is in the range you specfied as "the correct window", the "in range?" value will send a "true" value. You could send that the the select function. The Select function outputs the "false" input (talking about some kind of integer,double,cluster,array...) or "true" input. That is determend by the boolean value sent to the center input of the Select function(you'll se it's boolean).

Let's assume that we're controlling the right motor. The left motor is always "1". If you're in range, you'll get a "true" and the select function will output, let's say, the value of "1" to the right motor, so the robot will move straight.
If you're not in range, you'll ge a "false" and the select function will output "-1" which will spin the robot right on it's own center axis.

If it's not clear, I'll give you a visual example.
__________________
TEAM 2230 ZECHARIA'S ANGELS

2009 Microsoft Israel FRC Regional Winners!
2009 Microsoft Israel FRC Regional Chairman's Award Winners!!!
---------------------------------
2008 Microsoft Israel FRC Regional semi-finalist.
2008 Microsoft Israel FRC Regional Delphi's "Driving Tommorow's Technology" Award winner.
2008 Robot Driver
---------------------------------
2007 GM/Technion Israel FRC Regional semi-Finalist.
2007 GM/Technion Israel FRC Regional Xerox Creativity Award winner.
2007 Robot Driver.
Reply With Quote
  #6   Spotlight this post!  
Unread 11-02-2009, 07:56
psychomonkey psychomonkey is offline
Mr. February
AKA: Seth Rhodes
FRC #1592 (Bionic Tigers)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Fairbanks, Alaska
Posts: 23
psychomonkey is an unknown quantity at this point
Re: FOLLOWING the target using labview

Ok so in my copy of LabView, the Select vi was under comparison. Is this even the right vi? if so, I have wire the center boolean node to the "in range?" node of the in range vi. The output of this select vi yields a numeric value.
I have purposely left the two tank drive constants at 0 because I am not yet sure which direction it will need to turn in that case.
Reply With Quote
  #7   Spotlight this post!  
Unread 11-02-2009, 09:42
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: FOLLOWING the target using labview

That will work, but it isn't really necessary to take a Boolean, convert to a number containing two values, then switch on the number.

One way to clean it up is to wire the Boolean to the switch.

Greg McKaskle
Reply With Quote
  #8   Spotlight this post!  
Unread 11-02-2009, 11:19
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: FOLLOWING the target using labview

Something else that labview has are the PID vi's, which will get your robot from point a to point b much more quickly and accurately than the bang-bang control method than you are currently using
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
Reply With Quote
  #9   Spotlight this post!  
Unread 12-02-2009, 07:42
psychomonkey psychomonkey is offline
Mr. February
AKA: Seth Rhodes
FRC #1592 (Bionic Tigers)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Fairbanks, Alaska
Posts: 23
psychomonkey is an unknown quantity at this point
Re: FOLLOWING the target using labview

How do I find these PID vi's?
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
Using LabView to make Robot track the trailer rsisk NI LabVIEW 10 14-01-2009 14:12
Using the CMU cam in LabView VeedotJaydot Technical Discussion 1 10-09-2008 16:39
Using LabView to Simulate the Robot without the DAQ JillianM National Instruments LabVIEW and Data Acquisition 4 22-04-2008 11:23
Using the Example LabVIEW Apps Amin National Instruments LabVIEW and Data Acquisition 1 24-01-2006 08:51
LabVIEW - CMUcam finds target but cant track bear24rw Programming 6 13-01-2006 21:43


All times are GMT -5. The time now is 22:20.

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