Custom discs
Pseudo-Random Code Disc Layout: Element Width, Window, Pairing

The element width of a single-track pseudo-random code is w = 2πr/M. This article covers layout only: closing M with the incremental line count N = k·M, the full-circle cyclic check for truncated sequences, the reading window (n + c + 1)·w and the sagitta of a straight detector array, aligning code elements with incremental periods, the cost of Manchester coding, and a worked parameter example for r = 15 mm.
A single-track pseudo-random code replaces n Gray-code tracks with one track: the readhead reads n consecutive code elements in the tangential direction and from them determines which element it is on. How the sequence is generated, decoded and error-corrected is covered by dedicated articles in this library, as is the length planning of linear code strips. This article deals only with the numbers that have to be fixed when the code is drawn onto a disc: how the number of code elements and the incremental line count close the circle, how long the reading window is, how code elements and incremental periods are aligned, what Manchester coding costs, and finally a parameter set for a read radius r = 15 mm.

Closing the circle: number of code elements and incremental line count
M code elements exactly fill one revolution on the disc, the element angle is 360°/M, and the element width at the read radius is
w = 2πr / M
So that the incremental track can phase the code elements, the element width is usually an integer multiple k of the incremental pitch, which gives the incremental line count
N = k·M
There are three ways to choose M:
| Sequence | M | Line count at k = 1 | Characteristics |
|---|---|---|---|
| M-sequence | 2ⁿ − 1, e.g. 1023 | 1023 | Odd line count, awkward for binary output and for division by pole-pair numbers |
| De Bruijn extension | 2ⁿ, e.g. 1024 | 1024 | One 0 added at the run of n − 1 consecutive 0s; binary-friendly |
| Truncated sequence | Any, e.g. 1000 | 1000 | Decimal resolution, but every start point must be searched |
A truncated sequence is no problem on a linear code strip, but on a disc there is an additional condition: the sequence is joined end to start, which creates n − 1 new windows straddling the seam, and these must not repeat any window already present in the section. We checked every start point of a 10th-order sequence (recursion a[k] = a[k−3] ⊕ a[k−10], i.e. x¹⁰ + x⁷ + 1): only 19 of the 1023 start points still give all-distinct cyclic windows after truncation to 1000 elements. A truncated design must therefore be checked over the full circle by program; you cannot simply cut out any section.
Reading window: n elements plus margin
The relative phase between readhead and code elements is arbitrary, so to guarantee that the window always contains n complete elements its length must be at least (n + 1)·w; if c extra bits are read for error detection or correction, the window length is (n + c + 1)·w. By the Hamming bound, correcting 1 bit requires at least c = 4 for n = 9–11 and at least c = 5 for n ≥ 12; whether this is actually achievable depends on the choice of polynomial (see the error-correction article in this library).
The difference between a disc and a linear code strip is that the track is a circular arc, whereas the detector array is usually straight. With the array tangent to the track at the window centre there are two geometric deviations:
- Sagitta: the ends of the array deviate from the track centreline by s = L²/(8r), where L is the window length;
- Tangential projection error: the position deviation of the end elements on the array is about L³/(48r²).
For n = 10, c = 4, r = 15 mm, L ≈ 1.38 mm, the sagitta is about 16 μm and the tangential error about 0.24 μm, which is negligible compared with the 92 μm element width. The sagitta only needs to be included in the radial width of the track; a curved array is needed only for small n with a long window.
A read-radius deviation changes the element pitch on the array by Δr/r. Taking the window centre as phase reference and requiring the accumulated misalignment at the window ends to stay within w/4 gives Δr ≤ r/(2(n + c)), about 0.5 mm for n = 11, c = 4 — much looser than the requirement on track width.
Aligning code elements with incremental periods
With k = 1 the element width equals the incremental pitch, and the element boundaries are aligned with the incremental line edges on the same photomask; the readhead uses the incremental phase to put the sampling point at the element centre, see Figure 1. The sampling point has a margin of w/4 to the element edge, which is consumed by: tangential offset between the code-track detector and the incremental detector inside the readhead, the eccentricity differential caused by the radius difference between code track and incremental track, and line-width error of the element edges. With the code track at 15.0 mm, the incremental track at 15.6 mm and 20 μm eccentricity, the eccentricity differential at the code track is only about 0.77 μm, so most of the margin is left for readhead assembly.
With k > 1 the absolute code only gives the element number; it must also be determined which incremental period within the element the readhead is in, and the edge position error of the elements must be smaller than w/(2k). The larger k, the harder this becomes; layouts generally use k = 1 or 2.
The layout cost of Manchester coding
With ordinary coding, the proportion of 1s in an n-bit window can range from 0 to all bits, so the mean transmittance in the window fluctuates strongly with position; each bit can only be compared with an absolute threshold, and uneven illumination and DC offset turn directly into read errors. Manchester coding splits each bit into two half-elements, “bright–dark” for 1 and “dark–bright” for 0:
- The mean transmittance of every bit is always 50%; reading only compares the difference of the two halves and is independent of illumination gradient and offset;
- Every bit has a transition in the middle, so the track carries its own bit clock;
- If the difference of the two halves is too small, the bit can be flagged as an “erasure”, which improves error-correction capability.
The price is that the finest feature shrinks from w to w/2 and the number of detectors doubles. If the finest feature is kept unchanged, the bit width must double and one bit is lost at the same radius (M is halved). Another approach adds a complementary code track in the radial direction for differential reading: the element width stays the same, but one more track’s worth of radial space is used.
Worked parameter example for r = 15 mm
| Option | M | Element angle | Element width w | Incremental lines (k = 1) | Max. gap of imaging incremental track | (n + 1)·w | (n + c + 1)·w | Finest Manchester feature |
|---|---|---|---|---|---|---|---|---|
| n = 10 | 1024 | 21.1′ | 92.0 μm | 1024 | approx. 2.0 mm | 1.01 mm | 1.38 mm | 46.0 μm |
| Truncated 1000 | 1000 | 21.6′ | 94.2 μm | 1000 | approx. 2.1 mm | 1.04 mm | 1.41 mm | 47.1 μm |
| n = 11 | 2048 | 10.5′ | 46.0 μm | 2048 | approx. 0.49 mm | 0.55 mm | 0.74 mm | 23.0 μm |
| n = 12 | 4096 | 5.3′ | 23.0 μm | 4096 | approx. 0.12 mm | 0.30 mm | 0.41 mm | 11.5 μm |
The maximum gap of the incremental track is estimated as 0.205·p²/λ (λ = 0.88 μm). Taking n = 11 as an example: 2048 code elements, element width 46.0 μm, paired with a 2048-line incremental track, reading window 0.55–0.74 mm; with Manchester coding the finest feature drops to 23.0 μm, or you switch to n = 10 with a 92 μm bit width. Figure 2 shows how element width and window length vary with n.

