Go to Post I bet if anyone took a look at the 118's Bill of Materials the only thing that would be on there is hard work and that's priceless. - rcmolloy [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 08-07-2015, 09:51
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
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.
__________________
2016 Tesla Division Finalist
2016 Central Illinois Regional Finalist
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #2   Spotlight this post!  
Unread 09-07-2015, 15:56
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: 158
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 : 09-07-2015 at 16:15. Reason: Added solution
Reply With Quote
  #3   Spotlight this post!  
Unread 09-07-2015, 16:52
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
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
__________________
2016 Tesla Division Finalist
2016 Central Illinois Regional Finalist
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #4   Spotlight this post!  
Unread 09-07-2015, 17:36
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,113
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:	56
Size:	19.4 KB
ID:	19189  
Reply With Quote
  #5   Spotlight this post!  
Unread 09-07-2015, 20:20
Ari423's Avatar
Ari423 Ari423 is offline
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: 619
Ari423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud of
Re: Summer Labview Challenge 1

Here's my submission:
Click image for larger version

Name:	Traffic Light.png
Views:	53
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:	27
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 10-07-2015, 10:24
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 274
Bpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant futureBpk9p4 has a brilliant future
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.
__________________
2016 Tesla Division Finalist
2016 Central Illinois Regional Finalist
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #7   Spotlight this post!  
Unread 11-07-2015, 18:36
Jonathan L. Jonathan L. is offline
Programmer alumnus, mentor, and CSA
FRC #1094 (Channel Cats)
 
Join Date: Jan 2013
Rookie Year: 2011
Location: St. Louis MO
Posts: 77
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:	36
Size:	43.2 KB
ID:	19192  
Reply With Quote
  #8   Spotlight this post!  
Unread 11-07-2015, 19:48
Ari423's Avatar
Ari423 Ari423 is offline
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: 619
Ari423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud of
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 13-07-2015, 15:04
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: 123
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:	37
Size:	60.4 KB
ID:	19195
Attached Files
File Type: vi Red Yellow Green Light.vi (31.7 KB, 4 views)
Reply With Quote
  #10   Spotlight this post!  
Unread 13-07-2015, 15:14
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: 123
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 13-07-2015, 22:45
Ari423's Avatar
Ari423 Ari423 is offline
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: 619
Ari423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud of
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 14-07-2015, 08:26
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: 123
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
  #13   Spotlight this post!  
Unread 14-07-2015, 08:55
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: 123
aeastet is an unknown quantity at this point
Re: Summer Labview Challenge 1

As we went through your challenge we solved each step. Then I added one more challenge to make sure that you could not get yourself into the condition to have a fault. If you delete the event structure you will find that the code does exactly what you challenged. I am just trying to get my students to think about the whole problem and not just solve the answer. If there is a condition that can put you in a fault can you prevent it? If so do it.

We should always be thinking about a way to make our software repeatable, easy to expand, efficient and as error proof as possible. We need to think of how the operator is going to use the software and then watch them and see how they really use it. We improve the robot all year long so I challenge the programming team to make the code better all year long.
Reply With Quote
  #14   Spotlight this post!  
Unread 14-07-2015, 10:27
Ari423's Avatar
Ari423 Ari423 is offline
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: 619
Ari423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud ofAri423 has much to be proud of
Re: Summer Labview Challenge 1

Quote:
Originally Posted by aeastet View Post
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.
Makes sense. We do a similar thing by holding the first press of the buttons rather than using the buttons themselves (it's complicated to explain). I didn't recognize it done using the event structure.
__________________
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
  #15   Spotlight this post!  
Unread 14-07-2015, 10:57
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: 123
aeastet is an unknown quantity at this point
Re: Summer Labview Challenge 1

I also sent you a suggestion for a challenge. Check your messages.
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 02: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