我的Odrive Board
版號: Odrive v3.6-56
ODrive control utility v0.6.5.post2
Odrive 硬件內部 FW V0.5.6
odrivetool 架構在Anaconda的多重Python環境中
要讓ODrive啟動要在odrivetool中設定以下四個configuration
主板 configuration
dev0.erase_configuration()
dev0.config.brake_resistance=2.0
dev0.config.dc_bus_undervoltage_trip_level=8.0
dev0.config.dc_bus_overvoltage_trip_level=56.0
dev0.config.dc_max_positive_current=20.0
dev0.config.dc_max_negative_current=-3.0
dev0.save_configuration()
電機 X2212 motor configuration
dev0.axis0.motor.config.pole_pairs=7
dev0.axis0.motor.config.calibration_current = 5
dev0.axis0.motor.config.resistance_calib_max_voltage= 2
dev0.axis0.motor.config.motor_type =MOTOR_TYPE_HIGH_CURRENT
dev0.axis0.motor.config.current_lim=15
dev0.axis0.motor.config.requested_current_range=20
dev0.save_configuration()
Magnetic Encoder TLE5012B
dev0.axis0.encoder.config.mode=ENCODER_MODE_INCREMENTAL
dev0.axis0.encoder.config.cpr=16384
dev0.axis0.encoder.config.bandwidth=3000
dev0.axis0.config.calibration_lockin.current=5
dev0.axis0.config.calibration_lockin.ramp_time=0.4
dev0.axis0.config.calibration_lockin.ramp_distance=3.1415927410125732
dev0.axis0.config.calibration_lockin.accel=20
dev0.axis0.config.calibration_lockin.vel=40
//---controller setting
dev0.axis0.controller.config.control_mode = CONTROL_MODE_POSITION_CONTROL
dev0.axis0.trap_traj.config.vel_limit=30
dev0.axis0.controller.config.pos_gain = 30
dev0.axis0.controller.config.vel_gain = 0.02
dev0.axis0.controller.config.vel_integrator_gain = 0.2
dev0.axis0.controller.config.input_mode=INPUT_MODE_TRAP_TRAJ
dev0.axis0.trap_traj.config.accel_limit=5
dev0.axis0.trap_traj.config.decel_limit=5
dev0.save_configuration()
dev0.reboot()
//-- Test
dev0.axis0.requested_state = AXIS_STATE_MOTOR_CALIBRATION
dev0.axis0.motor.config.pre_calibrated = True
dev0.axis0.requested_state = AXIS_STATE_ENCODER_OFFSET_CALIBRATION
dev0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
dev0.axis0.config.startup_encoder_offset_calibration= True
dev0.axis0.config.startup_closed_loop_control = True
dev0.save_configuration()
dev0.axis0.controller.input_pos=10
//-------------
pip install matplotlib
start_liveplotter(lambda: [dev0.axis0.encoder.pos_estimate])
在live_plotter調適的畫面
利用CAN BUS進行ODrive位置控制影片如下
沒有留言:
張貼留言