im planning to build a belt driven, inverted pendulum and control it with MPC. Two measure the position of the cart im planing to use a rotary encoder on one of the axis of the belt drive. I thought about using a normal AB rotary encoder since it seems they are easy to use and simpler to work with for example somthinh like this:
Since the application will run over 5 hours im afraid that i will experience shifting over time so the position becomes more and more inaccurate. At our university i found this ABZ rotary encoder:
From a quick research, it seems as if those encoders are way harder to work with. What do you think i should choose?
The first one probably needs a pullup network but the second one i got the NPN+PNP output version so its more plug in play.
From your description I assume that from start to end the axis controlling the encoder will turn multiple times. In that case, even with an absolute encoder, you can't know the position after power up. You'll need at least one end switch to get an absolute position.
In industrial applications often end switches are applied at both ends, and the encoder is used for speed control, to brake before it hits the end, or to create intermediate stops. Missed pulses, though rare with carefully built circuits, can automatically be corrected.
But as long as i always start the cart in the middle of the rail and tell the encoder that it is always at point 0 when it starts then the encoder should now the exact postion until the application shuts down or?
Of course i am:) I dont think that code will be the issue. The code is not really complicated and there are many books, videos and posts in this forum about it. Im afraid that the Hardware glitches/shifts.
Not an issue with professional circuit design and high quality equipment. However, a hobbyist should worry about using cheap junk purchased from Alibaba or Amazon.