| Electronics > Projects, Designs, and Technical Stuff |
| Optical Rotary Encoder |
| << < (4/4) |
| Ian.M:
Thanks for the correction. Sorry about the bad maths. With those revised figures, it makes sense to go straight to the 8K2, 15K divider and it definitely wont need a pullup on the encoder output. |
| arduinew:
sorry but cant seem to find a current topic re Optical encoder logic.. Am trying to solve a puzzle - to divide the o/p of an optical encoder rate by 2, using logic gates, currently at 2400 ppr, down to 1200 ppr. Simply feeding A&B signals into D latch FF doesnt work- it ends up with a 45 degree phase shift, not 90 degrees. Logic must cope with reversal without missing a single step. Much searching has revealed nothing concrete yet. (I suspect that reducing it down to 1800 ppr would be much harder!) |
| Ian.M:
@arduinew, Hi-jacking old topics is not a good way to attract expert replies here. Next time, *PLEASE* start a new topic for your query or preferably whole project in the most appropriate sub-forum you can find. With that out of the way, you are going to need to implement a state machine locked to the original A and B signals, that update the divided A and B signals every other state transition to get 1200 PPR. If the encoder outputs are clean, you may be able to make it self-clocking, but that would be considerably more complex vs an external clock. I haven't analysed the problem in detail yet, but I would expect it to take up the better part of a Eurocard of LSI logic chips. A better solution would be to implement the state machine in a CPLD or small FPGA, or if the maximum shaft speed isn't too high, in a small 8 bit MCU. Getting 1800 PPR would be *MUCH* harder, due to the non-integer division ratio, and doing so without angular jitter would be impossible unless the original encoder has sinusoidal analog outputs that could be used to increase its effective resolution. You've got 9600 input edges per turn, and to generate 1800 PPR outputs, you need one output transition every 2.6666 input edges. That's just possible as the ratio is greater than 2 but the relative phase of the quadrature pulse train will jump to and fro by one interval between input edges, i.e. 0.0375 degrees of jitter. |
| Navigation |
| Message Index |
| Previous page |