How would you go about counting pallet in real life scenario? I'm guessing latch the 1st rising edge of the pallet, and at the same time use the same sensor to count the remaining rising edges of the pallet and reset the latch on the 3rd edge count?
Great question! I would start by minimizing the noise through mechanical means: 1. I can angle the sensor to read the top of the pallet where the beam is solid. 2. I can pick up the pallet diagonally so that it always blocks the sensor. I would then use some basic debouncing logic to make sure that my signal is ON for let's say 4 seconds before I increment the counter.
Clearly it is a much easier solution to just physically position the PE beam. I was questioning for a solution from programming stand point. Curious as to what's the most affective approach. So many variables to be considered in any scenario. For example if the line dwells idle on standby etc. But Thanks Solis. Keep up the good content God Bless!
@@losantonio9049 Ah sorry, I thought you meant what to do on th emechanical side. In terms of software, I think that the simplest approach I would try first would be to read the state of the motor to make sure that the pallet is moving and then to simply count all the breaks in the beam. If the pallets are all built the same, I would simply divide the counter by 3 to get the number of actual pallets. I think the only problem with that approach would be the motor stopping / starting in a strange way. Outside of that I'd probably try to time the signals to throw errors if they're short / long.
How would you go about counting pallet in real life scenario? I'm guessing latch the 1st rising edge of the pallet, and at the same time use the same sensor to count the remaining rising edges of the pallet and reset the latch on the 3rd edge count?
Great question! I would start by minimizing the noise through mechanical means: 1. I can angle the sensor to read the top of the pallet where the beam is solid. 2. I can pick up the pallet diagonally so that it always blocks the sensor. I would then use some basic debouncing logic to make sure that my signal is ON for let's say 4 seconds before I increment the counter.
Clearly it is a much easier solution to just physically position the PE beam.
I was questioning for a solution from programming stand point. Curious as to what's the most affective approach.
So many variables to be considered in any scenario. For example if the line dwells idle on standby etc. But Thanks Solis. Keep up the good content
God Bless!
@@losantonio9049 Ah sorry, I thought you meant what to do on th emechanical side. In terms of software, I think that the simplest approach I would try first would be to read the state of the motor to make sure that the pallet is moving and then to simply count all the breaks in the beam. If the pallets are all built the same, I would simply divide the counter by 3 to get the number of actual pallets. I think the only problem with that approach would be the motor stopping / starting in a strange way. Outside of that I'd probably try to time the signals to throw errors if they're short / long.
Divide is so much simpler its so affective and produtive in comparison to a counter and latch as I had mentioned. Thanx Vlad!