# Gray code Adder–Subtractor (Encoder mixer)

High Speed, Low Latency 2-bit HW Gray Code Adder-Subtractor – Eases Direct Axis Position Feedback for Differential Drive Kinematics

- **Seller:** [Rowdy NPC store](https://lectronz.com/stores/rowdy-npc-store), Nagoya, Aichi, Japan
- **Price:** €23.45 (EUR, before shipping and taxes)
- **Availability:** Coming soon
- **Categories:** 3D printing, CNC, Robotics
- **Product page:** https://lectronz.com/products/encoder-adder-subtractor-ab-quadrature-mixer

## Options

**Kit or Fully Assembled**

- Fully Assembled (3 left)
- Kit (unsoldered headers) (1 left)

**Minimum edge separation**

- Encoder speed ≦ 1.5 Mbps & Controller sampling speed ≧ 4.25 MS/s (1 left)
- Encoder speed ≦ 3 Mbps & Controller sampling speed ≧ 8.5 MS/s (1 left)
- Encoder speed ≦ 6 Mbps & Controller sampling speed ≧ 17 MS/s (4 left)
- Encoder speed ≦ 12 Mbps & Controller sampling speed ≧ 34 MS/s (1 left)

## Images

![Gray code Adder–Subtractor (Encoder mixer)](https://lectronz-images.b-cdn.net/lectronz/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6NTQyMDcsInB1ciI6ImJsb2JfaWQifX0=--d0db0da92afaddb25da87af109fa8003e7687d8d/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJKUEciLCJyZXNpemVfdG9fbGltaXQiOls5NjAsNjQwXSwic2F2ZXIiOnsic3RyaXAiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--a1419a086f227676aca33a49760ac51e58b523e3/Front-003.JPG)
![Gray code Adder–Subtractor (Encoder mixer)](https://lectronz-images.b-cdn.net/lectronz/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6NTQyMTEsInB1ciI6ImJsb2JfaWQifX0=--532a3e27fec446ac9e5bcb97587d3835a14d6c7b/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJwbmciLCJyZXNpemVfdG9fbGltaXQiOls5NjAsNjQwXSwic2F2ZXIiOnsic3RyaXAiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--605f1da017bcbb03ce31845cd0e81d97e3b3c574/AbzMxr_Compact-V002_sc0005-02.png)
![Gray code Adder–Subtractor (Encoder mixer)](https://lectronz-images.b-cdn.net/lectronz/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6NTQyMTUsInB1ciI6ImJsb2JfaWQifX0=--38451237f3798c0980bc5bedad0336d36147ad01/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJwbmciLCJyZXNpemVfdG9fbGltaXQiOls5NjAsNjQwXSwic2F2ZXIiOnsic3RyaXAiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--605f1da017bcbb03ce31845cd0e81d97e3b3c574/BreakoutBoardDimension-001.png)
![Gray code Adder–Subtractor (Encoder mixer)](https://lectronz-images.b-cdn.net/lectronz/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6NTQyMTksInB1ciI6ImJsb2JfaWQifX0=--798c04f7a353c7430770c714d00eccc4752e5cec/eyJfcmFpbHMiOnsiZGF0YSI6eyJmb3JtYXQiOiJwbmciLCJyZXNpemVfdG9fbGltaXQiOls5NjAsNjQwXSwic2F2ZXIiOnsic3RyaXAiOnRydWV9fSwicHVyIjoidmFyaWF0aW9uIn19--605f1da017bcbb03ce31845cd0e81d97e3b3c574/wiring_diagram_example-001.png)

## Description

# Your CoreXY diff. drive doesn't have to compromise on accuracy, nor speed!

Mount linear encoders on the **physical X/Y axes**, mix signals in pure hardware, and feed perfect motor\-domain A/B feedback to your controller.  
No firmware hacks, no CPU overhead, no more VFAs!


# What It Does

This compact hardware module mixes two independent ABZ quadrature encoder signals (e.g., linear X and Y) in real time:

- **OUT1** = X \+ Y → pure Motor A equivalent  
- **OUT2** = X \- Y → pure Motor B equivalent  
- **Z\_out** = Z\_x XOR Z\_y → for your convenience  

Plug your axis encoders in → get the clean, low\-latency ABZ signals your motion controller expects.

# Key Benefits

- Enables **true closed\-loop with linear encoders** on Duet 1HCL and similar boards  
- Zero software latency, propagation delay as low as **73 ns @ 5.0 V**  
- Up to **12.0 Mbps error-free output bandwidth** (frees up to 35+ MIPS in your high\-speed control loops)  
- Plug\-and\-play: no firmware mods, standard TTL quadrature compatible  
- Built\-in ACTIVITY LEDs give instant visual feedback (1 blink = 1 step)  
- Wide voltage range: 3.3 ±0.3 V ~ 5.0 V ±0.5 V (<100 mA)


# The Core Problem: Domain Mismatch in Differential Kinematics

Most motion controllers (Duet3 1HCL, Ouroboros, ODrive, many industrial servos) expect encoder feedback to match each motor's rotation. In CoreXY and differential\-drive systems, this creates issues:

- **Motor\-mounted rotary encoders** give precise motor angles but can't correct downstream errors (belt stretch/slip, pulley eccentricity, backlash, torsion, stiction, bearing play). This leads to artifacts like ringing, Vertical Fine Artifacts (VFAs), and dimensional inaccuracies, even in closed\-loop mode.  
- **Linear encoders on the X/Y axes** deliver true effector position (ideal for accuracy), but popular controllers usually have only one ABZ encoder input per motor, or require software to fuse X and Y into A/B (adding latency, CPU load, and needing dual ABZ inputs in hardware).  

**Result:** You sacrifice true positional accuracy or fight hardware/firmware limitations and performance penalties.

**The fix is hardware\-level mixing**, transforming linear X/Y feedback into motor\-domain A = X\+Y and B = X\-Y signals, so your existing controller sees exactly what it wants, with zero software involved.

# Killer Features

## 　1) Ultra\-Simple Setup

Standard kit includes all crimp connectors.  
Works out of the box with most quadrature encoders.

## 　2) No CPU Overhead, Minimal Latency

Hardware\-only processing eliminates software sensor fusion delays.  
Lab tested up to full spec ー see scope traces below.

## 　3) "Fake" Cartesian Mode (Controller Agnosticism)

Trick industrial servo drives and single\-encoder\-per\-axis controllers into thinking they’re driving a standard Cartesian stage: perfect for retrofitting CoreXY mechanics!

# Applications

- CoreXY 3D printers with linear encoders (Voron, RatRig, etc.)  
- Differential drive robot wrists / joints (geared, timing belts, capstan, etc.)  
- Any coupled kinematic system needing sum / difference feedback  


[![CoreXY 3D printer linear encoder implementation example](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/wiring_diagram_example-001-small01.png "CoreXY 3D printer linear encoder implementation example")](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/wiring_diagram_example-001.png)

# Specifications

| Parameter                             | Value                                              |
|---------------------------------------|----------------------------------------------------|
| Absolute Min. / Max. Supply Voltage   | \-0.5 ~ 7.0 V                                      |
| Operating Voltage (Vdd)               | 3.3 V ±0.3 V ~ 5.0 V ±0.5 V (<100 mA)              |
| Min. Propagation Delay                | 73 ns @ 5.0 V / 112 ns @ 3.3 V                     |
| Min. Output Edge Separation           | 67 ns (17.0 MS/s minimum recommended sampling rate)|
| Max. Error-free Bitrate\* **per input**    | 6.0 Mbps (185ns minimum recommended input edge separation)   |
| Output Type                           | Single\-ended TTL push\-pull (<9 mA, 50~65 Ohm)      |
| Inputs                                | Single\-ended TTL (10 kΩ internal pull\-up to VDD)   |
| Z Output                              | XOR of Z\_x and Z\_y                                 |
| Operating Temperature Range           | -20°C to 65°C                                        |
| Included                              | ・ 4 x CDR\-05\-TS　header (soldered / unsoldered opt.)|
|                                       | ・ 4 × CDH\-05 plugs                                  |
|                                       | ・ 20 × CDH\-C crimp contacts                         |

*\*Error rate < 0.001 ppm*

# Important Warnings & Recommendations

- Sold as\-is for integration (sub\-component), no warranty  
- Buyer of the kit version (headers unsoldered), ground pads do not have thermal relief  
- Do not exceed ratings  
- Inputs are unprotected / unterminated  
- All I/O share common GND / VDD net (beware unintentional ground loops & parallel PSUs)  
- Controller must support the Min Output Edge Separation time even if the mixer is fed slower than Max Input Bitrate input streams  
- For best performance:

    - Use 5.0V supply voltage  
    - Ensure stable electrical supply  
    - Keep the leads as short as possible, especially between the mixer and the controller  

# Performance assessment

Each sold unit is individually tested for error\-free processing of at least 1 Gib of data simultaneously streamed to both ABZ inputs of the mixer at the combined inputs' Max. Error-free Bitate at 3.3V.


[![Propagation delay figure @3.3V](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/3.3VPropDelay-03-small01.png "Propagation delay figure @3.3V")](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/3.3VPropDelay-03.png)

[![Propagation delay figure @5.0V](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/5.0VPropDelay-03-small01.png "Propagation delay figure @5.0V")](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/5.0VPropDelay-03.png)

[![Minimum output edge separation @3.3V](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/3.3VOutEdgeSeparation-03-small01.png "Minimum output edge separation @3.3V")](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/3.3VOutEdgeSeparation-03.png)

[![Signal unit test result sample @3.3V](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/3d3_sample_validation_test_result-003-small01.png "Signal unit test result sample")](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/3d3_sample_validation_test_result-003.png)

[![Signal unit test result sample @5.0V](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/5d0_sample_validation_test_result-002-small01.png "Signal unit test result sample")](https://github.com/RowdyNPC/ABZ_Mixer/raw/main/media/5d0_sample_validation_test_result-002.png)

# Extras

- Standalone mixer ICs (QFN package) + documentation available on request  
- Custom speed variants or engineering support: contact via message  


Shipping worldwide from Japan\*.  
*\*For the relevant destinations, import tariff is not included in the listed price of the goods*


Questions about:  
- Signals over differential pairs?  
- Higher/Lower speed variants?  
- I/O signals galvanic isolation?  
- Other?  

➡️ Message me!  
Happy to help with concerns regarding wiring, integration, or shipping.

THANK YOU! For supporting a small hardware maker! 🚀

## Shipping policy

Want an alternative shipping carrier?
Your shipping destination is not available?
Please message me.
