I’m trying to read temperature with integrated thermistor inside my hub motor.
After connecting the thermistor with voltage divider pcb and setting up thermistor gpio pin to 3 and thermistor coefficients, the temperature still reads NAN (with no errors).
Reading the analog pin 3 with
odrv0.get_adc_voltage(3) gives me 0.19V. The value is changing as I spin the motor. The motor can’t be controlled when motor thermistor is enabled (because of the NAN value?)
Am I missing something?
Can you post your thermistor config?
0.19V seems much too low. What is the schematic of your voltage divider PCB?
I’ve changed the load resistor from 3.3K to 15k.
Now I’m reading bit higher voltage around 0.69V on pin 3.
set_motor_thermistor_coeffs(odrv0.axis0, 15000, 50000, 4050, -10, 120)
My config looks like this:
In : odrv0.axis0.motor_thermistor
poly_coefficient_0 = 305.4586486816406 (float)
poly_coefficient_2 = 271.838134765625 (float)
poly_coefficient_1 = -403.162109375 (float)
temp_limit_upper = 120.0 (float)
enabled = True (bool)
gpio_pin = 3 (int)
temp_limit_lower = 100.0 (float)
poly_coefficient_3 = -19.676620483398438 (float)
temperature = nan (float)
error = 0x0000 (int)
For the PCB I’m using this reference schematics from docs:
The R_load is now 15K, the thermistor is 50K@25°C and the cap is 0.33uF
How are you calculating those coefficients?
set_motor_thermistor_coeffs(odrv0.axis0, 15000, 50000, 4050, -10, 120) command
Looking at the code I think this feature broke with this commit. I will take a look this weekend to fix it.
Looking forward to the fix
Also looking for an update if this issue is resolved
I looked into it. And this works for me on the currently released firmware and tool (version 5.1.1). Could you share your wiring diagrams?
@rowanG thanks for the update. I’m just diving into this and wanted to see if we could implement this on the odrive or if it should be done on another micro controller . I believe @killko had the original issue.
Last I checked (just before christmas), the motor thermistor code is working.