Motor_thermistor.temperature always NaN despite valid ADC on GPIO1 (fw 0.6.11)

Summary

motor_thermistor.temperature always reads nan on the ODrive Micro (fw 0.6.11), regardless of configuration. The external 10K NTC thermistor is wired correctly to the THERMISTOR+/- pins and the ADC reads a valid, stable voltage via get_adc_voltage(1).

This appears to be a firmware bug in the internal decode_pin() function — no gpio_pin value (0–15, or special values 255/256/257) maps GPIO1 to the thermistor ADC channel.

Hardware

  • ODrive Micro, fw 0.6.11
  • External 10K NTC thermistor (beta 3950) wired to THERMISTOR+/THERMISTOR- header pins
  • Motor: DM-S-6015 (14pp gimbal motor)

What works

odrv0.get_adc_voltage(1)          # Returns ~2.95V (stable, valid)
odrv0.thermistor0                  # Returns ~39°C (board temp, works)
odrv0.axis0.motor.fet_thermistor.temperature  # Returns ~37°C (works)

With the 1kΩ internal pullup on the Micro’s THERMISTOR+ pin, the ADC voltage is consistent with a 10K NTC at room temperature:

import math
v = odrv0.get_adc_voltage(1)       # 2.95V
r_ntc = 1000.0 * v / (3.3 - v)     # ~8400 ohm
temp = 1.0 / (1.0/298.15 + (1.0/3950.0) * math.log(r_ntc / 10000.0)) - 273.15
# Returns ~28.3°C — correct room temp

What doesn’t work

odrv0.axis0.motor.motor_thermistor.temperature  # Always nan

Current config (saved to flash)

motor_thermistor.config:
  enabled: True
  gpio_pin: 1
  mode: 0 (Beta model)
  r_ref: 10000.0
  beta: 3950.0
  t_ref: 25.0
  temp_limit_lower: 100.0
  temp_limit_upper: 120.0
  temperature: nan  <-- BUG

What I’ve tried

Every combination of:

  • gpio_pin: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 255, 256, 257
  • mode: 0 (Beta), 1 (Steinhart-Hart)
  • r_ref: 3300, 4700, 10000, 47000, 100000
  • enabled: True
  • Save + reboot after each change
  • Full erase_configuration + reconfigure from scratch

Result: always nan, regardless of settings.

The ADC path (get_adc_voltage(1)) works fine through every test, confirming the hardware is correct. The thermistor module’s internal pin-to-ADC mapping appears broken on the Micro.

Workaround

Reading get_adc_voltage(1) directly and computing temperature in the host application works, but this bypasses the firmware’s thermal protection (temp_limit_lower/upper have no effect).

Request

Is there a known working gpio_pin value for the THERMISTOR+ pin on the Micro? Or is this a confirmed firmware bug? Since the v0.6.x firmware is closed-source, a community fix isn’t possible — this would need a firmware update from ODrive.

Testing this on my desk right now w/ a Micro (board revision A2), firmware v0.6.11-1, freshly erased, powered over USB.

Only connections is a 10k 3590B NTC thermistor connected between THERMISTOR+/THERMISTOR- on the J1 header (the 12-pin).

Configuration:

odrv0.axis0.motor.motor_thermistor.config.r_ref = 10000
odrv0.axis0.motor.motor_thermistor.config.t_ref = 25
odrv0.axis0.motor.motor_thermistor.config.beta = 3590
odrv0.axis0.motor.motor_thermistor.config.mode = ThermistorMode.NTC
odrv0.axis0.motor.motor_thermistor.config.gpio_pin = 1
odrv0.axis0.motor.motor_thermistor.config.enabled = True

then odrv0.save_configuration(), though it’s not strictly necessary:

Result is:

In [10]: odrv0.axis0.motor.motor_thermistor
Out[10]: 
config:
  a: 3.9082999229431152 (float)
  b: -0.0005774999735876918 (float)
  beta: 3590.0 (float)
  enabled: True (bool)
  gpio_pin: 1 (uint16)
  mode: 1 (uint8)
  r_ref: 10000.0 (float)
  t_ref: 25.0 (float)
  temp_limit_lower: 100.0 (float)
  temp_limit_upper: 120.0 (float)
temperature: 30.833251953125 (float)

Looking at your config, you set the motor_thermistor.config.mode to 0, but this is actually undefined – NTC (beta) mode is 1, see the enum here: ODrive API Reference — ODrive Documentation 0.6.11 documentation – you can use ThermistorMode.NTC as shorthand, if that helps. If I set the value of mode to 0, like in your config, I also get the temperature as NaN, so I’d definitely bet that’s the culprit here. It should be set as 1/NTC mode by default – I’m curious if you can share where you found the mapping of 0==NTC? Just making sure we don’t have any out of date docs/info anywhere!

Let me know if that solves the issue!