Good afternoon all,
I am working on a college project where we have to sort 3 different color legos. Orange, Black, and Tan. I am using a color sensor with 3 outputs (1 for orange, 2 for black, and 3 for tan) and 3 capacitive photoelectric sensor to detect when each lego is in the eject position for the actuator to push the lego off the conveyor.
My current ladder logic will use the color sensor and move an integer (1 for orange, 2 for black, and 3 for orange) and then wait for the photoeye to detect the presence of the lego. Everything works flawless when the legos come down the conveyor in orange, black, tan orientation, but that will not always be the case. When black comes before orange for example each color is sensed before a lego reaches the eject position. In this case, black is sensed by the color sensor but then since every photoeye reads the lego, the black lego gets ejected down the orange lego chute.
My ladder logic skills are basic but I am assuming some sort of array will need to be used to only fire the corresponding actuator that matches the color sensed. And this is where I am struggling.
Thank you!
I am working on a college project where we have to sort 3 different color legos. Orange, Black, and Tan. I am using a color sensor with 3 outputs (1 for orange, 2 for black, and 3 for tan) and 3 capacitive photoelectric sensor to detect when each lego is in the eject position for the actuator to push the lego off the conveyor.
My current ladder logic will use the color sensor and move an integer (1 for orange, 2 for black, and 3 for orange) and then wait for the photoeye to detect the presence of the lego. Everything works flawless when the legos come down the conveyor in orange, black, tan orientation, but that will not always be the case. When black comes before orange for example each color is sensed before a lego reaches the eject position. In this case, black is sensed by the color sensor but then since every photoeye reads the lego, the black lego gets ejected down the orange lego chute.
My ladder logic skills are basic but I am assuming some sort of array will need to be used to only fire the corresponding actuator that matches the color sensed. And this is where I am struggling.
Thank you!