Unable to Reverse Index search direction

odrv0.axis0.config.calibration_lockin.vel=-40
odrv0.axis0.config.calibration_lockin.accel=-20
odrv0.axis0.config.calibration_lockin.ramp_distance=-3.14
I have tried plugging in these values to reverse the index search direction however instead of reversing the direction the index search just doesnt take place in any direction at all

Only set the velocity negative, not the distance and such (I think)

Only the acceleration seemed to be what we needed to change

1 Like

I have been trying to perform a vibratory motion with my odrive motor , while it does the job alright i have to introduce sleep timers to allow the hardware to catch up with the code
for i in range(0,10):
…: odrv0.axis0.controller.input_pos=x-0.05
…: time.sleep(0.2)
…: if odrv0.axis0.encoder.pos_estimate>-0.1555 and odrv0.axis0.encoder.pos_estimate<-0.14:
…: print(“y”)
…: odrv0.axis0.controller.input_pos=x+0.05
…: time.sleep(0.1)
for reference i have to manually check whether it has reached a certain position and without the sleep timer my arm would never move and hence never enter the “IF” loop
is there any odrive command which would allow me to directly check if the motor axis has reached a certain index and thus allow me to bypass the sleep delays
PS the time constraint is severe and we must perform the task in about 800-1000 ms which will not be possible when each iteration of the loop potentially consumes 300ms

I was wondering if general_lockin parameters would help since it has a finish on encoder index command
Although not sure what it’s config parameters really mean (numerator , denominator ratio etc)

You can use INPUT_MODE_TUNING to generate sine waves for tuning purposes :slight_smile:

I’m confused is it an option under odrivetool like
Odrv.axis.input_mode_tuning
Also how do I use the finish on encoder index search command it be really helpful for my case if I can directly just begun the next task after the first operation

odrv0.axis0.controller.config.input_mode = INPUT_MODE_TUNING then you set controller.autotuning values accordingly. Put the motor in position, velocity, or torque mode as appropriate.

thanks a lot for the input will try it out

i happened to go through some of the patch notes and also noticed that if using INPUT_MODE_TUNING after say my axis is already in close loop control my axis returns to the original index point 0 and disables close loop control
Any way i can change this functionality to just stay in whatever position i had enter in controller.input_pos without reverting back to the original setpoint , tried looking at the controller.cpp case for input mode wasnt sure how to do it

Erm, actually let me see … I’m not sure if we have an offset implemented.

Update: We do not. But it’s a great idea, so I made a Pull Request with the change: Add input_xxx to the setpoints for autotuning by Wetmelon · Pull Request #645 · odriverobotics/ODrive · GitHub

thank you very much , i really appreciate it