Hi
I was wondering if it is possible to set the rotation direction for the startup procedures and if so, how?
Cheers
Carelsbergh Stijn
Hi
I was wondering if it is possible to set the rotation direction for the startup procedures and if so, how?
Cheers
Carelsbergh Stijn
Hi Stijn!
Funny, I have the same question. Why? Before I will start my motion platform, the weight of the platform will move the actuators to the internal hardware stop. When switching on the Odrive, the startup precedure will turn the motors in the direction that the cylinder rod will be retracted - but it is still on the hardware-stop . The solution could be to start turning the motors in the opposite direction first.
I am eager to the answers you will get!
Kind regards Peter
Hi
For me, it’s the same application.
Cheers
Carelsbergh Stijn
If you wish to scan for the index pulse in the other direction (if for example your axis usually starts close to a hard-stop), you can set a negative value in
<axis>.encoder.config.idx_search_speed
.
Source:
Hi Robin,
thank you for your hint!
I was able to change the direction, but nevertheless, during the startup process, one time the motor is going further back than the starting point.
I tryed to change this with the: .encoder.config.offset = xxx command. But after a reboot the setting is gone. Dont know whether this is a bug in the firmware? Maybe its the completely wrong command to influence this ?
kind regards
Peter
Switch your phase wires around.
Also, make sure there is no load on the motor when calibrating the offset (like a load that drives the carriage back to the endstops)
I solved this by changing the parameter “motor.config.direction”.
I set “1” to go forward, “-1” to go reverse.
Don’t change this motor direction variable, it is not the right way to do it. The correct way is what @Robin said with the negative search speed.
It seems that idx_search_speed was removed from the codebase. What is the correct way to change the motor calibration direction now?
A year later, but for anyone else wondering as of April 2021, the following was taken from Encoders | ODrive
Sometimes you would like the index search to only happen in a particular direction (the reverse of the default). Instead of swapping the motor leads, you can ensure that the following three values are negative:
<axis0>.config.calibration_lockin.vel
<axis0>.config.calibration_lockin.accel
<axis0>.config.calibration_lockin.ramp_distance
I tried reversing these three parameters however when I performed the index search the motor didnt rotate at all anything I could do to solve this issue
Did the motor calibration work?
Normally yes it does however reversing the calibration lock-in parameters causes the problem
I don’t understand what you mean.
What the manual states does not work, the motor will not move at all
Reversing index search
Sometimes you would like the index search to only happen in a particular direction (the reverse of the default). Instead of swapping the motor leads, you can ensure that the following three values are negative:
<axis0>.config.calibration_lockin.vel
<axis0>.config.calibration_lockin.accel
<axis0>.config.calibration_lockin.ramp_distance
What works is making only <axis0>.config.calibration_lockin.accel
negative, and leaving the others positive (Firmware 0.56)
Hi @jochenalt. I just tried out your instructions, but it doesn’t seem to be working for me.
I’ve tried to set ONLY <axis0>.config.calibration_lockin.accel
to be negative, but that doesn’t change the direction.
I’ve also tried setting all three calibration_lockin
to be negative, but that does nothing either.
I’ve also tried setting <axis0>.config.motor.direction
to -1, but then the motor won’t run.
I’ve also tried change the A and B pins on the encoder, but no luck.
Do you have any other suggestions on how to change the calibration direction or even change the direction completely?
Maybe you have a suggestion as well @Wetmelon?
Hi Holger, the above ( <axis0>.config.calibration_lockin.accel
) only changes the direction of the index search after startup, it does not affect the general direction of the motor. That is determined during the calibration procedure. Although swaping the A and B encoder pin should do that, very weird that this has no effect in your setting. Unfortunately I am not aware of a property that can reverse the direction in general.
Thanks for the quick answer. I’m very new to ODrives, so I apologize in advance if my questions seem silly.
When you say that the accel
only changes the direction of the index search after startup, what do you mean? That it only changes the direction when running the full calibration sequence? Do you just put a minus in front of whatever is the default value? Should use_index_gpio
(ODrive Reference — ODrive Pro Documentation 0.6.5 documentation) be true as well?
Just to be clear, swapping the A and B encoder pin means to put wires the other way around in the following pins:
Right?
Should changing the wires change the motor direction ONLY in the calibration sequence or should that be a general change?
Hi Holger,
The calibration happens just once, the index search has to happen evertime you startup the motor. The above does not affect the calibration sequence, only the startup, it happens when you say .requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH.
You can also set a property to search the encoder’s index position automatically.
The encoder should be connected to A,B,Z on the PCB. I only know the 0.55 firmware with the odrive 3.6, it seems you are using the successor.
Best,
Jochen