Endstop ghost-triggered by call to encoder.pos_estimate

Hi all!

I am using a 56V ODrive v3.6 to run two T-Motor U13s, with firmware v0.5.1.

I am experiencing an issue where calls to axis.encoder.pos_estimate while moving to a position setpoint (in closed loop control) will “ghost” trigger the min endstop, bringing everything to a grinding halt… I’m wanting to log the actual position of the axes as I go, hence the need to call pos_estimate while moving around. Your assistance in finding what may cause this and how to fix it would be most appreciated!

For clarity, everything works perfectly the rest of the time. But on axis 0, retrieving the position will sporadically trigger the minimum endstop. There is no issue when just calling foo = axis.encoder. In addition, calls to the other axis’ pos_estimate (axis1, that is), run without issue.

In case it is of use, the affected endstop is a small lever limit switch, and its config is as follows:

  • gpio_num = 5 (int)
  • enabled = True (bool)
  • offset = 10.0 (float)
  • is_active_high = True (bool)
  • pullup = True (bool)
  • debounce_ms = 50 (int)

Thanks so much for your time!

:thinking: that’s weird. Have you tried to update to 0.5.2?

I haven’t no. To be honest I’m a bit afraid to, though in fairness I see there are several low-level changes to the GPIO setup in the update, so this may be addressed there.

Oh I also thought it worth mentioning, I’ve tried swapping the switches around and have concluded that the issue is pin 5 - not necessarily the axis 0 min endstop.

I will give the update to 0.5.2 a try and get back to you

@Wetmelon am still getting this after upgrading to v0.5.2

1 Like