Engineering checklist
- Fix M first, then the line count: N = k·M; use the de Bruijn 2ⁿ when binary resolution is needed and a truncated sequence when decimal resolution is needed.
- Truncated sequences must be checked cyclically over the full circle: in the example, only 19 of 1023 start points still give non-repeating windows after truncation to 1000.
- Design the reading window as (n + c + 1)·w — about 0.74 mm for r = 15 mm, n = 11, c = 4; include the sagitta L²/(8r) of a straight array in the radial track width.
- Prefer k = 1: element boundaries aligned with incremental lines on the same mask, sampling-point margin w/4, about 11.5 μm for n = 11.
- With uneven illumination or large offset, use Manchester coding or a complementary track; the former halves the finest feature, the latter takes up one extra track.
- The element width is also the incremental pitch (k = 1), so check it against the gap window of the incremental track: for n = 12 the maximum gap is only about 0.12 mm.
Summary
The layout of a single-track pseudo-random code is tied together by two relations, w = 2πr/M and N = k·M: M sets element width and line count, k sets how hard the coarse–fine combination is, and n plus the redundant bits set the reading window. Compared with a linear code strip, a disc adds the requirements of closing the full circle and of non-repeating windows across the seam; Manchester coding trades half the finest feature for immunity to illumination and offset. At r = 15 mm, n = 11 with k = 1 is a choice that balances pitch and window length.
Translated from the ENC7 Chinese technical library (article 0304). Read the Chinese original. Need a disc built to your drawing? Request a quote or see our custom encoder discs.
© Langfang Jingzheng Optoelectronic Technology Co., Ltd. All rights reserved. This article was created with AI assistance.