Position control sets motor error 0x1000 for one direction only

I am running a D6374 motor on a 48v Odrive 3.5 with RazorsEdge firmware. I am using the AMT 102 encoder with 8192 ppr. The motor runs nice in velocity mode in both directions.

In position mode, the motor runs perfect in positive direction. Going from 0 to 10000 degrees is problem free. When I set it to go from 10.000 degrees to 0 degress the motor spins up and all of a sudden it accelerates too much and sets error 0x1000 (ERROR_CURRENT_UNSTABLE) on motor.
There is no problem going from -10000 degrees to 0 so it is not the position that causes this, it is the rotation direction.

I have tried switching two of the phases and flipped the encoder, but with no luck. I have tried two different input modes, INPUT_MODE_TRAP_TRAJ, INPUT_MODE_VEL_RAMP, both with same result.

edit: Does anybody know what’s going on?

Yay! Well, at least that error check works lol.

That’s really strange that it’s only working in one direction. Nobody using RazorsEdge has reported that issue before. Typically this behaviour is caused by noise on the encoder lines or mechanical slippage.

Yay! Yes, something works :smiley:
I don’t think I would say that the error check works. Why would “ERROR_CURRENT_UNSTABLE” be caused by noise on the encoder lines or mechanical slippage?

The encoder is screwd and taped to the motor housing. I also get this error message (both directions) if I change the setpoint to 0counts while the motor is moving quite fast towards 1M counts. It’s like it does not decelerate to zero velocity before it accelerates in negative direction. Sometimes it just gives the error message before even trying…

Do I need a better power supply?

My (temporary) solution to this problem is to run the motor in input mode “INPUT_MODE_PASSTHROUGH”. I am not able to set the acceleration with this mode, but that’s OK for now.

PS: I am very impressed by the performance of the drive/motor! wow, just wow :exploding_head:

Because if that happens, the current controller fails and loses control of the current in the motor, sending it beyond motor.current_limit. When that happens, we shut the ODrive down to prevent damage.

Does this happen even in PASSTHROUGH mode?

Can you graph motor.current_control.Iq_setpoint vs motor.current_control.Iq_measured and try to reproduce the problem please?