Skip to content

TMR3109 magnetic encoders: nine grippers with a collapsed range, and one magnet facing the wrong way ​

The grippers shared the same structure and 80° opening travel; the sensor shaft was expected to rotate about 40°. Yet across nine units, the measured span ranged from 2.6° to 25.1°—almost a tenfold difference. Even units on the same side could report opposite directions.

Assembly eccentricity was the first suspect, and a model could fit the readings. The eventual finding was different: the magnets had the wrong magnetization direction. This is an account of that batch, not a universal diagnosis for magnetic encoders.

How different were the nine units? ​

The bars show only the faulty batch’s measured spans. About 40° is the mechanical expectation, not a tenth measurement.

Unit123456789
Span (degrees)25.113.911.711.211.08.04.53.82.6

The data path had been checked: MCU serial output, shared memory, HTTP and the web page agreed. One 60-second recording contained 3012 frames, with no observed loss, spikes or obvious bit-error patterns. Those observations do not replace CRC/error validation, which cannot be claimed as verified here.

Why was a plausible model not enough? ​

A lateral-offset dipole model could fit the compressed span, suggesting roughly 1–2mm eccentricity—above the vendor’s 0.5mm limit. But that was an inferred model parameter, not a measured assembly dimension.

The same angle data can arise from different magnetic conditions. Inspection with the mechanical team and vendor confirmed axial magnetization where diametric magnetization was required. Replacing the magnet restored a span of about 40°. Physical inspection and the replacement result were stronger evidence than a good fit.

Same disc, different poles ​

TMR3109 measures field direction; it does not directly observe the mechanical part. The required diametric magnet has N and S on opposite sides across the disc. An axially magnetized disc instead has N and S on its two flat faces.

Diametric and axial magnetization

With an axial magnet centered above the chip, the rotating in-plane field component is weak, so residual effects from offset or wobble may dominate. This explains the batch’s small and inconsistent spans, but the shape of the readings alone cannot identify magnetization. Check incoming magnets against the specification, involving the supplier when needed.

A full revolution is not the same as full gripper travel. A correctly installed absolute encoder should cover a full circle during one complete revolution, wrapping at 0°/360°. The roughly 40° here refers only to the sensor shaft’s travel across this gripper’s operating range.

After replacing the magnet, what can calibration fix? ​

First establish a suitable field and installation; then calibrate repeatable residual nonlinearity. Two-point calibration joins the closed and open endpoints with a straight line. Nine-point calibration uses fixture positions at 0/5/…/40° and interpolates between adjacent samples. Neither can repair a disconnected sensor, missing magnet or unstable signal. A display reading of 40° is not proof that the physical span recovered.

Nine-point piecewise calibration illustration

The illustration explains interpolation; it is not per-unit calibration data from the nine machines. In the web UI, place the finger at a fixture stop, capture a two-second mean, and commit once all nine points are present and monotonic. Resampling a point overwrites it. Both datasets are retained; mode selects the active mapping. Committing nine points activates piecewise mapping, capturing open/closed endpoints activates two-point mapping, and nine-point mode can be reselected explicitly.

ReadingMeaning
Raw chip angleraw/8388608×360°, independent of calibration
Calibrated angleFixture angle from the active mapping, typically 0–40°
Opening percentageOpening fraction from the active mapping, for downstream algorithms
SpanEndpoint difference: span_raw or span_deg, still in chip units

Fixture angles were once written into closed_deg/open_deg/span_deg, making the displayed span look fixed at 40°. These fields were corrected to chip angles. That repaired the reporting convention, not the sensor.

Appendix: installation, SPI extraction and diagnosis
Installation itemProduct specification v1.0.1 §3.6
MagnetØ9 × 2.5mm, NdFeB N35SH, diametric magnetization
Air gap1–10mm, typical 3mm
Field at chip surface100–1000Gs; the product page instead lists 200–800Gs—confirm with the vendor
Center offset / tilt≤0.5mm / ≤±3°

SPI Mode 1, MSB first, carries a 28-bit response in a four-byte transfer: d[27:5] holds the 23-bit angle, d[4:1] the CRC (polynomial x⁴+x³+x²+1, initial value 0011), and d[0] the error bit. The example below extracts only the angle; it does not implement CRC/error validation.

c
rt_uint8_t tx[4] = {0x60, 0x00, 0x00, 0x00}, rx[4] = {0};
spi_xfer(s, tx, rx, 4);
uint32_t v = ((uint32_t)rx[0] << 24) | ((uint32_t)rx[1] << 16)
           | ((uint32_t)rx[2] << 8) | rx[3];
uint32_t raw = (v >> 5) & 0x7FFFFF;
float angle = raw / 8388608.0f * 360.0f;

A four-clock MISO pipeline delay was observed in this setup. The initial alignment error confined readings to 337.5°–360°. The >>5 extraction above follows the received byte layout in this session; check captured frames when porting rather than copying it blindly.

SymptomFirst checks
Pinned at 0x7FFFFF (359.99996°)Power, J57 connection and all-ones MISO; a value near 360° alone does not prove disconnection
Jumps hundreds of degrees within millisecondsMagnet presence, field and installation
Huge calibrated percentageWhether both endpoints were sampled at the same position; the project has a 2000-raw degenerate-span guard
Large stationary noiseA healthy unit measured std ≈0.001° (about 18 LSB); above 0.5°, inspect mechanics and field. Deduplicate by acquisition timestamp rather than understating noise with repeated HTTP samples
MSH tmr3109 assertionInitialize SPI with angle_init first

The interface uses /api/v1/angle/calib (GET/POST), with operations for point capture, commit, reset, mode selection and regression checks. Project implementations reside in MCU angle_sensor.c and sensor_acq.c, and AP angle_calib.go and angle_calib_http.go. These are internal project filenames, not public code download links.

Protocol and installation reference: the TMR3109 product specification v1.0.1 (§3.6, §4.1 and §8). This article preserves observations from the September 2026 gripper project. About 40° after replacement is the recorded result; no per-unit post-replacement accuracy table for all nine machines is provided.

Something unclear here, or want to talk about similar work?Message me →