LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Race Car Project


@ToeCutter wrote:

"Well, I hate to admit it, but we actually struggled a lot, and with nothing paid off."- where's the code that didn't pay off? What's it doing wrong? Please post what you have. If you can show you've had a stab at it, you are much more likely to get help.


I will hopefully post a screenshot with that, and hopefully that could be useful.

0 Kudos
Message 11 of 24
(844 Views)

Here is a picture of the program.

0 Kudos
Message 12 of 24
(826 Views)

Well, looking at the screenshot tells us...close to nothing.

You have a VI somewhere "Photogate"... what does it do? Does it run continuously on its own? Why isnt it connected to your time evaluation?

 

I think you should step back a little and re-think what your algorithm should perform. Draw some flowcharts on paper showing the execution order of the algorithm and THEN start to implement that in LV....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 13 of 24
(810 Views)

What version of LabVIEW are you using?

 

I've done a quick demo program for you (in LV 2013) that would show a few of the techniques I might use to do such a task.

The program will allow you to simulate both cars passing the line. Then it will keep count of the number of laps and the start/finish time. From this you could calculate who won the race.

 

The issue I see you'll probably have is how do you determine which car passed the sensor? By colour? Also, what happens if two pass the sensor at the same time? 

Either way, hopefully my demo might put you on the right path.

 

Olly

**********************************************************************************************
The day is quickly coming when every knee will bow down to a silicon fist, and you will all beg your binary gods for mercy.
0 Kudos
Message 14 of 24
(802 Views)

Olly,

 

nice general example esp. as you show quite important basics like clusters and shift registers. Next time, add a time delay in the loop and we are all happy 😄

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 15 of 24
(794 Views)

Haha, good spot 😉 You are of course right as without the delays my program will just hog your CPU 🙂

 

That'll teach me for trying to do two things at once! I should stay off these forums while at work!

 

Olly

**********************************************************************************************
The day is quickly coming when every knee will bow down to a silicon fist, and you will all beg your binary gods for mercy.
0 Kudos
Message 16 of 24
(790 Views)

@OllyT wrote:

What version of LabVIEW are you using?

 

I've done a quick demo program for you (in LV 2013) that would show a few of the techniques I might use to do such a task.

The program will allow you to simulate both cars passing the line. Then it will keep count of the number of laps and the start/finish time. From this you could calculate who won the race.

 

The issue I see you'll probably have is how do you determine which car passed the sensor? By colour? Also, what happens if two pass the sensor at the same time? 

Either way, hopefully my demo might put you on the right path.

 

Olly


 

Hi Olly, as for what version I am using, I am not really sure. I use our school's computer which has the software already installed. I do not have the software on my personal computer yet.

 

I'd check your demo program tomorrow, and thank you so much. I will test it out and see what I could possibly do.

 

As for the sensor part, I believe you misunderstood my point. I will have 2 photo gate sensors (one for each car), therefore, there will be 2 main parts in my program. However, worst case scenario is that I'm unable to do that and will be forced to use 2 computers, and simply determine the winner manually by comparing the results ourselves. 

 

My teacher had a better and simpler suggestion, is to simply let the photo gate sensor count how many times a car has passed and the first car to finish the 5 laps will be the winner. But I feel like sticking to my original plan.

0 Kudos
Message 17 of 24
(767 Views)

His demo should work just fine.  Instead of the boolean controls he has (one for each car), it will be the boolean value that comes from whatever DAQ setup you are using to read your sensors.

 

You may want to modify just a little bit.  Supposed a car is going be slow enough that the loop iterates twice while it is still blocking a sensor?  What you will want is to do a boolean crossing detector set up to only trigger when the boolean value from the sensor goes from unblocked to blocked (I don't know whether blocked would be a True or False, it depends on your sensor and your DAQ setup.)

 

LabVIEW has a VI built-in called Boolean Crossing pt by pt.

 

One other issue is suppose both cars break their beams at exactly the same time.  Right now the code is biased to detect Car 1.  You may want to modify the code to have two separate while loops, one for each car.

0 Kudos
Message 18 of 24
(746 Views)

Hi UINacarizo,

 

You might already be aware of this, but in case not- you can access the Student version of LabVIEW for home use here as long as you meet the licensing requirements:

 

Free 6-Month Evaluation of LabVIEW Student Edition for at-home learning

https://decibel.ni.com/content/docs/DOC-30610

 

Regards,

Tom L.
0 Kudos
Message 19 of 24
(736 Views)

@0utlaw wrote:

Hi UINacarizo,

 

You might already be aware of this, but in case not- you can access the Student version of LabVIEW for home use here as long as you meet the licensing requirements:

 

Free 6-Month Evaluation of LabVIEW Student Edition for at-home learning

https://decibel.ni.com/content/docs/DOC-30610

 

Regards,


Thanks man, I appreciate it.

0 Kudos
Message 20 of 24
(703 Views)