Go to Post Never mind the imperial British Empire, the sun never sets on our FIRST season! - artdutra04 [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 22-02-2010, 20:39
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
PROGRAMMING HELP PLEASE !

Hello,

My name is DeAndre and I was wondering if someone could possibly tell me what is wrong with my code:

We have two Limit Switches on our Robot:

Limit Switch 1: When hit reverses Kicker Motor .

Limit Switch 2: When hit stops the Kicker Motor .

Limit Switch 1 is in front of Limit Switch 2 .

And also the Kicker Motor is attached to Button 1 on the joystick .

So when we press Button 1 it enables the Kicker Motor to move forward, then when it hits Limit Switch 1 it automatically reverses to consequentially hit Limit Switch 2 and stop. Then it should automatically reset it self back to its original state. (Hope I provided enough description)

Attached is our Teleop.vi !
Attached Files
File Type: vi Teleop.vi (39.6 KB, 18 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 22-02-2010, 21:09
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: PROGRAMMING HELP PLEASE !

Here is also a picture !
Attached Thumbnails
Click image for larger version

Name:	Teleop.jpg
Views:	75
Size:	83.3 KB
ID:	8774  
Reply With Quote
  #3   Spotlight this post!  
Unread 22-02-2010, 21:10
663.keith 663.keith is offline
Registered User
FRC #1493 (Falcons)
Team Role: College Student
 
Join Date: Oct 2004
Rookie Year: 2003
Location: Whitinsville Massachusetts
Posts: 250
663.keith is a name known to all663.keith is a name known to all663.keith is a name known to all663.keith is a name known to all663.keith is a name known to all663.keith is a name known to all
Send a message via AIM to 663.keith
Re: PROGRAMMING HELP PLEASE !

I would highly recommend checking out the FRC mastery site, especially the section on state machines http://frcmastery.com/try-me/state-machines/. The provided example is very similar to the method you are describing.

I hope this helps
__________________
http://www.wcsrobotics.com
team 663
team 1493
Reply With Quote
  #4   Spotlight this post!  
Unread 23-02-2010, 00:54
anyheck anyheck is offline
Registered User
FRC #2242 (Cougars)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: New Orleans
Posts: 26
anyheck is on a distinguished road
Re: PROGRAMMING HELP PLEASE !

I think that you are encountering a problem because you are referencing the motor power three times with different 'set speed' VIs and are hitting some sort of race condition.

One thing that is not obvious is that the case statement can accept numeric inputs as well as Boolean inputs.

An 'easy' way to make a case statement that takes multiple booleans and does different things when they are set is to make a case statement and build an array of your booleans using 'build array'.

You can then wire the boolean array to "boolean array to number' operator and wire the output of that to your case statement.

Then you just need to use boolean math and put a motor speed value in each case.

00=0 -> (FF= case 0)
01=1 -> (FT= case 1)
10=2 -> (TF= case 2)
11=3 -> (TT= case 3)

So there you have 4 different values with two boolean inputs and you can just use one "motor set speed" vi.

Hope this is clear I don't have labview available at the moment or I'd take a screen shot.

Regards,
Sten
Reply With Quote
  #5   Spotlight this post!  
Unread 23-02-2010, 11: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: PROGRAMMING HELP PLEASE !

Also check the "Limit 1" string fed into the RefNum Registry Get.vi

You have two (2) spaces between "Limit" and the "1".
If that is the way you set it up in your Begin VI then you are OK
But if it is different that will cause you problems
__________________
Omar
Reply With Quote
  #6   Spotlight this post!  
Unread 23-02-2010, 11:50
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: PROGRAMMING HELP PLEASE !

This is what Sten is talking about.
Attached Thumbnails
Click image for larger version

Name:	CaseStatement.png
Views:	39
Size:	2.9 KB
ID:	8788  
Attached Files
File Type: vi CaseStatement.vi (5.9 KB, 7 views)
__________________
Omar
Reply With Quote
  #7   Spotlight this post!  
Unread 23-02-2010, 15:48
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
Re: PROGRAMMING HELP PLEASE !

I believe I am trying to accomplish the same thing. I have 2 normally open switches which should turn off the relay motor once a true is recieved, which will be turned to a false, which is combined with a true from the joystick in a XOR (Not Exclusive Or) which will return false, which will turn it off. By default with nothing touching the buttons or switches, the relay should all be off, right?

Thanks
Attached Thumbnails
Click image for larger version

Name:	DIO swiches with relay.JPG
Views:	21
Size:	28.0 KB
ID:	8793  
__________________
Mentoring:
1) Educating students on the ability to learn and have fun at the same time.
2) Giving back to those who made you who you are.

