karpova1,
I have my Deck Donkey:
Deck Donkey Project
I have a pair of SkysEdge-Robowheels on DD and take it for a spin every morning.
If your summary is just a config file it is quite long compared to the one I use which I found on this forum —`
odrv0.config.enable_brake_resistor = True # Using included 2ohm resistor #remove enable_
odrv0.axis0.motor.config.calibration_current = 2 # highest integer value where I heard the square wave was 4
odrv0.axis0.motor.config.pole_pairs = 15
odrv0.axis0.motor.config.resistance_calib_max_voltage = 6 # motor config still worked with this set to 6
odrv0.axis0.motor.config.requested_current_range = 35 # 35 was the lowest value that produced and audible square wave.
odrv0.axis0.motor.config.current_control_bandwidth = 100.0
odrv0.axis0.motor.config.torque_constant = 8.27 / 10 # KV 10
odrv0.axis1.motor.config.calibration_current = 2 # highest integer value where I heard the square wave was 4
odrv0.axis1.motor.config.pole_pairs = 15
odrv0.axis1.motor.config.resistance_calib_max_voltage = 6 # motor config still worked with this set to 6
odrv0.axis1.motor.config.requested_current_range = 35 # 35 was the lowest value that produced and audible square wave.
odrv0.axis1.motor.config.current_control_bandwidth = 100.0
odrv0.axis1.motor.config.torque_constant = 8.27 / 10 # KV 10
encoder
odrv0.axis0.encoder.config.mode = ENCODER_MODE_INCREMENTAL
odrv0.axis0.encoder.config.cpr = 3200
odrv0.axis0.encoder.config.bandwidth = 1000
odrv0.axis1.encoder.config.mode = ENCODER_MODE_INCREMENTAL
odrv0.axis1.encoder.config.cpr = 3200
odrv0.axis1.encoder.config.bandwidth = 1000
odrv0.axis0.controller.config.input_mode = INPUT_MODE_VEL_RAMP
odrv0.axis0.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
odrv0.axis0.controller.config.pos_gain = 1
odrv0.axis0.controller.config.vel_gain = 0.002 * odrv0.axis0.motor.config.torque_constant * odrv0.axis0.encoder.config.cpr
odrv0.axis0.controller.config.vel_integrator_gain = 0.01 * odrv0.axis0.motor.config.torque_constant * odrv0.axis0.encoder.config.cpr
odrv0.axis0.controller.config.vel_limit = 5
odrv0.axis1.controller.config.input_mode = INPUT_MODE_VEL_RAMP
odrv0.axis1.controller.config.control_mode = CONTROL_MODE_VELOCITY_CONTROL
odrv0.axis1.controller.config.pos_gain = 1
odrv0.axis1.controller.config.vel_gain = 0.002 * odrv0.axis1.motor.config.torque_constant * odrv0.axis1.encoder.config.cpr
odrv0.axis1.controller.config.vel_integrator_gain = 0.01 * odrv0.axis1.motor.config.torque_constant * odrv0.axis1.encoder.config.cpr
odrv0.axis1.controller.config.vel_limit = 5
BREAK HERE
odrv0.save_configuration()
odrv0.reboot()
odrv0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION
dump_errors(odrv0)
odrv0.axis1.requested_state = AXIS_STATE_MOTOR_CALIBRATION
odrv0.axis0.motor.config.pre_calibrated = True
odrv0.axis1.motor.config.pre_calibrated = True
BREAK HERE
odrv0.save_configuration()
odrv0.reboot()
Encoder
odrv0.axis0.encoder.config.calib_range = 0.05
odrv0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION
odrv0.axis1.encoder.config.calib_range = 0.05
odrv0.axis1.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION
Movement
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis1.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.input_vel = 0.5
odrv0.axis1.controller.input_vel = 0.5
Your motor should spin here
odrv0.axis0.controller.input_vel = 0
odrv0.axis1.controller.input_vel = 0
odrv0.axis0.requested_state = AXIS_STATE_IDLE
odrv0.axis1.requested_state = AXIS_STATE_IDLE
I run my DD using ASCII protocol in velocity mode but will start to explore the position mode also.
I use Qtcreator on Ubuntu for developing my “ddod” interface.
If you are changing the config every time you change your speed that maybe what causes the motor to stop.
On my setup I have to calibrate the encoder each power up but not the config I can change the speed on the fly using ASCII protocol velocity mode.
