kamenges
Member
I probably should know how to approach this but I've gone into brainlock.
I have an application where I am using a 12-bit absolute encoder. I want to be able to stop at any point and adjust my accel/decel rate to anything I want. One thing that makes my life a little easier is I only need to move in one direction so I will always be crossing zero from one direction.
My problem comes in when I have to cross over the zero point. For example, assume I always rotate in a positive direction. I have a 12-bit encoder, which will give me 8192 discrete positions. Assume I want to stop at position 1 and I am starting at 6000. My position feedback will progess in a positive direction through 8191 then jump down to zero and progress to 1.
Ultimately I am looking for instantaneous distance left. Typically this would simply be Desired_Pos - Actual_Pos. But if my Actual_Pos starts out greater than my Desired_Pos and I can only move in a positive direction this falls apart. I can't seem to come up with a good way to give me this that will work in all cases without a significant amount of protection logic. Any ideas?
Keith
I have an application where I am using a 12-bit absolute encoder. I want to be able to stop at any point and adjust my accel/decel rate to anything I want. One thing that makes my life a little easier is I only need to move in one direction so I will always be crossing zero from one direction.
My problem comes in when I have to cross over the zero point. For example, assume I always rotate in a positive direction. I have a 12-bit encoder, which will give me 8192 discrete positions. Assume I want to stop at position 1 and I am starting at 6000. My position feedback will progess in a positive direction through 8191 then jump down to zero and progress to 1.
Ultimately I am looking for instantaneous distance left. Typically this would simply be Desired_Pos - Actual_Pos. But if my Actual_Pos starts out greater than my Desired_Pos and I can only move in a positive direction this falls apart. I can't seem to come up with a good way to give me this that will work in all cases without a significant amount of protection logic. Any ideas?
Keith