As mentioned in a previous post, Holes, my Sherline mill has a digital readout (DRO). Unlike typical DROs which use magnetic or optical sensors, the Sherline works by keeping track of the position of the lead-screws using quadrature detectors mounted in the hand-wheels. While this is not as accurate as real positions sensors, the lead-screws are precise enough that it is generally more than good enough. The readout for the DRO was designed years ago and uses a 2×16 character display which is quite small. The same unit is still being sold today and is quite expensive for what it is.
I decided I wanted an easier to see display and after looking around for something suitable found Nextion displays. These are small graphical LCD displays with an attached microprocessor, touch screen and PC software that allows a GUI to be relatively easily designed and loaded into the Nextion. The Nextion uses a UART interface, so it is easy to run with another micro-controller. Interestingly, I was able to buy a 2.8 inch Nextion for less than I could find a raw 2.8 inch graphical LCD.
It was quite simple to use the Nextion PC software to produce a GUI for my DRO. The result can be seen in the photo below, which shows the Nextion in a 3D printed case next to the original Sherline readout. Since the Nextion includes a touch-screen, no buttons will be required.
You can also see at the top of the photo, the Cypress PSoC4 prototyping kit I’m using to develop the DRO firmware. PSoC stands for programmable system on a chip, and the PSoCs are quite amazing devices containing some combination of programmable analog circuitry, various function blocks and effectively a CPLD along with an ARM Cortex CPU. While all of this is not required for this project (the Sherline DRO uses an 80C51 compatible micro) and in the past I might well have done this with a Microchip PIC, the PSoCs have some advantages over typical micro-controllers. One is, the CPLD can be used to synthesize a quadrature decoder, so this operation can be done in hardware rather than software. I plan on using a PSoC5 for the actual display since it has enough CPLD cells to synthesize the required 3 quadrature decoders also has a lot program and data memory. This allows it to easily accommodate FreeRTOS, the use of which I find can considerably simplify program design.
If you were going to mass produce this DRO, the PSoC would be overkill as you can certainly do it using a much cheaper micro-controller. However, for quantity one, the processor cost is not significant. Indeed, the PSoC5 I will use is the KitProg part of the PS0C5 prototyping board and so is effectively free. The PSoC5 prototyping kit contains 2 PS0C5s, one is the prototyping PSoC, the other is used to program the first and is called KitProg. KitProg can be broken off the main board and then reprogrammed to do what you want, albeit with a limited number of pins brought out. I have several KitProgs from the Miniature elevators project available. Even if you need to buy a PSoC5 prototyping kit, at $15 it is hardly expensive (the Nextion was $20) and is insignificant next to the nearly $300 cost of the Sherline electronics.
At this point, I have the quadrature decoders displaying on the Nextion and am working on code to handle input from the touch screen. I also have a custom circuit board in the works to mount the RJ9 connectors used to connect the quadrature encoders to the electronics. The circuit board should be done next week. The custom board was $15 for three, so in the end the DRO will probably cost less than $50 and be considerably nicer than the $300 Sherline.