ODESC v4.2 (odrive 0.5.6) sensorless mode issue

Hello, help needed.
Trying to test a motor : A2212, 7 poles, 2700KV(ali)
XXD A2212 2700KV brushless outrunner motor:
Rpm/V: 2700KV
Net Weight: 50g
Weight: 60g
Motor Dimensions: 27*26mm
Battery Opernating: 2-3 Lipo
Idle current: 1.8A
Load current: 18.5A
Power (Watt): 240
ESC(A): 30A,20A
Peak.Amps :14-22 A

ODESC 4.2 and odrivetool 0.6.5

was able to calibrate the motor (after some headaches), but once i run the motor, its doesnt do a good job.
found this vid https://www.youtube.com/watch?v=qf-7ovBZ1Kk
tried the same config (with my max current parameter), but without a luck (

firstly: odrive doc

(Setting up Sensorless

The ODrive can run without encoder/hall feedback, but there is a minimum speed, usually around a few hundred RPM. In other words, sensorless mode does not support stopping or changing direction!)

says that in sensorless mode you cant stop or change direction of the rotation: vid shows the opposite. also it rotates slowly (which is good for me).

it starts the rotation which look ok, then i’m trying to stop it, works too, but changing direction, or start again stops the motor with an error: MotorError.CURRENT_LIMIT_VIOLATION
set current_lim to 30, same thing. changing the speed drastically stops the motor with current error too, if i increase the speed by one each time, goes well.

trying to tweak the controller.config.vel_gain, but cannot figure out the right value.

i think i have written too many issues at once, but i think they are somehow related.
im using this motor for test and learning

big thanks in advance!!!

update:
still cannot get the reason for this issue, but my guess is some tweaks should be made because of the impedance of this motor.
I used two bigger motors
6015 300kv and 5210 180kv, both worked good.
now i want to understand why the 2700kv is not working the same.

any ideas?!

Hi! The ODESC is a clone of the ODrive v3, and is based on a previous version, such as the v3.4 or v3.5, which have significant signal integrity issues. As sensorless control requires a high degree of precision in the motor driver, I would generally not expect good performance here. If you require sensorless control, I’d recommend switching to the ODrive S1.

firstly thanks for your reply.
second its a clone yes, chinese one from v3.6
BUT, as i updated, i have successfully controlled the bigger (less kv) motors.
But I still do have two problems:
For some reason A and B outputs of the encoder are super noisy, and yet some how odecs is able to read them (trying to understand why. my guess is the encoder assembly is bad) and second WHY is the smaller motor behave weirdly…

As for S1, its price is higher (yes, i know that i pay for better quality), dont need such quality right now. Price is matter is this project.
I have googled and find out that a lot of ppl use this controller without problems (or at least they didnt mentioned them).
So i still want to find the way to work this out. Help is welcomed )

thanks again

Hello

Can you show a picture or image of your setup and the setting you entered?

Kind regards

Stijn

Fully understood! Unfortunately those clones have a lot of changes and a lot of things wrong with them, so we cannot support them. You likely have to tune your PID gains, especially for smaller motors like those.

Hey, im sure its not perfect, but i see tons of project are built on it. and they have no problems (at least they are not mentioned them). im pretty sure that im missing something in the settings.

Ok, here is my update:
Im able to run in the velocity mode. both directions, changing speed. looks ok (didnt check the torque)

But there super weird is happening in position mode.
Firstly i set plotter to output dev0.axis0.encoder.vel_estimate, dev0.axis0.controller.input_vel and always getting x2.5-x3 difference. checked 5 times the CPR setting and encoder switches (2048 Off Off Off). otherwise encoder cannot pass the calibration.
Pole_pairs are right too, count 22 magnets → 11 pole pairs.

tried to play with gains, getting two results: or it jumps to current limit, or jitters without moving. using deepseek and friends im getting that the problem is probably high pos gain. lowered it to 0.1 not helped. also played with torque constant: from 8.27 to super low as shown in one vid: dev0.axis0.controller.config.vel_gain = 0.02 * dev0.axis0.motor.config.torque_constant * dev0.axis0.encoder.config.cpr which is definitely very low. jumps to current limit straight.

here are all of my settings:

dev0.config.enable_brake_resistor = True
dev0.config.dc_max_negative_current = -2
dev0.config.dc_max_positive_current = 20
dev0.config.max_regen_current = 0

dev0.axis0.motor.config.current_lim = 40
dev0.axis0.motor.config.current_lim_margin = 5
dev0.axis0.motor.config.calibration_current = 8
dev0.axis0.motor.config.pole_pairs = 11
dev0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
dev0.axis0.controller.config.vel_limit = 10
dev0.axis0.motor.config.resistance_calib_max_voltage = 2
dev0.axis0.motor.config.requested_current_range = 60
dev0.axis0.motor.config.torque_constant = 8.27 / 340
dev0.axis0.motor.config.current_control_bandwidth = 100

dev0.axis0.sensorless_estimator.config.pm_flux_linkage = 5.51328895422 / (11 * 340) 

dev0.axis0.controller.config.vel_gain = 0.02 * dev0.axis0.motor.config.torque_constant * dev0.axis0.encoder.config.cpr
dev0.axis0.controller.config.vel_integrator_gain = 0.1 * dev0.axis0.motor.config.torque_constant * dev0.axis0.encoder.config.cpr
dev0.axis0.controller.config.pos_gain = 1

dev0.axis0.encoder.config.bandwidth = 100
dev0.axis0.encoder.config.calib_scan_distance = 100
dev0.axis0.encoder.config.calib_range = 50
dev0.axis0.controller.config.control_mode = CONTROL_MODE_POSITION_CONTROL

dev0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
dev0.axis0.motor.config.pre_calibrated = True
dev0.axis0.encoder.config.pre_calibrated = True```

Please help! im getting nuts. two weeks trying to achieve what others do in 3 mins. 
have three motors to test: 
small A2212 2700KV, 5210 340kv, 6215  kv170

please please please!!! 

can add a photo of the  setup if needed.

whats more weird, that the encoder calibration works well, the motor rotates slowly and steady, but after this using my parameters, nothing moves… only shakes…
how can i find the motor config parameters for encoder calibration?
opened the source code, not simple one.