Go to Post In conclusion we will have a spaghetti game - Darkseer54 [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 07-08-2015, 09:51 AM
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 271
Bpk9p4 is on a distinguished road
Summer Labview Challenge 1

This week my labview class learned all about Boolean logic so this weeks challenge is all about Boolean logic. For this challenge you can only use Boolean logic. I highly recommend you only use AND, OR, and NOT. The challenge is based around a stoplight game you have a green, yellow and red lights. Your robot can be moving when the light is green it cannot be moving when the light is red. There are two parts to this challenge. Fell free to ask question and post your answer on here. I will post my answer to the problem on Tuesday.

Part 1
Your program will have 3 inputs and 2 outputs

Inputs
1) Green Light (True / False)
2) Yellow Light (True / False)
3) Red Light (True / False)
Outputs

1) Go (True / False)
2) Stop (True / False)

The challenge is to have Stop = True when the light is Yellow or Red and Go = True when the light is green.

Part 2
Your program will have 3 inputs and 3 outputs

Inputs
1) Green Light (True / False)
2) Yellow Light (True / False)
3) Red Light (True / False)

Outputs
1) Go (True / False)
2) Stop (True / False)
3) Fault (True / False)

The challenge is the same as above however if more then one light is on Fault = True, Stop = True, and Go = False. The reason we are checking for faults is we always want to make sure you sensor is working correctly.
__________________
2015 Midwest Regional Finalist
2015 Central Illinois Regional Winner
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #2   Spotlight this post!  
Unread 07-09-2015, 03:56 PM
GuyM142's Avatar
GuyM142 GuyM142 is offline
Registered User
AKA: Guy
FRC #3339 (BumbleBee)
Team Role: Mentor
 
Join Date: Jul 2013
Rookie Year: 2012
Location: Israel
Posts: 156
GuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really niceGuyM142 is just really nice
Re: Summer Labview Challenge 1

Are case structures allowed?

Edit:
My solution in the link: http://oi60.tinypic.com/x5rvpe.jpg
__________________
2016-2017 - Programming Mentor
Curie Sub-Division Champions with 694, 379 & 1511
2015 - Team Captain & Head of Programming Crew
Carson Sub-Division Champions with 1325, 20 & 1711
First ever Israeli team on Einstein
2014 - Team Captain & Head of Programming Crew
2013 - Head of Programming Crew
2012 - Member of Programming Crew

Last edited by GuyM142 : 07-09-2015 at 04:15 PM. Reason: Added solution
Reply With Quote
  #3   Spotlight this post!  
Unread 07-09-2015, 04:52 PM
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 271
Bpk9p4 is on a distinguished road
Re: Summer Labview Challenge 1

i did not intend case structures to be used. Your solution looks great. it is really close to how i did it
__________________
2015 Midwest Regional Finalist
2015 Central Illinois Regional Winner
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #4   Spotlight this post!  
Unread 07-09-2015, 05:36 PM
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: Summer Labview Challenge 1

Since there are only three Boolean inputs, I took a different direction. The Input control is a cluster of three buttons (Green, Yellow, and Red), and the Output indicator is a cluster of three LEDs (Go, Stop, and Fault). If you run the attached snippet, you can see them on the front panel.
Attached Thumbnails
Click image for larger version

Name:	example.png
Views:	54
Size:	19.4 KB
ID:	19189  
Reply With Quote
  #5   Spotlight this post!  
Unread 07-09-2015, 08:20 PM
Ari423's Avatar
Ari423 Ari423 is online now
LabVIEW aficionado and robot addict
AKA: The guy with the yellow hat
FRC #5987 (Galaxia)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2012
Location: Haifa, Israel
Posts: 518
Ari423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant future
Re: Summer Labview Challenge 1

Here's my submission:
Click image for larger version

Name:	Traffic Light.png
Views:	48
Size:	19.8 KB
ID:	19190

Also I made a fancy front panel for fun:
Click image for larger version

Name:	Traffic Light FP.JPG
Views:	22
Size:	55.1 KB
ID:	19191

I think the converting to integers makes the code look nicer and easier to read, even if it is illegal. I decided to fail safe, and I think most would agree that it is better for a car to stop rather than accelerate if it gets a bad reading. As always, open to questions, comments, and concerns.
__________________
2017-present: Mentor FRC 5987
2017-present: CSA for FIRST in Israel
2012-2016: Member FRC 423
2013: Programmer
2014: Head Programmer, Wiring
2015: Head Programmer, Wiring
2016: Captain, Head Programmer, Wiring, Manipulator, Chassis, CAD, Business, Outreach (basically everything)


