This project reads inputs from 4 quadrature encoders and displays the positions. There is a zero button for each channel. It is also listed at the Help Requests section.
In this picture, all four channels are from the same encoder, X and Y channels have the same scale factor (Y, Z, and A scale factor will need to be changed when I get more encoders;) A has no factor (it’s just counts). Please note the accuracy – at 1-inch intervals its accurate to less than 3 thousandths for the entire 20 inches of the digital caliper. The resolution (counts) is 1 or 2 thousandths. The decimal points are by FM (AKA sloppy coding). I've not seen any problem with the conversion from counts to LCD - the system seems to be consistent and repeats well.
The digital caliper is a generic 20 inch caliper (purchased on eBay and is for testing/calibration - it will not be used in the final system), the encoder is a UniMeasure cable (coated steel) activated US Digital optical encoder (not in the picture – it’s 20 inches away, note the steel cable in the bottom left corner) that I also purchased on eBay, I am eagerly looking for more of them, as I need at least 1 more for Y axis. Z axis currently has a digital caliper with SPC which I'd like also to read with the FPGA (hint, hint, HELP!).
I used a Pluto II FPGA and the final system will be/is battery/AC powered and reads: X 0-50", Y -12.5-+12.5", Z 0-3", A (spindle) 360 degrees (continuous), to be used on a Legacy Ornamental Mill http://www.legacywoodworking.com/ for fancy wood working.
Yes, running it through a PC would have been easier code (and more compact), but any PC would be much larger than the final container - less than 6 X 3 X 1 inches. Besides, I don’t have any serial communication programs, or any way to generate them or binary to BCD either.
The FPGA programming is Legacy Quad.zip, at; http://www.fpga4fun.com/ExternalContributions/, any constructive suggestions or comments appreciated. The quadrature reader coding is from FPGAs are fun and modified to match my coding style. Source for the binary to BCD code is given in the coding. The rest of the coding is my sloppy work - I'm new to FPGA and Verilog.