From e51e782da03cb2eb23e1830d1619700c3e6c3d85 Mon Sep 17 00:00:00 2001 From: John Rose Date: Wed, 27 Mar 2024 12:32:27 -0400 Subject: [PATCH 01/10] Added in the autosetting of cycle mode --- src/MotionControl.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/MotionControl.c b/src/MotionControl.c index fa9ff9d9..904e1a1d 100644 --- a/src/MotionControl.c +++ b/src/MotionControl.c @@ -1355,6 +1355,7 @@ static STATUS Ros_Controller_DisableEcoMode() // // NOTE: only attempts to start job if necessary, does not reset errors, alarms. // Does attempt to enable servo power (if not on) +// Does attempt to set the cycle mode to continuous (if not set) //----------------------------------------------------------------------- BOOL Ros_MotionControl_StartMotionMode(MOTION_MODE mode) { @@ -1392,13 +1393,6 @@ BOOL Ros_MotionControl_StartMotionMode(MOTION_MODE mode) } #endif - // Check if in continous cycle mode - if (!Ros_Controller_IsContinuousCycle()) - { - Ros_Debug_BroadcastMsg("Continuous cycle mode not set, can't enable trajectory mode"); - return FALSE; - } - if (Ros_Controller_IsAnyFaultActive()) { Ros_Debug_BroadcastMsg("Controller is in a fault state. Please call /reset_error"); @@ -1436,6 +1430,23 @@ BOOL Ros_MotionControl_StartMotionMode(MOTION_MODE mode) } } + // Check if in continous cycle mode + if (!Ros_Controller_IsContinuousCycle()) + { + // set the cycle mode to auto if not currently + MP_CYCLE_SEND_DATA sCycleData; + bzero(&sCycleData, sizeof(sCycleData)); + bzero(&rData, sizeof(rData)); + sCycleData.sCycle = 3; // Auto + ret = mpSetCycle(&sCycleData, &rData); + if( (ret != 0) || (rData.err_no != 0) ) { + Ros_Debug_BroadcastMsg( + "Can't set cycle mode to continuous because: '%s' (0x%04X)", + Ros_ErrorHandling_ErrNo_ToString(rData.err_no), rData.err_no); + return FALSE; + } + } + #ifndef DUMMY_SERVO_MODE // Servo On if(Ros_Controller_IsServoOn() == FALSE) From 7d2526dd70448c3b2c1ed1ec8668c5d1f7929ce3 Mon Sep 17 00:00:00 2001 From: John Rose Date: Wed, 27 Mar 2024 14:51:12 -0400 Subject: [PATCH 02/10] updated API documentation --- doc/ros_api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ros_api.md b/doc/ros_api.md index 53da450b..19bdf17e 100644 --- a/doc/ros_api.md +++ b/doc/ros_api.md @@ -111,7 +111,7 @@ Note: errors and alarms which require physical operator intervention (e-stops, e Type: [motoros2_interfaces/srv/StartTrajMode](https://github.com/yaskawa-global/motoros2_interfaces/blob/d6805d32714df4430f7db3d8ddc736c340ddeba8/srv/StartTrajMode.srv) -Attempt to enable servo drives and activate trajectory mode, allowing the action server (`follow_joint_trajectory`, see below) to execute incoming `FollowJointTrajectory` action goals. +Attempts to set cycle mode, enable servo drives, and activate trajectory mode, allowing the action server (`follow_joint_trajectory`, see below) to execute incoming `FollowJointTrajectory` action goals. Note: this service may fail if controller state prevents it from transitioning to trajectory mode. Inspect the `result_code` to determine the cause. @@ -123,7 +123,7 @@ The `reset_error` service can be used to attempt to reset errors and alarms. Type: [motoros2_interfaces/srv/StartPointQueueMode](https://github.com/yaskawa-global/motoros2_interfaces/blob/d6805d32714df4430f7db3d8ddc736c340ddeba8/srv/StartPointQueueMode.srv) -Attempt to enable servo drives and activate the point-queue motion mode, allowing the `queue_traj_point` service to execute incoming `QueueTrajPoint` requests. +Attempts to set cycle mode, enable servo drives, and activate the point-queue motion mode, allowing the `queue_traj_point` service to execute incoming `QueueTrajPoint` requests. Note: this service may fail if controller state prevents it from transitioning to trajectory mode. Inspect the `result_code` to determine the cause. From 29260c8c4eb9186448d1b32f25a141f34bd66313 Mon Sep 17 00:00:00 2001 From: Ted Miller Date: Wed, 17 Apr 2024 16:42:58 -0400 Subject: [PATCH 03/10] Alarm if we're unable to force the cycle to AUTO --- doc/troubleshooting.md | 21 +++++++++++++++++++++ src/ErrorHandling.h | 6 ++++++ src/MotionControl.c | 13 ++++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/doc/troubleshooting.md b/doc/troubleshooting.md index fa04b405..33e79706 100644 --- a/doc/troubleshooting.md +++ b/doc/troubleshooting.md @@ -1117,3 +1117,24 @@ ALARM 8015 *Solution:* Open a new ticket on the MotoROS2 [Issue tracker](https://github.com/yaskawa-global/motoros2/issues). Please include a copy of the `RBCALIB.DAT` from your robot controller along with the output from the [Debug log client](#debug-log-client). + +### Alarm: 8016[0] + +*Example:* + +```text +ALARM 8016 + Failed to set cycle +[0] +``` + +*Solution:* +The job cycle is currently set to `STEP` and MotoROS2 was unable to automatically change it to `AUTO`. + +First, manually set the controller to use `AUTO`. + + 1. upgrade to *MANAGEMENT* security level by touching `[System Info]`→`[Security]` (default password is all `9`'s) + 1. touch `[Setup]`→`[Operate Cond.]` + 1. change `CYCLE SWITCH IN REMOTE MODE` to `AUTO` + +If the problem persists, verify that the `CIOPRG.LST` ladder program is not writing to `#40050 - #40052`. diff --git a/src/ErrorHandling.h b/src/ErrorHandling.h index 5fca746d..9c37dceb 100644 --- a/src/ErrorHandling.h +++ b/src/ErrorHandling.h @@ -81,6 +81,7 @@ typedef enum ALARM_CONFIGURATION_FAIL, ALARM_INFORM_JOB_FAIL, ALARM_DAT_FILE_PARSE_FAIL, + ALARM_OPERATION_FAIL, } ALARM_MAIN_CODE; @@ -216,6 +217,11 @@ typedef enum SUBCODE_DAT_FAIL_PARSE_SRANG } ALARM_DAT_FILE_PARSE_FAIL_SUBCODE; //8015 +typedef enum +{ + SUBCODE_OPERATION_SET_CYCLE, +} ALARM_OPERATION_FAIL_SUBCODE; //8016 + extern void motoRosAssert(BOOL mustBeTrue, ALARM_ASSERTION_FAIL_SUBCODE subCodeIfFalse); extern void motoRosAssert_withMsg(BOOL mustBeTrue, ALARM_ASSERTION_FAIL_SUBCODE subCodeIfFalse, char* msgFmtIfFalse, ...); diff --git a/src/MotionControl.c b/src/MotionControl.c index 904e1a1d..b2db683a 100644 --- a/src/MotionControl.c +++ b/src/MotionControl.c @@ -1439,12 +1439,23 @@ BOOL Ros_MotionControl_StartMotionMode(MOTION_MODE mode) bzero(&rData, sizeof(rData)); sCycleData.sCycle = 3; // Auto ret = mpSetCycle(&sCycleData, &rData); - if( (ret != 0) || (rData.err_no != 0) ) { + if( (ret != 0) || (rData.err_no != 0) ) + { Ros_Debug_BroadcastMsg( "Can't set cycle mode to continuous because: '%s' (0x%04X)", Ros_ErrorHandling_ErrNo_ToString(rData.err_no), rData.err_no); + mpSetAlarm(ALARM_OPERATION_FAIL, "Set job-cycle to AUTO", SUBCODE_OPERATION_SET_CYCLE); return FALSE; } + + Ros_Controller_IoStatusUpdate(); //verify the cycle got set and wasn't forced back due to CIO logic + + if (!Ros_Controller_IsContinuousCycle()) + { + Ros_Debug_BroadcastMsg("Can't set cycle mode. Check CIOPRG.LST for OUT #40050 - #40052"); + mpSetAlarm(ALARM_OPERATION_FAIL, "Set job-cycle to AUTO", SUBCODE_OPERATION_SET_CYCLE); + return false; + } } #ifndef DUMMY_SERVO_MODE From 726ed1cf16f64762975f354470ded0aed0c61f52 Mon Sep 17 00:00:00 2001 From: Ted Miller Date: Fri, 19 Apr 2024 12:56:52 -0400 Subject: [PATCH 04/10] Correct alarm message in doc --- doc/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/troubleshooting.md b/doc/troubleshooting.md index 33e79706..733f5c46 100644 --- a/doc/troubleshooting.md +++ b/doc/troubleshooting.md @@ -1124,7 +1124,7 @@ Please include a copy of the `RBCALIB.DAT` from your robot controller along with ```text ALARM 8016 - Failed to set cycle + Set job-cycle to AUTO [0] ``` From 60311e28683a6bbd04aa0b13a0f5a1c014b6be60 Mon Sep 17 00:00:00 2001 From: Ted Miller Date: Fri, 17 May 2024 16:03:15 -0400 Subject: [PATCH 05/10] Clarify troubleshooting for job-cycle --- doc/troubleshooting.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/troubleshooting.md b/doc/troubleshooting.md index 733f5c46..67dd91d6 100644 --- a/doc/troubleshooting.md +++ b/doc/troubleshooting.md @@ -1130,11 +1130,13 @@ ALARM 8016 *Solution:* The job cycle is currently set to `STEP` and MotoROS2 was unable to automatically change it to `AUTO`. - -First, manually set the controller to use `AUTO`. +This will prevent the `INIT_ROS` from operating continuously and will prevent the software from accepting any incoming trajectories. 1. upgrade to *MANAGEMENT* security level by touching `[System Info]`→`[Security]` (default password is all `9`'s) + 1. touch `[Job]`→`[Cycle]` + 1. Change `WORK SELECT` to `AUTO` 1. touch `[Setup]`→`[Operate Cond.]` 1. change `CYCLE SWITCH IN REMOTE MODE` to `AUTO` If the problem persists, verify that the `CIOPRG.LST` ladder program is not writing to `#40050 - #40052`. +Please contact Yaskawa Technical Support for assistance if you are not familiar with the Concurrent I/O Ladder Program. From e9df54720d2faffc2fee26421fcd0e5d159067ce Mon Sep 17 00:00:00 2001 From: Ted Miller Date: Fri, 17 May 2024 16:06:45 -0400 Subject: [PATCH 06/10] Clarify cycle values --- src/MotionControl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MotionControl.c b/src/MotionControl.c index b2db683a..5b2fffe3 100644 --- a/src/MotionControl.c +++ b/src/MotionControl.c @@ -1437,7 +1437,7 @@ BOOL Ros_MotionControl_StartMotionMode(MOTION_MODE mode) MP_CYCLE_SEND_DATA sCycleData; bzero(&sCycleData, sizeof(sCycleData)); bzero(&rData, sizeof(rData)); - sCycleData.sCycle = 3; // Auto + sCycleData.sCycle = 3; // 3 = Auto; 2 = Cycle; 1 = Step ret = mpSetCycle(&sCycleData, &rData); if( (ret != 0) || (rData.err_no != 0) ) { From 5191b0b89d503a3b8e1cb20a7c21fe4b9eedb27e Mon Sep 17 00:00:00 2001 From: Ted Miller Date: Fri, 17 May 2024 16:09:26 -0400 Subject: [PATCH 07/10] give CIO time to potentially overwrite the cycle --- src/MotionControl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MotionControl.c b/src/MotionControl.c index 5b2fffe3..d1f39c3b 100644 --- a/src/MotionControl.c +++ b/src/MotionControl.c @@ -1448,6 +1448,7 @@ BOOL Ros_MotionControl_StartMotionMode(MOTION_MODE mode) return FALSE; } + Ros_Sleep(g_Ros_Controller.interpolPeriod); //give CIO time to potentially overwrite the cycle (Ladder scan time is smaller than the interpolPeriod) Ros_Controller_IoStatusUpdate(); //verify the cycle got set and wasn't forced back due to CIO logic if (!Ros_Controller_IsContinuousCycle()) From a461aeed7ecf9f5daf9e1806c05241ac5c4e4e0f Mon Sep 17 00:00:00 2001 From: gavanderhoorn Date: Mon, 20 May 2024 15:48:30 +0200 Subject: [PATCH 08/10] Introduce named constant for cycle mode and use it. --- lib/MotoPlusExterns.h | 6 ++++++ src/MotionControl.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/MotoPlusExterns.h b/lib/MotoPlusExterns.h index 0026bb8b..6728f46b 100644 --- a/lib/MotoPlusExterns.h +++ b/lib/MotoPlusExterns.h @@ -32,4 +32,10 @@ extern MP_GRP_ID_TYPE mpCtrlGrpNo2GrpId(int grp_no); #define E_EXRCS_UNDER_ENERGY_SAVING (-20) #endif +//from the M+ API Function Specifications on mpSetCycle(..) (HW1483602) +#define MP_CYCLE_MODE_STEP 1 +#define MP_CYCLE_MODE_1CYCLE 2 +#define MP_CYCLE_MODE_AUTO 3 + + #endif // MOTOROS2_MOTOPLUS_EXTERNS_H diff --git a/src/MotionControl.c b/src/MotionControl.c index d1f39c3b..aab86d1b 100644 --- a/src/MotionControl.c +++ b/src/MotionControl.c @@ -1437,7 +1437,7 @@ BOOL Ros_MotionControl_StartMotionMode(MOTION_MODE mode) MP_CYCLE_SEND_DATA sCycleData; bzero(&sCycleData, sizeof(sCycleData)); bzero(&rData, sizeof(rData)); - sCycleData.sCycle = 3; // 3 = Auto; 2 = Cycle; 1 = Step + sCycleData.sCycle = MP_CYCLE_MODE_AUTO; ret = mpSetCycle(&sCycleData, &rData); if( (ret != 0) || (rData.err_no != 0) ) { From f482d777954b732a772dc8c8f6e22a5e75c85ae9 Mon Sep 17 00:00:00 2001 From: gavanderhoorn Date: Mon, 20 May 2024 16:33:52 +0200 Subject: [PATCH 09/10] doc: lowercase bullet text --- doc/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/troubleshooting.md b/doc/troubleshooting.md index 67dd91d6..729a9ff2 100644 --- a/doc/troubleshooting.md +++ b/doc/troubleshooting.md @@ -1134,7 +1134,7 @@ This will prevent the `INIT_ROS` from operating continuously and will prevent th 1. upgrade to *MANAGEMENT* security level by touching `[System Info]`→`[Security]` (default password is all `9`'s) 1. touch `[Job]`→`[Cycle]` - 1. Change `WORK SELECT` to `AUTO` + 1. change `WORK SELECT` to `AUTO` 1. touch `[Setup]`→`[Operate Cond.]` 1. change `CYCLE SWITCH IN REMOTE MODE` to `AUTO` From fe3ca5441a7bc7dff317432f24bb112bbd437e6b Mon Sep 17 00:00:00 2001 From: Ted Miller Date: Mon, 17 Jun 2024 08:12:40 -0400 Subject: [PATCH 10/10] clarify job-cycle when enabling motion modes --- doc/ros_api.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/ros_api.md b/doc/ros_api.md index 19bdf17e..0f4950b7 100644 --- a/doc/ros_api.md +++ b/doc/ros_api.md @@ -111,7 +111,8 @@ Note: errors and alarms which require physical operator intervention (e-stops, e Type: [motoros2_interfaces/srv/StartTrajMode](https://github.com/yaskawa-global/motoros2_interfaces/blob/d6805d32714df4430f7db3d8ddc736c340ddeba8/srv/StartTrajMode.srv) -Attempts to set cycle mode, enable servo drives, and activate trajectory mode, allowing the action server (`follow_joint_trajectory`, see below) to execute incoming `FollowJointTrajectory` action goals. +Attempts to enable servo drives, activate trajectory mode, and set the job-cycle mode to allow execution of INIT_ROS. +This allows the action server (`follow_joint_trajectory`, see below) to execute incoming `FollowJointTrajectory` action goals. Note: this service may fail if controller state prevents it from transitioning to trajectory mode. Inspect the `result_code` to determine the cause. @@ -123,7 +124,8 @@ The `reset_error` service can be used to attempt to reset errors and alarms. Type: [motoros2_interfaces/srv/StartPointQueueMode](https://github.com/yaskawa-global/motoros2_interfaces/blob/d6805d32714df4430f7db3d8ddc736c340ddeba8/srv/StartPointQueueMode.srv) -Attempts to set cycle mode, enable servo drives, and activate the point-queue motion mode, allowing the `queue_traj_point` service to execute incoming `QueueTrajPoint` requests. +Attempts to enable servo drives, activate the point-queue motion mode, and set the job-cycle mode to allow execution of INIT_ROS. +This allows the `queue_traj_point` service (see below) to execute incoming `QueueTrajPoint` requests. Note: this service may fail if controller state prevents it from transitioning to trajectory mode. Inspect the `result_code` to determine the cause.