After completing all the calibration steps for axis1 as similar to axis0 motor is still not responding to any commands, and control mode is not getting updated, it is fixed in position control mode, but not respoding to any position commands
full calibration sequence is working
closed loop control is holding the motor pretty well but any other control commands not getting executed
First of all i have configured the axis 0 motor thats why before starting the configuration i have not erased the configuration.
odrv0.axis1.motor.config.pole_pairs = 7
odrv0.axis1.motor.config.calibration_current = 15
odrv0.axis1.motor.config.motor_type = 0 # high current
odrv0.axis1.motor.config.resistance_calib_max_voltage = 4
odrv0.axis1.motor.config.torque_constant = (8.27/270)
odrv0.axis1.motor.config.current_lim = 40
odrv0.axis1.motor.config.calibration_current = 15
odrv0.axis1.motor.config.requested_current_range =60
odrv0.save_configuration()
odrv0.axis1.encoder.config.mode = 0 # incremental
odrv0.axis1.encoder.config.cpr = 8192
odrv0.axis1.encoder.config.bandwidth = 1000
odrv0.axis1.config.calibration_lockin.current = 10
odrv0.axis1.config.calibration_lockin.ramp_time = 0.4
odrv0.axis1.config.calibration_lockin.ramp_distance = 3.1415927410125732
odrv0.axis1.config.calibration_lockin.accel = 20
odrv0.axis1.config.calibration_lockin.vel = 40
odrv0.save_configuration()
odrv0.axis1.controller.config.control_mode = 3 #CONTROL_MODE_POSITION_CONTROL
odrv0.axis1.controller.config.vel_limit = 10
odrv0.axis1.controller.config.pos_gain = 13
odrv0.axis1.controller.config.vel_gain = 0.12
odrv0.axis1.controller.config.vel_integrator_gain = 0
odrv0.axis1.controller.config.input_mode = 5 # trap traj
odrv0.axis1.trap_traj.config.vel_limit = 10
odrv0.axis1.trap_traj.config.accel_limit = 2
odrv0.axis1.trap_traj.config.decel_limit = 2
odrv0.save_configuration()
odrv0.axis1.motor.is_calibrated # check first
odrv0.axis1.requested_state = 4 # AXIS_STATE_MOTOR_CALIBRATION
odrv0.axis1.motor.config.pre_calibrated = True
odrv0.axis1.requested_state = 6 #AXIS_STATE_ENCODER_INDEX_SEARCH
odrv0.axis1.requested_state = 7 # AXIS_STATE_ENCODER_OFFSET_CALIBRATION
odrv0.axis1.error # {this gave 0 as output}
odrv0.axis1.encoder.config.phase_offset # { this gave -4348}
odrv0.axis1.encoder.config.direction # (-1 for axis 1)
odrv0.axis1.encoder.config.use_index = True
odrv0.axis1.encoder.config.pre_calibrated = True
odrv0.axis1.motor.config.pre_calibrated = True
odrv0.save_configuration()
odrv0.axis1.requested_state = 6 # encoder index search
odrv0.axis1.requested_state = 8 # close loop control
odrv0.axis1.controller.input_pos = 1
odrv0.axis1.controller.input_pos = 10
odrv0.axis1.controller.input_pos = 50
but none of the input positions executed
tried to change the control mode but that is also not changing, it is stuck at position control mode
odrv0.axis1.requested_state = 3 #AXIS_STATE_FULL_CALIBRATION_SEQUENCE
can be performed properly
as well as
odrv0.axis1.requested_state = 6 #AXIS_STATE_ENCODER_INDEX_SEARCH
odrv0.axis1.requested_state = 7 # AXIS_STATE_ENCODER_OFFSET_CALIBRATION
can be performed properly, but control mode cant be changed and no response to any input_pos commands
@Samuel
I assume you mean once it’s in CLOSED_LOOP? Usually weird glitches like this are just noise on the USB.
Have you already checked odrv0.axis1.current_state
to make sure the axis is really in closed loop control after you requested it?
The control mode cannot be changed when using the trapezoidal trajectory feature.