I have added support for single-track gray encoders to my Inkscape optical rotary encoder disk generator extension.
In a nutshell single-track gray encoders are similar to binary-reflected gray encoders because they give absolute position with multiple sensors, and two adjacent positions can only differ by one least significant bit. The difference is that STG encoder has just one track with multiple sensors. This makes it possible to make radially smaller sensors because you have just one track.
The downside to STG encoders is that they can not distinguish as many positions as a BRG encoder with the same amount of sensors. If the amount of sensors n is a power of two, then a STG encoder can distinguish 2^n-2n positions, compared to BRG encoder which can distinguish 2^n positions (doesn’t matter if n is a power of two or not).
I have been studying the New Zealand patent NZ 264738 by Bruce Spedding (who answered a few of my questions about the patent, thanks!) to be able to add this feature to my extension. One small detail is that for the same number of cutouts and sensors my extension might not give the same spacing for the encoder segments as Spedding’s patents examples. This is because the equation for figuring out the spacing between the encoder segments includes an integer “s” which can be any positive integer and all the examples in Spedding’s patent do not seem to use the same value of “s“. My extension uses a hard coded value of s=1 since it does not really affect the functionality of the encoder in any way.
Spedding’s patent is pretty clear in describing STG encoders but the actual math involved is pretty scary when you look at some other papers such as “Single-Track Circuit Codes” by Alain P. Hiltgen and Kenneth G. Paterson so I cannot guarantee my extension works like it should (because I do not fully understand them). If someone makes an actual encoder using my extension and it works or doesn’t work (or spots a bug), let me know!