diff --git a/Firmware/odrive-interface.yaml b/Firmware/odrive-interface.yaml index 372be420..fee4f9eb 100644 --- a/Firmware/odrive-interface.yaml +++ b/Firmware/odrive-interface.yaml @@ -258,6 +258,7 @@ interfaces: Setting this to False even though a brake resistor is connected is harmless. Setting this to True even though no brake resistor is connected can break the power supply. + Changes to this value require a reboot to take effect. dc_bus_undervoltage_trip_level: type: float32 diff --git a/tools/odrive/tests/closed_loop_test.py b/tools/odrive/tests/closed_loop_test.py index 26663fd0..9b64d1bf 100644 --- a/tools/odrive/tests/closed_loop_test.py +++ b/tools/odrive/tests/closed_loop_test.py @@ -40,6 +40,9 @@ class TestClosedLoopControlBase(): # Set brake resistor settings axis_ctx.parent.handle.config.brake_resistance = float(axis_ctx.parent.yaml['brake-resistance']) + # The docs say this requires a reboot but here's a small secret: + # Since the brake resistor is also started in clear_errors() this + # circumvents the need for a reboot. axis_ctx.parent.handle.config.enable_brake_resistor = True # Set calibration settings diff --git a/tools/odrive/tests/integration_test.py b/tools/odrive/tests/integration_test.py index a142e15a..e3d76007 100644 --- a/tools/odrive/tests/integration_test.py +++ b/tools/odrive/tests/integration_test.py @@ -106,6 +106,8 @@ class TestSimpleCANClosedLoop(): # Make sure there are no funny configurations active logger.debug('Setting up clean configuration...') axis_ctx.parent.erase_config_and_reboot() + axis_ctx.parent.handle.config.enable_brake_resistor = True + axis_ctx.parent.save_config_and_reboot() # run calibration axis_ctx.handle.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE @@ -162,7 +164,7 @@ class TestSimpleCANClosedLoop(): test_assert_eq(axis_ctx.handle.config.can.node_id, node_id+20) # Reset node ID to default value - asyncio.run(command(canbus.handle, node_id+20, extended_id, 'set_node_id', node_id=node_id)) + command(canbus.handle, node_id+20, extended_id, 'set_node_id', node_id=node_id) fence() test_assert_eq(axis_ctx.handle.config.can.node_id, node_id)