Both motors are out of sync in velocity, please help, please let me know what am I missing
I am using the odrive for building a robot with hub wheels as a differential drive robot.
I need both wheels to be running exactly at the same velocity for it to go in a straight line
The config.cpr is set at 90 for a 15 pole pair hub motors, this wheels are from a hoverboard
I am able to drive both the wheels using the 48v odrive controller
axis0.controller.vel_setpoint = 270
axis1.controller.vel_setpoint = 270
but the wheels are turning at different velocities and it is making my robot turn or twist instead of going in a straight line
I issue a drive command and here is the output
Driving at velocities, left 270, right 270
OdriveBus voltage: 25.3953
left error0: 0
right error1: 0
left state0: 8
right state1: 8
left cpr pos0: 29.1738
right cpr pos1: 27.9142
left velocity0: 101.25
right velocity1: 81
left config cpr: 90
right config cpr: 90
left curr0b: -0.030012
left curr0c: -0.0639999
right curr1b: -0.204814
right curr1c: -0.10667
left temp0: 34.2053
right temp1: 31.6064
How to make both the wheels turn at the same velocity, it is very important for me to make the robot go in straight line, but it is drastically out of sync
left velocity0: 101.25
right velocity1: 81
I checked the inductance and resistance of the both the wheels it seems to be slightly different, does it matter?
In [1]: odrv0.axis0.motor.config
Out[1]:
pre_calibrated = True (bool)
pole_pairs = 15 (int)
calibration_current = 10.0 (float)
resistance_calib_max_voltage = 4.0 (float)
phase_inductance = 0.0004774605040438473 (float)
phase_resistance = 0.1966893970966339 (float)
direction = -1 (int)
motor_type = 0 (int)
current_lim = 20.0 (float)
current_lim_tolerance = 1.25 (float)
inverter_temp_limit_lower = 100.0 (float)
inverter_temp_limit_upper = 120.0 (float)
requested_current_range = 25.0 (float)
current_control_bandwidth = 1000.0 (float)
In [2]: odrv0.axis1.motor.config
Out[2]:
pre_calibrated = True (bool)
pole_pairs = 15 (int)
calibration_current = 10.0 (float)
resistance_calib_max_voltage = 4.0 (float)
phase_inductance = 0.0004224381991662085 (float)
phase_resistance = 0.1820838749408722 (float)
direction = -1 (int)
motor_type = 0 (int)
current_lim = 20.0 (float)
current_lim_tolerance = 1.25 (float)
inverter_temp_limit_lower = 100.0 (float)
inverter_temp_limit_upper = 120.0 (float)
requested_current_range = 25.0 (float)
current_control_bandwidth = 1000.0 (float)
How to put both motors run at the same velocity, I am giving both motors same vel_setpoint values
Thanks a lot for your help