10-29-2018 10:57 AM - edited 10-29-2018 11:00 AM
I have built a transport line in witch im going to transport some lego bricks and sort them in different color and sizes (2x2, 2x4)... My only sensor is a color sensor and i would like for it to also detect the length of the brick as well as the color. I have a set velocity on the conveyor-belt, so determing the size of the bricks shouldnt be impossible IMO. However, i dont know how...for example, Im thinking that it should be possible for the sensor to know the difference of detecting something for 0.5 sec and 1 sec
TLDR: help me sort my legobricks
Solved! Go to Solution.
10-29-2018 02:21 PM
10-30-2018 10:27 AM
Thank you for replying!
I get what your saying, like I understand the physics behind it, but the issue here is that I'm not very familiar with labview blocks and how they work collectively... A code example would be much appreciated
@Albert.Geven wrote:
Hi
If no brick is present you get the background color, so make sure it is different from all other colors!
And then from the length of the color signal you know the length of the brick.
10-30-2018 02:49 PM
10-31-2018 04:29 AM
Here is a sample VI... (like i said, i have next to no experience in labview)
So this is what the system is supposed to do;
1) Random lego brick lands on the conveyor belt driven by one motor.
2) 1 Color sensor detects what color it is and how long it is
3) This sends a command to a secondary motor which is supposed get in a specified position.
4) It also has to log the data. System needs to know what color and size is in what position
5) Also supppsed to make a user interface in which i can "order" any of the registered bricks (these are duplo-bricks)
First problem for me is part 2)
10-31-2018 01:54 PM
Hi
I have to find the lego software as I don't have it installed at the moment, and maybe don't have the newer version maybe at all.
But As far as I can see you get a color enum from the measurement vi.
What you can do is skip at no color (do nothing) and count up as long as it is the same color and the number is a size for the length.
I see that you are programming in LV 15 and I will try to give you an idea on how to do this.
Assuming the color measurement vi is fast enough to count.
I'll try later today or tomorrow.
10-31-2018 02:04 PM - edited 10-31-2018 02:05 PM
Thank you so much! Really appreciate it
11-01-2018 05:16 AM
I've managed to create a switch that, when turned on, starts counting... (Switch simulates the color sensor) However, I would like for the counted time to reset to zero every time the switch turns off so that its easier to meassure the size of the bricks...(?) If you have a better, easier solution to this though, do so as you please.
Really appreciate the help 🙂
11-03-2018 04:11 PM
Hi
Sorry I did not post earlier. But I have made an example with only fake vi's (not fake news) to show what is possible. I don't have the lego brick software at the moment but you can ask if you don't understand.
A shift register is a kind of memory during looping to remember old values.
USe your own enums from LEGO, mine are just arbitrary except that I copied the color but had to remove the type definition. Especially the 2 subVI's are almost empty.
And please use the error in and out connection to detect errors but also define the order of execution if parrallel wires are present.
11-06-2018 01:09 AM
Thank you so much! This is great 🙂
We'll work on this for a while, try to understand as much as we can, and then we're probably going to ask you a few questions later today as we're probably going to get stuck with some issues.