There seems to be a dividing line in the closed-loop motor, which can not operate normally. What is the problem( Speed control mode)
https://youtu.be/V6SNivjccN0
Your feedback (encoder or other feedback source) is not working, and so it’s not commutating: The stator field is not moving with the rotor as it should, and seems to be at a fixed electrical angle. When you force it by hand, you can jump over a ‘pole’ of the motor.
Do you have an encoder at all?
If you are trying to use the sensorless mode, you must enable the sensorless estimator as the feedback source.
axis.config.enable_sensorless_mode=True
Note you must configure axis.sensorless_estimator.config.pm_flux_linkage
with the constant for your motor. It is calculated as:
5.51328895422 / (<pole pairs> * <rpm/v>)
I can perform encoder calibration and encoder index calibration without error. I can also enter the closed-loop control mode, but I can’t operate it. Like in the video, the closed-loop is abnormal
What’s it like in torque control?
The same is true for torque. There is a boundary line. As you said, the stator magnetic field does not rotate, like maintaining a fixed electrical angle
How are you calibrating the motor? Are you doing anything weird like overriding pre_calibrated
before it has been calibrated ? Do you have any firmware mods?
This is what I set up
I didn’t make strange settings
The firmware version is 0.5.1
thank
odrv0.erase_configuration() odrv0.config.brake_resistance = 0.1 odrv0.config.dc_bus_undervoltage_trip_level = 32 odrv0.config.dc_bus_overvoltage_trip_level = 43 odrv0.config.dc_max_positive_current = 20.0 odrv0.config.dc_max_negative_current = -2.0 odrv0.config.max_regen_current = 0 odrv0.save_configuration()odrv0.axis0.motor.config.pole_pairs = 18 odrv0.axis0.motor.config.calibration_current = 10 odrv0.axis0.motor.config.resistance_calib_max_voltage = 5 odrv0.axis0.motor.config.motor_type = MOTOR_TYPE_HIGH_CURRENT odrv0.axis0.motor.config.current_lim = 30 odrv0.axis0.motor.config.requested_current_range = 40
odrv0.save_configuration()
odrv0.axis0.encoder.config.calib_range=0.2 odrv0.axis0.encoder.config.mode = ENCODER_MODE_INCREMENTAL odrv0.axis0.encoder.config.use_index = True odrv0.axis0.encoder.config.cpr = 16384 odrv0.axis0.encoder.config.bandwidth = 3000 odrv0.axis0.config.calibration_lockin.current = 10 odrv0.axis0.config.calibration_lockin.ramp_time = 0.4 odrv0.axis0.config.calibration_lockin.ramp_distance = 3.1415927410125732 odrv0.axis0.config.calibration_lockin.accel = 20 odrv0.axis0.config.calibration_lockin.vel = 40 odrv0.save_configuration()
odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROLodrv0.axis0.controller.config.vel_limit = 30 odrv0.axis0.controller.config.pos_gain = 30 odrv0.axis0.controller.config.vel_gain = 0.07 odrv0.axis0.controller.config.vel_integrator_gain = 3.5 odrv0.axis0.controller.config.input_mode = INPUT_MODE_VEL_RAMP odrv0.axis0.controller.config.vel_ramp_rate = 5 odrv0.save_configuration()
odrv0.reboot()odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION dump_errors(odrv0)
odrv0.axis0.motor.config.pre_calibrated = True odrv0.axis0.requested_state = AXIS_STATE_ENCODER_INDEX_SEARCH dump_errors(odrv0)
odrv0.axis0.config.startup_encoder_index_search = True
odrv0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION
dump_errors(odrv0)
odrv0.axis0.encoder.config.pre_calibrated = True
odrv0.axis0.config.startup_encoder_offset_calibration = True
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL