LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting colors and signal duration. Is it possible?

Solved!
Go to solution

Thanks for scanning all those folders.

The only strange thing I see is that you are having 64 bit Lego stuff. 

I Feel that 64 bit LabVIEW only is needed for very data intensitive applications and that even in LV2018 the 64 bit version is not as good as the 32 it version, so I only use 32 bit LabVIEW.

I'm going to use a method that I explain in the code to have a mode in which I can use my subvi's for simulation and you can use the LEGO modules.

I'll post again tomorrow.

greetings from the Netherlands
0 Kudos
Message 31 of 97
(3,990 Views)

Many thanks! Looking forward to it 🙂

0 Kudos
Message 32 of 97
(3,989 Views)

Hi

attached a VI and a cluster definition (a cluster in LV is a record in Pascal or struct in C)

Just load the new sorter vi and it should run except for motor B that I cannot fix but you probably.

Everything now loads in my version without compiler errors and just ask questions when you have a problem.

greetings from the Netherlands
0 Kudos
Message 33 of 97
(3,986 Views)

Wow, this is amazing! Thank you so much! We will try it tomorrow with the hardware and see how it runs and then report back 

 

 

 

0 Kudos
Message 34 of 97
(3,984 Views)

Good evening, Albert!

 

We've now tried out your code and let me tell you, it works GREAT! The whole core of the project is now under control 🙂 THANK YOU!

 

We still have some minor issues though... 

1) I want the secondary motor, the arm for the sorter, to when we innitiate the program, go to a default position with help of a touch sensor. The problem is that im not sure where to place the sequence. I've tried different positions (either inside or outside the while-loop), but this seems to compremise the conveyor belt and the color sensor (I've explained it inside the VI with a code example)

2) The user interface:

- We're not sure where to start here... I've elaborated in a text box in the VI... 

 

Again, Thanks Albert. We appreciate your help so much

0 Kudos
Message 35 of 97
(3,978 Views)

Good evening, Albert!

 

We've now tried out your code and let me tell you, it works GREAT! The whole core of the project is now under control 🙂 THANK YOU!

 

We still have some minor issues though... 

1) I want the secondary motor, the arm for the sorter, to when we innitiate the program, go to a default position with help of a touch sensor. The problem is that im not sure where to place the sequence. I've tried different positions (either inside or outside the while-loop), but this seems to compremise the conveyor belt and the color sensor (I've explained it inside the VI with a code example)

2) The user interface:

- We're not sure where to start here... I've elaborated in a text box in the VI... 

 

Again, Thanks Albert. We appreciate your help so much

0 Kudos
Message 36 of 97
(3,978 Views)

I tried some idiot UI, very minimal, you can extend this.

You only have to tell when to start retrieving and you have to fill in in a table where to move that specific block

You will have a hard time to do that so just ask.

greetings from the Netherlands
0 Kudos
Message 37 of 97
(3,974 Views)

Hi, thank you for the code!

 

After testing for some hours today, we noticed that it detects the correct color but somehow they're all stored as the color brown for some reason... This compremises the retrieving system so we havent gotten around to figure that out yet...

We also tried to make the brown color active by setting it to TRUE in that purple table you made since the system for some reason register those as brown... However, this didnt work because i think something has to be tweeked somewhere in the code in terms of registering the color brown (yellow)... It doesnt compare the default (black) signal and the brown one... 

 

We will be back working on it though tomorrow, but it would be great if you could use or wiseness to guide us in the right direction 🙂 

 

Thanks again, Albert! 

0 Kudos
Message 38 of 97
(3,961 Views)

I'll check this evening. Must be something stupid from me.

The retrieve was not tested I guess.

The table you mentioned, on the left is a translation of the case statement. Probably right. Brown should not be detected anyway.

Till later.

By the way, where is your school located?

greetings from the Netherlands
0 Kudos
Message 39 of 97
(3,959 Views)

Hi

Sorry, wrote the last response in a hurry so the other problem was a bit vague...

 

What I ment to say is that the colour sensor, when a yellow brick passes, detects the colour brown... That's why I tried turning it true and transfer the values originally from the yellow row, to the brown one... Now when this was done, it could not properly differentiate the length of the bricks of this particular color because i suspect the "brown case" is not defined or something. Hope you now understand the issue. 

 

And to answer your question, we are students (mechatronics engineering) from the University of Agder in Norway :). This particular project is from a course called product development.

We've never used Labview up until now (no lectures whatsoever) so that's why we've been struggling this much. Good to know that there's kind souls like yours out there to help. We would never get it done without your help so we are forever grateful:)

 

Have a nice evening

0 Kudos
Message 40 of 97
(3,960 Views)