odrv0.erase_configuration()
odrv0.config.brake_resistance = 0.47
odrv0.config.dc_bus_undervoltage_trip_level = 8.0
odrv0.config.dc_bus_overvoltage_trip_level = 56.0
odrv0.config.dc_max_positive_current = 3.0
odrv0.config.dc_max_negative_current = -0.5
odrv0.config.max_regen_current = 0
odrv0.save_configuration()
odrv0.axis1.motor.config.pole_pairs = 7
odrv0.axis1.motor.config.calibration_current = 0.5
odrv0.axis1.motor.config.resistance_calib_max_voltage = 8.0
odrv0.axis1.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT
odrv0.axis1.motor.config.current_lim = 0.8
odrv0.axis1.motor.config.requested_current_range = 2.0
odrv0.save_configuration()
odrv0.axis1.encoder.config.mode = ENCODER_MODE_SPI_ABS_CUI
odrv0.axis1.encoder.config.abs_spi_cs_gpio_pin = 4
odrv0.axis1.encoder.config.cpr = 16384
odrv0.axis1.encoder.config.bandwidth = 100
odrv0.axis1.config.calibration_lockin.current = 0.5
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 = CONTROL_MODE_POSITION_CONTROL
odrv0.axis1.controller.config.vel_limit = 0.05
odrv0.axis1.controller.config.pos_gain = 8
odrv0.axis1.controller.config.vel_gain = 0.05
odrv0.axis1.controller.config.vel_integrator_gain = 0.1
odrv0.axis1.controller.config.input_mode = INPUT_MODE_TRAP_TRAJ
odrv0.axis1.trap_traj.config.vel_limit = 0.0417 # 15°/s
odrv0.axis1.trap_traj.config.accel_limit = 0.0833 # 30°/s²
odrv0.axis1.trap_traj.config.decel_limit = 0.0833
odrv0.save_configuration()
odrv0.reboot()
odrv0.axis1.requested_state = AXIS_STATE_MOTOR_CALIBRATION
odrv0.axis1.motor.config.phase_resistance
odrv0.axis1.motor.config.phase_inductance
odrv0.axis1.motor.config.pre_calibrated = True
odrv0.axis1.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION
odrv0.axis0.clear_errors()
odrv0.axis1.clear_errors()
odrv0.axis1.config.startup_encoder_offset_calibration = True
odrv0.axis1.config.startup_closed_loop_control = True
odrv0.save_configuration()
odrv0.reboot()
odrv0.axis1.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis1.controller.input_pos = 5
odrv0.axis1.controller.input_pos = 0
I am trying to control a 2804 motor with an MT6701 encoder (via a bridge board based on STM32F103C8T6) using ODrive. The configuration parameters are as shown above. I can stably read the encoder values (14-bit absolute encoder) through the serial port and ODriveTool. However, every time I enter closed-loop control, the motor vibrates violently, does not rotate when commanded with position control, and heats up severely. Could you tell me which part of the configuration is problematic? Odrive is V3.6 ,Thanks a lot.