I am trying to use a skateboard motor, but when trying to spin up the motor in AXIS_STATE_CLOSED_LOOP_CONTROL:
In [550]: odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
In [551]: odrv0.axis0.controller.config.control_mode=CONTROL_MODE_VELOCITY_CONTROL
In [553]: odrv0.axis0.controller.input_vel = 50
…it immediately goes into an error:
axis0
axis: Error(s):
AXIS_ERROR_BRAKE_RESISTOR_DISARMED
AXIS_ERROR_MOTOR_DISARMED
motor: Error(s):
MOTOR_ERROR_DC_BUS_OVER_CURRENT
fet_thermistor: no error
motor_thermistor: no error
encoder: no error
controller: no error
What I don’t understand is that when I set odrv0.axis0.requested_state = AXIS_STATE_LOCKIN_SPIN:
In [562]: odrv0.axis0.config.general_lockin.vel = 2000
In [563]: odrv0.axis0.config.general_lockin.accel = 600
In [560]: odrv0.axis0.requested_state = AXIS_STATE_LOCKIN_SPIN
…the motor spins up fine and stays at the requested velocity - no overcurrent error in this case.
Here is the controller config. Anything you see wrong with it?
In [555]: odrv0.axis0.controller.config
Out[555]:
gain_scheduling_width = 10.0 (float)
enable_vel_limit = True (bool)
enable_current_mode_vel_limit = True (bool)
enable_gain_scheduling = False (bool)
enable_overspeed_error = True (bool)
control_mode = 2 (int)
input_mode = 1 (int)
pos_gain = 20.0 (float)
vel_gain = 0.1666666716337204 (float)
vel_integrator_gain = 0.3333333432674408 (float)
vel_limit = 2000.0 (float)
vel_limit_tolerance = 1.2000000476837158 (float)
vel_ramp_rate = 0.5 (float)
torque_ramp_rate = 0.009999999776482582 (float)
circular_setpoints = False (bool)
circular_setpoint_range = 1.0 (float)
homing_speed = 0.25 (float)
inertia = 0.0 (float)
axis_to_mirror = 255 (int)
mirror_ratio = 1.0 (float)
load_encoder_axis = 0 (int)
input_filter_bandwidth = 2.0 (float)
anticogging:
index = 0 (int)
pre_calibrated = False (bool)
calib_anticogging = False (bool)
calib_pos_threshold = 1.0 (float)
calib_vel_threshold = 1.0 (float)
cogging_ratio = 1.0 (float)
anticogging_enabled = True (bool)