Thanks for the responses. I don’t believe it’s an over run issue. If it were an over run wouldn’t it read in negative numbers? The motor stopped at 0 right where it should, it’s just that its 10 mm short (technically 5mm, the gap between the to panels coming together is 10mm) of it’s starting position and not encounter the limit switch yet.
The encoder is reset to zero when it encounters the limit switch and from what I can tell it keeps resetting to zero until in comes off. I think that’s where the issue is.
To answer your last question, I did fixed the problem by changing the “close” position from 0 to –400, that way it won’t stop until it hits the limit switch and then it reset to 0. I believe that’s what you’re suggesting? It works but I didn’t know if that’s the most “eloquent” way to address it.
Again, I'm new at this and literally pieced together the code from at least five separate examples of using IR remotes, limit switches, encoders, direction control and memory position. I had to adapt sketches from push button to IR input. Try and decide what parts of some code to throw out hoping that just because it didn’t seem to effect what I was doing that some how it wasn’t still relevant. I got it to work from educated guesses, but mostly trial and error.