mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-18 18:20:15 +08:00
drv fault only reads fault regs, add blackside loopback tests
This commit is contained in:
@@ -117,9 +117,9 @@ bool Motor::check_DRV_fault() {
|
||||
// Update DRV Fault Code
|
||||
drv_fault_ = DRV8301_getFaultType(&gate_driver_);
|
||||
// Update/Cache all SPI device registers
|
||||
DRV_SPI_8301_Vars_t* local_regs = &gate_driver_regs_;
|
||||
local_regs->RcvCmd = true;
|
||||
DRV8301_readData(&gate_driver_, local_regs);
|
||||
// DRV_SPI_8301_Vars_t* local_regs = &gate_driver_regs_;
|
||||
// local_regs->RcvCmd = true;
|
||||
// DRV8301_readData(&gate_driver_, local_regs);
|
||||
return false;
|
||||
};
|
||||
return true;
|
||||
|
||||
@@ -180,11 +180,11 @@ public:
|
||||
make_protocol_property("max_allowed_current", ¤t_control_.max_allowed_current)
|
||||
),
|
||||
make_protocol_object("gate_driver",
|
||||
make_protocol_ro_property("drv_fault", &drv_fault_),
|
||||
make_protocol_ro_property("status_reg_1", &gate_driver_regs_.Stat_Reg_1_Value),
|
||||
make_protocol_ro_property("status_reg_2", &gate_driver_regs_.Stat_Reg_2_Value),
|
||||
make_protocol_ro_property("ctrl_reg_1", &gate_driver_regs_.Ctrl_Reg_1_Value),
|
||||
make_protocol_ro_property("ctrl_reg_2", &gate_driver_regs_.Ctrl_Reg_2_Value)
|
||||
make_protocol_ro_property("drv_fault", &drv_fault_)
|
||||
// make_protocol_ro_property("status_reg_1", &gate_driver_regs_.Stat_Reg_1_Value),
|
||||
// make_protocol_ro_property("status_reg_2", &gate_driver_regs_.Stat_Reg_2_Value),
|
||||
// make_protocol_ro_property("ctrl_reg_1", &gate_driver_regs_.Ctrl_Reg_1_Value),
|
||||
// make_protocol_ro_property("ctrl_reg_2", &gate_driver_regs_.Ctrl_Reg_2_Value)
|
||||
),
|
||||
make_protocol_object("timing_log",
|
||||
make_protocol_ro_property("TIMING_LOG_GENERAL", &timing_log_[TIMING_LOG_GENERAL]),
|
||||
|
||||
@@ -61,13 +61,13 @@ def test_assert_eq(observed, expected, range=None, accuracy=None):
|
||||
def get_errors(axis_ctx: AxisTestContext):
|
||||
errors = []
|
||||
if axis_ctx.handle.motor.error != 0:
|
||||
errors.append("motor failed with error {:04X}".format(axis_ctx.handle.motor.error))
|
||||
errors.append("motor failed with error 0x{:04X}".format(axis_ctx.handle.motor.error))
|
||||
if axis_ctx.handle.encoder.error != 0:
|
||||
errors.append("encoder failed with error {:04X}".format(axis_ctx.handle.encoder.error))
|
||||
errors.append("encoder failed with error 0x{:04X}".format(axis_ctx.handle.encoder.error))
|
||||
if axis_ctx.handle.sensorless_estimator.error != 0:
|
||||
errors.append("sensorless_estimator failed with error {:04X}".format(axis_ctx.handle.sensorless_estimator.error))
|
||||
errors.append("sensorless_estimator failed with error 0x{:04X}".format(axis_ctx.handle.sensorless_estimator.error))
|
||||
if axis_ctx.handle.error != 0:
|
||||
errors.append("axis failed with error {:04X}".format(axis_ctx.handle.error))
|
||||
errors.append("axis failed with error 0x{:04X}".format(axis_ctx.handle.error))
|
||||
elif len(errors) > 0:
|
||||
errors.append("and by the way: axis reports no error even though there is one")
|
||||
return errors
|
||||
|
||||
@@ -2,7 +2,37 @@
|
||||
type: loopback
|
||||
|
||||
odrives:
|
||||
- name: odrive-48V
|
||||
- name: odrv-blackside
|
||||
board-version: v3.4-24V
|
||||
serial-number: "3061395B3235"
|
||||
brake-resistance: 0.47
|
||||
uart: /dev/serial/by-id/[not-yet-used]
|
||||
usb: auto
|
||||
programmer: '493f6f06493f56540929113f'
|
||||
vbus-voltage: 24 # [V]
|
||||
max-brake-power: 150 # [W]
|
||||
axes:
|
||||
- name: 'M0'
|
||||
motor-phase-resistance: 0.028
|
||||
motor-phase-inductance: 1.6e-05
|
||||
motor-pole-pairs: 7
|
||||
motor-direction: 1
|
||||
motor-kv: 270
|
||||
motor-max-current: 70
|
||||
motor-max-voltage: 32
|
||||
encoder-cpr: 8192
|
||||
encoder-max-rpm: 7000
|
||||
- name: 'M1'
|
||||
motor-phase-resistance: 0.028
|
||||
motor-phase-inductance: 1.6e-05
|
||||
motor-pole-pairs: 7
|
||||
motor-direction: -1
|
||||
motor-kv: 270
|
||||
motor-max-current: 70
|
||||
motor-max-voltage: 32
|
||||
encoder-cpr: 8192
|
||||
encoder-max-rpm: 7000
|
||||
- name: odrv-yellowside
|
||||
board-version: v3.5-48V
|
||||
serial-number: "3660335E3037"
|
||||
brake-resistance: 0.47
|
||||
@@ -35,4 +65,5 @@ odrives:
|
||||
|
||||
# Mechanical couplings
|
||||
couplings:
|
||||
- [ odrive-48V.M0, odrive-48V.M1 ]
|
||||
- [ odrv-blackside.M0, odrv-blackside.M1 ]
|
||||
- [ odrv-yellowside.M0, odrv-yellowside.M1 ]
|
||||
Reference in New Issue
Block a user