Currently, I am working on the PID position control of linear motion with quadrature encoder. The coding can read the input pulse given and make respond. However, it does not feed to the input position I wanted and it stop in a random pulse. I don’t know why this happen? Can anyone explain to this. I have attached my coding. Please enlighten me with your knowledge. I need the answer as soon as possible. Thank you.
testing_2.ino (3.48 KB)