Reply With Quote
  #6   Spotlight this post!  
Unread 07-10-2015, 10:24 AM
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 271
Bpk9p4 is on a distinguished road
Re: Summer Labview Challenge 1

These all looks like great answer. Always fun to see the different way people solve the same problem.

If you guys have any suggestion for future challenge please let me know.
__________________
2015 Midwest Regional Finalist
2015 Central Illinois Regional Winner
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #7   Spotlight this post!  
Unread 07-11-2015, 06:36 PM
Jonathan L. Jonathan L. is offline
Registered User
FRC #1094
 
Join Date: Jan 2013
Location: St. Louis MO
Posts: 60
Jonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the roughJonathan L. is a jewel in the rough
Re: Summer Labview Challenge 1

Another fault condition would be if none of the lights are on.

A timer might be a good challenge.
Attached Thumbnails
Click image for larger version

Name:	Challenge 1 part 2.png
Views:	35
Size:	43.2 KB
ID:	19192  
Reply With Quote
  #8   Spotlight this post!  
Unread 07-11-2015, 07:48 PM
Ari423's Avatar
Ari423 Ari423 is online now
LabVIEW aficionado and robot addict
AKA: The guy with the yellow hat
FRC #5987 (Galaxia)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2012
Location: Haifa, Israel
Posts: 518
Ari423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant future
Re: Summer Labview Challenge 1

Quote:
Originally Posted by Jonathan L. View Post
Another fault condition would be if none of the lights are on.
Mine actually does that too. It shows no fault iff exactly one light is lit.
__________________
2017-present: Mentor FRC 5987
2017-present: CSA for FIRST in Israel
2012-2016: Member FRC 423
2013: Programmer
2014: Head Programmer, Wiring
2015: Head Programmer, Wiring
2016: Captain, Head Programmer, Wiring, Manipulator, Chassis, CAD, Business, Outreach (basically everything)


Reply With Quote
  #9   Spotlight this post!  
Unread 07-13-2015, 03:04 PM
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 113
aeastet is an unknown quantity at this point
Re: Summer Labview Challenge 1

Here is my solution. This is also a snippet. We made the stop and go one light. We added a blink feature to the fault light. We did not use the default blink because it really isn't very nice. Then we added the upper loop with the event structure to set the lights so no more than one can be pushed at one time.

Click image for larger version

Name:	Red Yellow Green Light.png
Views:	33
Size:	60.4 KB
ID:	19195
Attached Files
File Type: vi Red Yellow Green Light.vi (31.7 KB, 3 views)
Reply With Quote
  #10   Spotlight this post!  
Unread 07-13-2015, 03:14 PM
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 113
aeastet is an unknown quantity at this point
Re: Summer Labview Challenge 1

If you do not know how a snippet works:

If you open LabVIEW and drag the picture into the block diagram it will add all of the code from the picture posted as long as it is a snippet. It is very cool.
Reply With Quote
  #11   Spotlight this post!  
Unread 07-13-2015, 10:45 PM
Ari423's Avatar
Ari423 Ari423 is online now
LabVIEW aficionado and robot addict
AKA: The guy with the yellow hat
FRC #5987 (Galaxia)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2012
Location: Haifa, Israel
Posts: 518
Ari423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant future
Re: Summer Labview Challenge 1

Quote:
Originally Posted by aeastet View Post
Here is my solution. This is also a snippet. We made the stop and go one light. We added a blink feature to the fault light. We did not use the default blink because it really isn't very nice. Then we added the upper loop with the event structure to set the lights so no more than one can be pushed at one time.
What is the purpose of the fault detection if you use the event structure loop to ensure faults are impossible?
__________________
2017-present: Mentor FRC 5987
2017-present: CSA for FIRST in Israel
2012-2016: Member FRC 423
2013: Programmer
2014: Head Programmer, Wiring
2015: Head Programmer, Wiring
2016: Captain, Head Programmer, Wiring, Manipulator, Chassis, CAD, Business, Outreach (basically everything)


Reply With Quote
  #12   Spotlight this post!  
Unread 07-14-2015, 08:26 AM
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 113
aeastet is an unknown quantity at this point
Re: Summer Labview Challenge 1

Quote:
Originally Posted by Ari423 View Post
What is the purpose of the fault detection if you use the event structure loop to ensure faults are impossible?
If I know I can have a fault condition I will try to do what I can to make sure that I can not have it. Sometimes this is impossible but in this case I added code to prevent someone from hitting two buttons at once. I would do this in my software if I knew the condition existed. This way there is now no way for the operator to accidently hit two buttons when they get excited in a game.
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 06:07 PM.

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