-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathodriveToolCommands
More file actions
66 lines (53 loc) · 2.74 KB
/
odriveToolCommands
File metadata and controls
66 lines (53 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#These commands are for the ODriveTool
#Run these blocks one chunk at at time to let the ODrive save and reset as required
odrv0.erase_configuration()
odrv0.reboot()
# These next lines should be edited for what you need before executing them
odrv0.axis0.config.can.node_id = 16 #19 #0 #This is your CAN node ID
odrv0.can.config.baud_rate = 1000000 #250000 #1000000 #This is the BAUD rate on your CAN
odrv0.config.odrv_fan.enabled = True
odrv0.config.odrv_fan.upper = 10 #50 #50/30 is reasonable (turns on at 50C, turns off at 30C), but 10/0 works too (makes the fan always on)
odrv0.config.odrv_fan.upper = 0 #30
# End edit block
odrv0.config.dc_bus_overvoltage_trip_level = 35
odrv0.config.dc_bus_undervoltage_trip_level = 10.5
odrv0.config.dc_max_positive_current = 100
odrv0.config.dc_max_negative_current = float('-inf')
odrv0.axis0.config.motor.motor_type = MotorType.HIGH_CURRENT
odrv0.axis0.config.motor.pole_pairs = 7
odrv0.axis0.config.motor.torque_constant = 0.017595744680851063
odrv0.axis0.config.motor.current_soft_max = 80
odrv0.axis0.config.motor.current_hard_max = 100
odrv0.axis0.config.motor.calibration_current = 20
odrv0.axis0.config.motor.resistance_calib_max_voltage = 6
odrv0.axis0.config.calibration_lockin.current = 20
odrv0.axis0.motor.motor_thermistor.config.enabled = False
odrv0.axis0.controller.config.control_mode = ControlMode.VELOCITY_CONTROL
odrv0.axis0.controller.config.input_mode = InputMode.VEL_RAMP
odrv0.axis0.controller.config.vel_limit = 10
odrv0.axis0.controller.config.vel_limit_tolerance = 1.2
odrv0.axis0.config.torque_soft_min = float('-inf')
odrv0.axis0.config.torque_soft_max = ('inf')
odrv0.axis0.trap_traj.config.accel_limit = 10
odrv0.axis0.controller.config.vel_ramp_rate = 10
odrv0.can.config.protocol = Protocol.SIMPLE
odrv0.axis0.config.can.heartbeat_msg_rate_ms = 100
odrv0.axis0.config.can.encoder_msg_rate_ms = 10
odrv0.axis0.config.can.iq_msg_rate_ms = 10
odrv0.axis0.config.can.torques_msg_rate_ms = 10
odrv0.axis0.config.can.error_msg_rate_ms = 10
odrv0.axis0.config.can.temperature_msg_rate_ms = 10
odrv0.axis0.config.can.bus_voltage_msg_rate_ms = 10
odrv0.axis0.config.enable_watchdog = False
odrv0.rs485_encoder_group0.config.mode = Rs485EncoderMode.AMT21_EVENT_DRIVEN #confirmed
odrv0.axis0.config.load_encoder = EncoderId.RS485_ENCODER0 #confirmed
odrv0.axis0.config.commutation_encoder = EncoderId.RS485_ENCODER0 # confirmed
odrv0.config.enable_uart_a = False
odrv0.axis0.config.torque_soft_max = 1.6 #Limit motor to 1.6 N-ms
odrv0.axis0.controller.config.vel_integrator_limit = 10
odrv0.save_configuration()
odrv0.reboot()
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.save_configuration()
odrv0.reboot()
#Done! Type odrv0.config or odrv0.axis0 to see if the settins you set are displayed