Start closeloop error issue

I have to use a high-power motor.
So I prepared the product of the link below and it is being tested.
A12 (8318) Swiss Motor Brushless Outrunner … - AliExpress

And I set the AMT10E2-V encoder to 1280PPR and used it.

There are currently problems.
“MOTOR_ERROR_UNKNOWN_PHASE_ESTIMATE” occurs when rebooting after using “odrv0.axis0.config.startup_closed_loop_control = True”.

I’m looking for a solution to these two.

First of all, this is the log that I tested.
I first set the initial setting, saved the setting, and set the closed loop.
The same error occurred.
The closed loop was set immediately after the error was initialized and full calibration was performed.

=============================================================
Connected to ODrive 3677385D3030 as odrv0
In [1]: odrv0.erase_configuration()
Oh no odrv0 disappeared

Reconnected to ODrive 3677385D3030 as odrv0
In [2]: odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
…: odrv0.axis0.motor.config.current_lim = 60
…: odrv0.axis0.motor.config.calibration_current = 10
…: odrv0.axis0.motor.config.resistance_calib_max_voltage = 5
…: odrv0.axis0.motor.config.requested_current_range = odrv0.axis0.motor.config.current_lim + odrv0.axis0.motor.con
…: fig.current_lim_margin
…: odrv0.axis0.motor.config.pole_pairs = 20
…: odrv0.axis0.motor.config.torque_constant = 8.27 / 120
…: odrv0.axis0.motor.config.current_control_bandwidth = 100
…: odrv0.axis0.encoder.config.mode = ENCODER_MODE_INCREMENTAL
…: odrv0.axis0.encoder.config.use_index=True
…: odrv0.axis0.encoder.config.cpr = 1280 * 4
…: odrv0.axis0.encoder.config.bandwidth = 1000
…: odrv0.axis0.encoder.config.calib_scan_distance = 50
…: odrv0.axis0.controller.config.vel_limit = 20
…: odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
…: odrv0.config.enable_brake_resistor = True
…: odrv0.config.brake_resistance = 2.0
…: odrv0.config.dc_max_negative_current = -0.01

In [3]: odrv0.save_configuration()
Oh no odrv0 disappeared

Reconnected to ODrive 3677385D3030 as odrv0
In [4]: odrv0.reboot()
Oh no odrv0 disappeared

Reconnected to ODrive 3677385D3030 as odrv0
In [5]: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE

In [6]: odrv0.axis0.motor.config.pre_calibrated = True
…: odrv0.axis0.encoder.config.pre_calibrated = True
…:

In [7]: odrv0.save_configuration()
Oh no odrv0 disappeared

Reconnected to ODrive 3677385D3030 as odrv0
In [8]: dump_errors(odrv0)
system: no error
axis0
axis: no error
motor: no error
sensorless_estimator: no error
encoder: no error
controller: no error
axis1
axis: no error
motor: no error
sensorless_estimator: no error
encoder: no error
controller: no error

In [9]: odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL

In [10]: dump_errors(odrv0)
system: no error
axis0
axis: no error
motor: Error(s):
MOTOR_ERROR_UNKNOWN_PHASE_ESTIMATE
sensorless_estimator: no error
encoder: no error
controller: no error
axis1
axis: no error
motor: no error
sensorless_estimator: no error
encoder: no error
controller: no error

In [11]:

In [12]: odrv0.clear_errors()

In [13]: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE

In [14]: odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL

In [15]: dump_errors(odrv0)
system: no error
axis0
axis: no error
motor: no error
sensorless_estimator: no error
encoder: no error
controller: no error
axis1
axis: no error
motor: no error
sensorless_estimator: no error
encoder: no error
controller: no error

In [16]:

=============================================================

Can you check which values odrv0.axis0.motor.config.pre_calibrated and odrv0.axis0.encoder.config.pre_calibrated have after you restart the odrive? Are they still true?

Which encoder are you using? If you use an encoder with index signal, you still need to do an index search after startup

Yes. It’s true even if reboot.
The encoder uses AMT10E2-V buy at odrive store.
The encoder has an index.
There is a problem with or without the index.
I need the exact speed of rotation, not the exact location.
So, no need for an index.
Initialize without rotate at boot time and rotate when rotation is required.
I could do the same thing with a hover motor.
However, using the A12 motor and the AMT10E2-V encoder caused problems.
What should I do?
Give them a hand. Thank you.

Then you have to do an index search in the beginning. The index is not used to give you an exact location. The index is used so that you don’t have to calibrate the motor after each reboot.

What you should do is the following:

odrv0.axis0.encoder.config.use_index = True
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis0.motor.config.pre_calibrated = True
odrv0.axis0.encoder.config.pre_calibrated = True
odrv0.save_configuration()

Now the odrive will reboot. Now type following lines

odrv0.axis0.requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
dump_errors(odrv0)

It shouldn’t given you any errors. Can you check if it works?

But you still need to do the Index Search every time you reboot. You can automatically do it at startup though. By setting the following:

odrv0.axis0.config.startup_encoder_index_search=True

Thank you for your reply and interest.
I tested what you said.
It operates without any errors.
However, the motor moves to find the index and becomes in a closed loop.
For safety reasons, my equipment must not rotate until it is in a closed loop.
I suspect that what I’m suspicious of now is a characteristic caused by the type of encoder.
Should I use absolute encoder?

To achieve startup without any motion you require an absolute encoder, yes.

2 Likes

I was right. Thank you for your answer.