ProcedureResult.TIMEOUT during ENCODER_OFFSET_CALIBRATION

TL;DR

When performing encoder calibration the motor does not spin (it does twitch though) and a TIMEOUT error is raised.

Full story

Motor: T-Motor GB2208 [Gimbal motor]
KV: 128 [data sheet]
Pole Pairs: 7 [12N14P]
Phase resistance: 13.6 [measured]
Phase inductance: - [unknown…]

Encoder: AS5048B

Scenario

  • Power supply is configured - max/min voltages and currents set.

  • Motor is not automatically configured since its a gimbal motor, following code:

odrv0.axis0.config.motor.motor_type= MOTOR_TYPE_GIMBAL
odrv0.axis0.config.motor.pole_pairs= 7
odrv0.axis0.config.motor.torque_constant= 8.27 / 128 # Datasheet
odrv0.axis0.config.motor.phase_resistance= 13.6 # Measured
odrv0.axis0.config.motor.phase_resistance_valid= True
odrv0.save_configuration()

The motor can be spun using LockIn Spin

  • Encoder is wired properly and set up as follows
odrv0.spi_encoder0.config.mode = SpiEncoderMode.AMS
odrv0.spi_encoder0.config.ncs_gpio = 17 # Pin 7 on J14 (MISC IO)
odrv0.axis0.config.load_encoder = EncoderId.SPI_ENCODER0
odrv0.axis0.config.commutation_encoder = EncoderId.SPI_ENCODER0

The encoder generates values which can be seen in the odrivetool

ENCODER_OFFSET_CALIBRATION

During encoder offset calibration the motor locks into a specific position, it doesn’t move after this.

The green light flashes for approximately 2 seconds, current draw increases exponentially but never exceeds 1A and never comes close to the supply or board limits.

The green light stops flashing and returns to pale blue.
Current drops back to base line, the motor is not longer locked.

Error dump:

  active_errors: no error
  disarm_reason: no error
  procedure_result: ProcedureResult.TIMEOUT
  last_drv_fault: none
  internal issues: none
2 Likes

Hi there. I am having the same issue. Did you manage to solve this?

Thank you,
Adarsh

I am facing the same issue. Anyone worked out what the issue is? I have a very similar setup with SPI encoder and Tmotor.

I can see the position reading and velocity reading in the inspector. I can drive it with lockin spin but when I try encoder offset it twitches briefly then timesout.

For anyone that comes across the same issue, it was not actually encoder related but because my lockin calibration current was set too high. I lowered it to 10A and that resolved it.

I had the calibration current set to 15A and because the phase resistance was high and my bus voltage was only 16.3v It wasn’t able to reach the set lockin current and timed out.

@solomondg
"
The AS5048A is a red herring

Basically - when entering encoder offset calibration, it does a lock-in spin on the motor, right? But it slowly ramps up current to the motor first, so that it doesn’t jerk super hard

Your phase resistance is high enough and bus voltage is low enough that it couldn’t actually reach the 15A configured for the calibration lock-in (edited)

So it was timing out waiting for the current to reach the setpoint
"