Set the first position

Hi everyone !!
I have a problem with set the first position. Which method to run motor without run AXIS STATE FULL CALIBRATION SEQUENCE, just run AXIS STATE CLOSED LOOP CONTROL after that run move_to_pos.
(Because i want to set my first position, but when run AXIS STATE FULL CALIBRATION SEQUENCE then the first position is changed (have a error with my target first position)
How to solve this problem? (Set the first position)

Thank you a lot !!

I’m not 100% i understand your question but I think this may help.

Assuming you are using the AMT 102-V

The odrive has to find the index pulse before it can enter AXIS STATE CLOSED LOOP CONTROL. When you run calibration, the motor is finding the index pulse.

If you don’t want to calibrate the motor on boot up every time, consider using an absolute encoder such as the AS5047p

Greetings @Vinh_Nguy_n - I think what you’re asking may be similar to something I learned when I started tinkering with my ODrives: the linear position (whatever the current setpoint is) is not zeroed when you run through calibration.

(and it doesn’t need to be, just an observation).

In my python test programs, I do the following before I switch to CLOSED_LOOP_CONTROL:

    self.odrv.axis0.encoder.set_linear_count(0)

Now when you move to CLOSED_LOOP_CONTROL you can set your target positions relative to 0. In reality this is not necessary, you could just read where you are now when you go closed loop and base all your movements relative to that position.

In my application I ended up adding a ‘Z’ command to the ASCII protocol to set the linear count so that I could have encoder position (0.0) correspond to my limit switches.

(or, maybe I didn’t actually answer your question?)

/Mitch.