we want to use bldc drivers with a robot arm. So when the driver is started the first time there will already be load/torque on the driver.
Can the odrive start immediately without any initialization,…with an encoder with index?
Is there the need to turn at least until the index is reached and is this movement possible without any hall sensor information?
I have read that you were planing to implement that feature.
There are quite a few people with the exact same use-case and question. The feature to handle this is planned and not yet implemented. I can write down the steps on how we plan to do this, in case anyone here wishes to implement this themselves (to make it happen faster ).
Index pulse encoder reset feature
We need a simple interrupt service routine that responds to the index pulse and when fired:
- resets the encoder register to 0
- sets a “index found” variable
- turns off
- disables the interrupt.
This feature should start disabled at power-on.
During commissioning of the drive, you would use the axis without load, or tilt the assembly such that there is no gravity load. Either:
- Activate index pulse reset, spin motor by hand until it is found.
- Calibrate motor, after calibration activate index pulse reset, enable motor, and then spin the motor: It will by virtue of the
enable_motor turn-off in the index pulse IRQ, be automatically de-energized when the index is found.
Then run motor calibration (again), with a properly zeroed encoder. This will yield a value for
encoder_offset. Read out this value (over USB, or UART, etc). Write the value to
encoder_offset in the code, recompile and flash.
Startup against gravity
We activate the index reset IRQ. We then have two options:
- Rotate the axis by hand until index is found.
- Use “lock-in drive”, which is to slowly rotate a large current (probably the continous current rating of the motor) in the direction pre-defined to be against gravity. This is very inefficient, but should be able to move the axis. This drive-mode should quit when the
enable_motor disables from the IRQ. If we don’t want the axis to drop to the mechanical stop at this point we could jump straight into normal control.
@aksatshah Are you working on this? Or not yet?
Thank you for the reply. I have not yet ordered one of your drives. But this sounds interesting and I will give it a try.
Hello, are there any updates on how to do this? I have a gantry with the y axis going against gravity.
See “Encoder with Index Signal” here Encoders | ODrive
You’re my hero Wetmelon, I love you. One problem I have, the motors are trying to calibrate in the wrong direction. I saw the " Reversing index search" section, and after changing the three values it mentions it no longer tries to calibrate in the wrong direction, but it also doesn’t calibrate in the correct direction, it just sits there doing nothing. Any ideas?