2009-2011 Student 2405 Electrical/Programming & Asst. Captain
2012-???? Mentor 2405 Programming/Jack-of-all-Trades
Reply With Quote
  #8   Spotlight this post!  
Unread 23-02-2010, 17:48
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: PROGRAMMING HELP PLEASE !

Let me restate what I think you want

IF Button 1 is pressed .AND. limit switch 1 is .NOT. true then run forward
else
IF button 2 is pressed .AND. limit switch 2 is .NOT true then run rev.
else
Stop
Attached Thumbnails
Click image for larger version

Name:	TwoButtonTwoLimit.png
Views:	18
Size:	6.7 KB
ID:	8795  
__________________
Omar

Last edited by Omar : 23-02-2010 at 18:06.
Reply With Quote
  #9   Spotlight this post!  
Unread 23-02-2010, 17:56
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
Re: PROGRAMMING HELP PLEASE !

Exactly
__________________
Mentoring:
1) Educating students on the ability to learn and have fun at the same time.
2) Giving back to those who made you who you are.

2009-2011 Student 2405 Electrical/Programming & Asst. Captain
2012-???? Mentor 2405 Programming/Jack-of-all-Trades
Reply With Quote
  #10   Spotlight this post!  
Unread 23-02-2010, 18:37
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
Re: PROGRAMMING HELP PLEASE !

that's right
__________________
Mentoring:
1) Educating students on the ability to learn and have fun at the same time.
2) Giving back to those who made you who you are.

2009-2011 Student 2405 Electrical/Programming & Asst. Captain
2012-???? Mentor 2405 Programming/Jack-of-all-Trades
Reply With Quote
  #11   Spotlight this post!  
Unread 23-02-2010, 19:56
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: PROGRAMMING HELP PLEASE !

PLEASE HELP robot is due in 3 hours, and our C-Rio isnt communiting!!!!

WE TRIED WIRELESSLY USING THE ROUTER, WITH THE IP : 10.15.15.10, SUBNET: 255.0.0.0 GATEWAY 10.15.14.4 PLEASE HELP!!! IS SOMETHING WRONG PLZ ONLY 3 HOURS LEFT HELP IS MUCH AP[PRECIATED
Reply With Quote
  #12   Spotlight this post!  
Unread 23-02-2010, 19:59
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
Re: PROGRAMMING HELP PLEASE !

are you sure your ip addresses were correct? what you posted is 10.15.15.10
and 10.15.14.4, right? check the third set of numbers, they should be the same.

can someone please answer my problem now?
__________________
Mentoring:
1) Educating students on the ability to learn and have fun at the same time.
2) Giving back to those who made you who you are.

2009-2011 Student 2405 Electrical/Programming & Asst. Captain
2012-???? Mentor 2405 Programming/Jack-of-all-Trades

Last edited by kws4000 : 23-02-2010 at 20:02.
Reply With Quote
  #13   Spotlight this post!  
Unread 23-02-2010, 20:10
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: PROGRAMMING HELP PLEASE !

yes i have:Classmate :
IP: 10.15.14.10
SUBNET 255.0.0.0
GATEWAY: 10.15.14.4
Reply With Quote
  #14   Spotlight this post!  
Unread 23-02-2010, 20:14
kws4000's Avatar
kws4000 kws4000 is offline
Team Mentor - Programming
AKA: Krazy Karl
FRC #2405 (Divided by Zero)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Fruitport, MI
Posts: 164
kws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the roughkws4000 is a jewel in the rough
Re: PROGRAMMING HELP PLEASE !

Are the bridge(robot) and router(DS) correct?
__________________
Mentoring:
1) Educating students on the ability to learn and have fun at the same time.
2) Giving back to those who made you who you are.

2009-2011 Student 2405 Electrical/Programming & Asst. Captain
2012-???? Mentor 2405 Programming/Jack-of-all-Trades
Reply With Quote
  #15   Spotlight this post!  
Unread 23-02-2010, 20:24
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: PROGRAMMING HELP PLEASE !

DENINATELY (dont mind my spelling only got 1 hour till robot due )

we had it working like 3 hours ago. SUDDENLY STOPPED!!!
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
Urgent Programming C++ help please! Tds123 Programming 5 25-01-2010 15:21
Programming help please?? programmr Programming 1 05-02-2009 11:40
MPLAB PROGRAMMING PLEASE HELP!!! cstringer Programming 6 20-01-2008 13:49
PLEASE HELP!! Need help programming arm?? amirjpl Programming 12 15-03-2007 15:11
Please Help: Programming the Robovation Kit wmurphy Robotics Education and Curriculum 14 08-12-2004 12:57


All times are GMT -5. The time now is 02:58.

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