Your descriptions are not clear enough for me to understand exactly what you are doing. Remember I know nothing about your arrangements.
If you are not counting reliably the error will not be reliable either.
Also you have not said how many pulses are produced for each revolution or how fast the motors revolve.
Facts are useful ![]()
Why not put some sensors to detect when the gates reach their approved limits. Much simpler than counting revolutions or measuring motor speed.
...R