From c65b1e9a7802d537e35bce8a67abdbf8c0d12493 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 5 Nov 2020 17:15:45 +0000 Subject: [PATCH] Update --- odrive_controller.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/odrive_controller.py b/odrive_controller.py index c07ad3b..3d010d5 100644 --- a/odrive_controller.py +++ b/odrive_controller.py @@ -7,7 +7,7 @@ from odrive.enums import (AXIS_STATE_IDLE, INPUT_MODE_POS_FILTER) odrive_params = { - 'current_lim': 10, # A + 'current_lim': 50, # A 'vel_lim': 60000, # Rev/s 'accel_lim': 1000000/1.2, 'decel_lim': 1000000/1.2, @@ -31,21 +31,21 @@ class Motors: self.params = params if odrive_sn: try: - self.odrive = odrive.find_any(serial_number=odrive_sn) + self.drive = odrive.find_any(serial_number=odrive_sn) except Exception as err: logging.error(f"Encountered error: {err}") else: - self.odrive = odrive.find_any() + self.drive = odrive.find_any() self.enable_estop() self.set_parameters() logging.info(f"Odrive ready, voltage: {self.drive.vbus_voltage}V") - def digital_estop(self): - axis0 = self.odrive.axis0 - axis1 = self.odrive.axis1 + def digital_estop(self, *_): + axis0 = self.drive.axis0 + axis1 = self.drive.axis1 axis0.requested_state = AXIS_STATE_IDLE axis1.requested_state = AXIS_STATE_IDLE - logging.warn('Estop triggered, motors set to Idle') + logging.warning('Estop triggered, motors set to Idle') def enable_estop(self): signal.signal(signal.SIGINT, self.digital_estop) @@ -61,7 +61,7 @@ class Motors: axis.trap_traj.config.vel_limit = self.params.get('vel_lim', 1) axis.trap_traj.config.accel_limit = self.params.get('accel_lim', 1) axis.trap_traj.config.decel_limit = self.params.get('decel_lim', 1) - axis.controller.config.input_filter_bandwidth = self.params.get('pos_filter', 2) + # axis.controller.config.input_filter_bandwidth = self.params.get('pos_filter', 2) def run_calibration(self): self.drive.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE