Here is the original problem statement:
FIFO getting off by one position rejecting the wrong bottle
I have a bottle capper that is using an encoder and FIFO logic to track the free standing bottles passing through a bottle capper. ... There is a product sensor that loads the FIFO
As @Peter notes, it's been twenty questions since then, with zero answers.
Dear OP/@floyd2904,
Your PLC program is a model of this bottle capper process. The design of the sensors on the process and the program instructions infer some level of the fidelity of the modeled process with respect to the physical process. For example, the model may not know about bottles upstream of the product sensor, nor may it know about bottles downstream of the reject station. The PLC-modeled process has many assumptions, explicit and/or implicit, in its representation of the physical process. The level of fidelity of the model determines the accuracy, and validity, of those assumptions, such as
- how much the process moves a bottle for each encoder pulse
- whether, and how much, the bottle can slide or shift on the conveyance device
- how far the reject station is from the product station
- how to interpret the signal from the product sensor
- etc.
From the minimal information provided to this point, it is all but certain that one or more of those assumptions is either incorrect or not accurate enough to allow the PLC to reject the correct bottle; every response about your process in this thread has been an expression of some form of that concept.
So the answer to your request (which is at best implicit in the context of this forum, or perhaps the original post's purpose was merely to tell a story or anecdote to an audience you thought might appreciate it), all you have to do is collect all assumptions made by the model that are implicit in the PLC program and its input sensors, then evaluate them individually and
in toto to deduce which assumption or assumptions are not up to the task, and finally use that deduction to determine how to fix the model.
Given the information provided, that is probably the most detailed response you will get that actually answers your (implied) request; the other answers are certainly fairly likely to help, and if I were you I would see if adding a debounce to some of the input signals improves operation, but without more information we cannot be sure.
If you would like a more detailed response, try providing more information, e.g. the PLC code, a full description of the process and its sensors, a sketch, photo, or video of the process. There have been nearly two dozen responses to your original post, and although some of them have been a riveting side-debate regarding a few approaches to debounce algorithms, I am not sure much has been accomplished to help you solve your implied problem.
Good day,
drbitboy, DMD