From 93ccdf73d53fc5a8ae725e58d53b326505760407 Mon Sep 17 00:00:00 2001 From: Shunsuke Adachi Date: Thu, 16 Nov 2023 16:28:52 +0900 Subject: [PATCH 1/7] update wiregrid_actuator.rst --- docs/agents/wiregrid_actuator.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/agents/wiregrid_actuator.rst b/docs/agents/wiregrid_actuator.rst index a0965b47e..5ece25bcd 100644 --- a/docs/agents/wiregrid_actuator.rst +++ b/docs/agents/wiregrid_actuator.rst @@ -77,6 +77,10 @@ The main functions are ``insert()`` and ``eject()``. In the both of the functions, after the inserting/ejecting, the stopper locks the actuators again. However, the motor power is not turned ON or OFF during the both functions. +The parameter details are here: +- speedrate: Actuator speed rate [0.0, 5.0] (default: 0.2) + DO NOT use speedrate > 1.0 if el != 90 deg!! + **Test Functions** - check_limitswitch(): Check ON/OFF of the limit switches - check_stopper(): Check ON/OFF (lock/unlock) of the stoppers @@ -98,7 +102,8 @@ In the test mode, you can choose the moving distance [mm] and speed rate. The parameter details are here: - distance: Actuator moving distance [mm] (default: 10) -- speedrate: Actuator speed rate [0.0, 1.0] (default: 0.2) +- speedrate: Actuator speed rate [0.0, 5.0] (default: 0.2) + DO NOT use speedrate > 1.0 if el != 90 deg!! Hardware Configurations From 89f4aa44178b344fd4216aff1b7a0dfb70c8eedb Mon Sep 17 00:00:00 2001 From: Shunsuke Adachi Date: Thu, 16 Nov 2023 16:39:23 +0900 Subject: [PATCH 2/7] add speedrate parameter in insert/eject() in wiregrid_actuator --- socs/agents/wiregrid_actuator/agent.py | 44 +++++++++++++++++++------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/socs/agents/wiregrid_actuator/agent.py b/socs/agents/wiregrid_actuator/agent.py index deb109c1c..b60d4de9c 100644 --- a/socs/agents/wiregrid_actuator/agent.py +++ b/socs/agents/wiregrid_actuator/agent.py @@ -276,13 +276,23 @@ def _eject(self, main_distance=920, main_speedrate=1.0): ################## # Return: status(True or False), message + @ocs_agent.param('speedrate', default=1.0, type=float, + check=lambda x: 0.0 < x <= 5.0) def insert(self, session, params=None): """insert() **Task** - Insert the wire-grid into the forebaffle interface above the SAT. + Parameters: + speedrate (float): Actuator speed rate [0.0, 5.0] (default: 1.0) + DO NOT use speedrate > 1.0 if el != 90 deg!! """ + # Get parameters + speedrate = params.get('speedrate') + self.log.info('insert(): set speed rate = {}' + .format(speedrate)) + with self.lock.acquire_timeout(timeout=3, job='insert') as acquired: if not acquired: self.log.warn( @@ -293,22 +303,32 @@ def insert(self, session, params=None): # Wait for a second before moving time.sleep(1) # Moving commands - ret, msg = self._insert(920, 1.0) + ret, msg = self._insert(920, speedrate) if not ret: msg = 'insert(): '\ - 'ERROR!: Failed insert() in _insert(850,1.0) | {}'\ - .format(msg) + 'ERROR!: Failed insert() in _insert(920,{}) | {}'\ + .format(speedrate, msg) self.log.error(msg) return False, msg return True, 'insert(): Successfully finish!' + @ocs_agent.param('speedrate', default=1.0, type=float, + check=lambda x: 0.0 < x <= 5.0) def eject(self, session, params=None): """eject() **Task** - Eject the wire-grid from the forebaffle interface above the SAT. + Parameters: + speedrate (float): Actuator speed rate [0.0, 5.0] (default: 1.0) + DO NOT use speedrate > 1.0 if el != 90 deg!! """ + # Get parameters + speedrate = params.get('speedrate') + self.log.info('eject(): set speed rate = {}' + .format(speedrate)) + with self.lock.acquire_timeout(timeout=3, job='eject') as acquired: if not acquired: self.log.warn( @@ -319,10 +339,10 @@ def eject(self, session, params=None): # Wait for a second before moving time.sleep(1) # Moving commands - ret, msg = self._eject(920, 1.0) + ret, msg = self._eject(920, speedrate) if not ret: - msg = 'eject(): ERROR!: Failed in _eject(850,1.0) | {}'\ - .format(msg) + msg = 'eject(): ERROR!: Failed in _eject(920,{}) | {}'\ + .format(speedrate, msg) self.log.error(msg) return False, msg return True, 'eject(): Successfully finish!' @@ -451,7 +471,7 @@ def eject_homing(self, session, params=None): @ocs_agent.param('distance', default=10., type=float) @ocs_agent.param('speedrate', default=0.2, type=float, - check=lambda x: 0.0 < x <= 1.0) + check=lambda x: 0.0 < x <= 5.0) def insert_test(self, session, params): """insert_test(distance=10, speedrate=0.1) @@ -460,7 +480,8 @@ def insert_test(self, session, params): Parameters: distance (float): Actuator moving distance [mm] (default: 10) - speedrate (float): Actuator speed rate [0.0, 1.0] (default: 0.2) + speedrate (float): Actuator speed rate [0.0, 5.0] (default: 0.2) + DO NOT use speedrate > 1.0 if el != 90 deg!! """ # Get parameters distance = params.get('distance') @@ -502,7 +523,7 @@ def insert_test(self, session, params): @ocs_agent.param('distance', default=10., type=float) @ocs_agent.param('speedrate', default=0.2, type=float, - check=lambda x: 0.0 < x <= 1.0) + check=lambda x: 0.0 < x <= 5.0) def eject_test(self, session, params): """eject_test(distance=10, speedrate=0.1) @@ -510,8 +531,9 @@ def eject_test(self, session, params): above the SAT with a small distance. Parameters: - distance: Actuator moving distance [mm] (default: 10) - speedrate: Actuator speed rate [0.0, 1.0] (default: 0.2) + distance (float): Actuator moving distance [mm] (default: 10) + speedrate (float): Actuator speed rate [0.0, 5.0] (default: 0.2) + DO NOT use speedrate > 1.0 if el != 90 deg!! """ # Get parameters distance = params.get('distance', 10) From 5ea063ec45123c120fd7c191da558a2dffef5bff Mon Sep 17 00:00:00 2001 From: Shunsuke Adachi Date: Wed, 29 Nov 2023 12:54:08 +0900 Subject: [PATCH 3/7] update wiregrid_actuator.rst --- docs/agents/wiregrid_actuator.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/agents/wiregrid_actuator.rst b/docs/agents/wiregrid_actuator.rst index ca7e0fe9e..d61141648 100644 --- a/docs/agents/wiregrid_actuator.rst +++ b/docs/agents/wiregrid_actuator.rst @@ -78,8 +78,10 @@ In the both of the functions, after the inserting/ejecting, the stopper locks th However, the motor power is not turned ON or OFF during the both functions. The parameter details are here: -- speedrate: Actuator speed rate [0.0, 5.0] (default: 0.2) - DO NOT use speedrate > 1.0 if el != 90 deg!! +- speedrate: Actuator speed rate [0.0, 5.0] (default: 1.0) + +.. warning:: + DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``! **Test Functions** - check_limitswitch(): Check ON/OFF of the limit switches From 0d223c706154559819e82b64183c0db1f0407a0d Mon Sep 17 00:00:00 2001 From: Shunsuke Adachi Date: Wed, 29 Nov 2023 12:56:44 +0900 Subject: [PATCH 4/7] update wiregrid_actuator.rst --- docs/agents/wiregrid_actuator.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/agents/wiregrid_actuator.rst b/docs/agents/wiregrid_actuator.rst index d61141648..2d01c9540 100644 --- a/docs/agents/wiregrid_actuator.rst +++ b/docs/agents/wiregrid_actuator.rst @@ -80,9 +80,6 @@ However, the motor power is not turned ON or OFF during the both functions. The parameter details are here: - speedrate: Actuator speed rate [0.0, 5.0] (default: 1.0) -.. warning:: - DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``! - **Test Functions** - check_limitswitch(): Check ON/OFF of the limit switches - check_stopper(): Check ON/OFF (lock/unlock) of the stoppers @@ -106,9 +103,6 @@ The parameter details are here: - distance: Actuator moving distance [mm] (default: 10) - speedrate: Actuator speed rate [0.0, 5.0] (default: 0.2) -.. warning:: - DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``! - Hardware Configurations ``````````````````````` From e760f6d0680268ede384547bf4dd2d1e70f19b39 Mon Sep 17 00:00:00 2001 From: Shunsuke Adachi Date: Wed, 29 Nov 2023 12:58:54 +0900 Subject: [PATCH 5/7] update wiregrid_actuator.rst --- docs/agents/wiregrid_actuator.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/agents/wiregrid_actuator.rst b/docs/agents/wiregrid_actuator.rst index 2d01c9540..280b2b2e4 100644 --- a/docs/agents/wiregrid_actuator.rst +++ b/docs/agents/wiregrid_actuator.rst @@ -78,6 +78,7 @@ In the both of the functions, after the inserting/ejecting, the stopper locks th However, the motor power is not turned ON or OFF during the both functions. The parameter details are here: + - speedrate: Actuator speed rate [0.0, 5.0] (default: 1.0) **Test Functions** From 27b54526010d63bc1190d9050dc01d715a741245 Mon Sep 17 00:00:00 2001 From: Shunsuke Adachi Date: Wed, 29 Nov 2023 12:59:38 +0900 Subject: [PATCH 6/7] update wiregrid_actuator.rst --- docs/agents/wiregrid_actuator.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/agents/wiregrid_actuator.rst b/docs/agents/wiregrid_actuator.rst index 280b2b2e4..87921ab90 100644 --- a/docs/agents/wiregrid_actuator.rst +++ b/docs/agents/wiregrid_actuator.rst @@ -79,7 +79,7 @@ However, the motor power is not turned ON or OFF during the both functions. The parameter details are here: -- speedrate: Actuator speed rate [0.0, 5.0] (default: 1.0) + - speedrate: Actuator speed rate [0.0, 5.0] (default: 1.0) **Test Functions** - check_limitswitch(): Check ON/OFF of the limit switches From 05ce3194723c946b6a401c3221a895fb2b1d0ea2 Mon Sep 17 00:00:00 2001 From: Shunsuke Adachi Date: Wed, 29 Nov 2023 13:01:42 +0900 Subject: [PATCH 7/7] update wiregrid_actuator.rst --- docs/agents/wiregrid_actuator.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/agents/wiregrid_actuator.rst b/docs/agents/wiregrid_actuator.rst index 87921ab90..280b2b2e4 100644 --- a/docs/agents/wiregrid_actuator.rst +++ b/docs/agents/wiregrid_actuator.rst @@ -79,7 +79,7 @@ However, the motor power is not turned ON or OFF during the both functions. The parameter details are here: - - speedrate: Actuator speed rate [0.0, 5.0] (default: 1.0) +- speedrate: Actuator speed rate [0.0, 5.0] (default: 1.0) **Test Functions** - check_limitswitch(): Check ON/OFF of the limit switches