-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Robot status motion possible flag incorrect when robot enable called during PFL stop #338
Comments
that would be interesting, as we're only at
Diff here. I see no changes to MotoROS here, only to the
What do you mean exactly by "enabled from ROS"? There is no explicit support for any PFL features in
This sounds a bit like #287. @ted-miller @EricMarcil: could it be that PFL status is not taken into account when calculating the values for those fields? |
I'm sorry, when I wrote this up I was a little hurried. I believe I am running MotoROS v1.9.0. Is there any way to check which version is installed on the controller? I am using the HC10 robot with the PFL feature turned on and sending motion commands to the robot from ROS. |
I don't believe so (not until we get #193 going). What you could do is copy the For
|
Yes, the Motion Ready signal was not reviewed for PFL when the HC-robot support was added. |
For the version, on DX200 and YRC1000, there is a MotoPlus Monitor button and you can list the MotoPlus application that are running. The version number is part of the application name. |
You can also see the version info directly on the regular pendant by touching [System] > [Version]. Then push the {PAGE} button a couple times. Also, when doing a system backup, this version info is exported to SYSTEM.SYS and PANELBOX.LOG. Of course, those version numbers are only valid if there have been no customization done to the MotoPlus code. |
MotoPlus support is being released with version 1.5 of the Smart Pendant. You can access the information under the Menu --> System Settings --> Controller Settings --> MotoPlus Management button. |
I was able to check today and I am running MotoROS v1.9.0. I also checked and the same issue is present when using the default branch of this Git repository. |
@CameronDevine It's an easy fix but I don't have an HC10 to confirm is my fix is working. I have tested that none HC10 robots are still working with the change. Let me know if that fixed it and I can start a PR to update the official version. |
@EricMarcil I should be able to test this on Thursday. |
@EricMarcil I tested your attached version of the MotoROS Server. For my needs it works correctly. However, I did notice two things:
|
Interesting, the in_motion flag is actually meant to indicate if the feedback position has reached command position. Normally, if it hasn't that means that the robot is still moving toward its destination. I don't think we have ever considered the state of that signal when the robot is stopped. Probably, when an alarm or hold signal is raised, the command position is reset to the current stopped position, so the In_Motion turns off. |
It sounds a simple solution could be to logically and the As for the |
Having tested this some more, I can confirm that when returning from a PFL stop the robot executes a portion of the remaining trajectory before stopping. |
My suggestion would be to change the line, sendMsg->body.robotStatus.in_motion = (int)(Ros_Controller_IsInMotion(controller)); in the sendMsg->body.robotStatus.in_motion = (int)(Ros_Controller_IsInMotion(controller) && Ros_Controller_IsMotionReady(controller)); |
@CameronDevine Thanks for letting me know. I definitely need to investigate this further but I'm on vacation until Aug 10th. |
@EricMarcil Unfortunately, I don't have the MotoPlus SDK. |
@CameronDevine I've started looking at the code. Your suggestion above might fix the status but it doesn't fix the fact that the robot can still move afterward. According to code, you shouldn't be able to move without re-enable the robot by sending a new trajectory. case IO_ROBOTSTATUS_PFL_STOP: // PFL Stop
case IO_ROBOTSTATUS_PFL_ESCAPE: // PFL Escaping
{
if (ioStatus[IO_ROBOTSTATUS_PFL_ESCAPE] == ON) // signal turned ON
{
// Job execution stopped take action
controller->bRobotJobReady = FALSE; //force job to be restarted with new ROS_CMD_START_TRAJ_MODE command
Ros_MotionServer_ClearQ_All(controller);
}
break;
} I think the problem might be that the IO_ROBOTSTATUS_PFL_STOP is ON but the IO_ROBOTSTATUS_PFL_ESCAPE is OFF. |
@EricMarcil this sounds correct based on what I have observed. If the robot stops due to PFL but does not attempt to escape a clamping situation, the trajectory will continue once the PFL resume button is pressed. However, if the robot attempts to escape a clamping situation, the trajectory will not continue after the PFL resume button is pressed. |
@CameronDevine is the inMotion signal correct when the robot attempts to escape? |
@EricMarcil I will have to check if that is the case. I'm not sure. |
@EricMarcil when the robot stops after attempting to escape the |
@EricMarcil I tried using the last file you sent; however, this caused a new issue to present itself. After a PFL stop the |
@CameronDevine Thanks for the feedback. This seems tricky to get all the correct signal state. I'll wait to get access to HC10 robot and do proper testing with it. Should be in the 1st week of September. |
@CameronDevine I believe that I've got everything working now. Please give this version a try. |
@EricMarcil I installed the version you sent yesterday; however, when I attempt to enable the robot I get this error:
|
That is strange. 5011 is basically saying that PFL was on. Which would mean that the Amber light button on the robot was on. The other possibility is that the input #4090 is on. That is something new that I added. It's from the Avoidance logic. This is normally not enabled but I figured I should check for it, in case someone wants to eventually use it. |
OK, I've revised the code to use #4089 which indicates the job interruption by the external force instead of #4090 which is the external force exceeding the avoidance start. You system probably isn't configured for avoidance, so it was probably detecting an avoidance level from the robot's own weight. Whenever the PFL (STOP, ESCAPE, AVOID) is detected, the robot trajectory mode will be stopped. So the INIT_ROS job will reach the END of the job and the trajectory mode will need to be restarted (I believe in ROS that corresponds to the Robot Enable.) I'm still debating on whether that is a correct approach or not. Technically, someone having a modified INIT_ROS job with some motion would see that motion executing after the Amber button is pressed. I could probably just do an explicit STOP but I need to check that doesn't interfere with the Escape motion that is to release something being pinned by the robot. Note: I did most of my testing using an internal none-ros application. I did some test with the basic Ros/MoveIt planning but that didn't seem to explicitly send the robot enable. So I had to manually start the robot job when testing with ROS. I'll try to program something be bit more elaborated for testing with ROS when I have a chance. |
@EricMarcil The most recent version is working much better. However, I do have one comment. After the robot has been stopped by the PFL function, the PFL Resume button must be pressed. At this point it appears the |
Has there been any progress on this off-list (ie: something which hasn't been reported here yet)? |
Sorry about that. I have to clean-up the code and finalize testing so that I can submit a PR. I should be getting access to an HC10 next week and try to finalize things. |
@CameronDevine If you have achance please text and review the PR #382. I actually lost the code changes that I had made and recoded everything. So please check if it behaves as the previous version that I had made for you. I've added information about the expected behavior. |
@EricMarcil thanks for letting me know. I'll try to test this out either this or next week. |
Summary: - Fixed motion_possible status when PFL is active - Added PFL Avoidance signal - Added PFL flag to prevent continuing previous motion after PFL activation Detailed description: MotoROS PFL Handling -------------------- Following the bug report ros-industrial#338 "Robot status motion possible flag incorrect when robot enable called during PFL stop" on the github motoman repo, the MotoROS PFL handling was review. It was found that if the robot is in PFL stop, and the `/robot_enable` service is called, the `motion_possible` flag in the `/robot_state` messages is set to `true`, but the robot cannot be moved. Furthermore, the PFL Avoidance mode was not originally covered. Under some PFL modes, some motion could occur after PFL activation completed but that motion was no longer synchronized with the desired ROS motion. PFL (Power Force Limiting) Overview ----------------------------------- The PFL (Power Force Limiting) function of the HC-series robots has 3 modes of operations: - Transient Contact: Temporary contact caused by the robot hits something, or something hits the robot. Robot stops and the amber light button on the upper arm turns on. When the amber light button is press, the light turns off and the motion is resumes. - Quasi-Static Contact: Similar to the transient contact but the contact is maintained, like hitting a table or a wall. After stopping, if an external force is maintained, the robot will move away from the exerted force to release the pressure and then stop again. The amber light button on the upper arm turns back on. When the amber light button is press, the light turns off and the motion is resumed. - Avoidance: A low external force is applied to move the robot from its current trajectory. Once the force is removed, the robot will move back to the position where the external force was originally applied. Then the robot resumes its original path. Note that some modes may be disabled on some systems. ROS Handling of PFL ------------------- The PFL function, being a safety feature, supersedes any motion from ROS. The PFL normal behavior should be allowed to take place and ROS should not interfere with it by sending stop motion while the PFL function is active. When ROS is moving the robot, since the motion path is coming from an external source and the position of the robot may have changed following the activation of PFL, MotoROS will cancel the current trajectory following the PFL activation. Following the PFL activation any joint trajectory message sent to the controller will return the `ROS_RESULT_NOT_READY_PFL_ACTIVE` code `5011`. The status bit `in_motion` will be `false` when the robot is not moving. It may temporarily turn on in PFL's *Quasi-Static Contact* mode as the robot moves away to release pressure on the impact point. The status bit `motion_possible` (ready) will be `false` and remain `false` until the `/robot_enable` service is called (Start trajectory mode message `ROS_MSG_MOTO_MOTION_CTRL` message `2001` with the `ROS_CMD_START_TRAJ_MODE` command `200121`). When `motion_possible` is `true` again, the current robot position can be acquired by ROS and a new trajectory to resume motion can be planned and sent to the controller. Code Change ----------- Code change essentially consists of adding new I/O signals to capture the avoidance mode: - `IO_ROBOTSTATUS_PFL_AVOIDING` (15120) - `IO_ROBOTSTATUS_PFL_AVOID_JOINT` (15124) - `IO_ROBOTSTATUS_PFL_AVOID_TRANS` (15125) The `IO_ROBOTSTATUS_PFL_AVOIDING` signal indicates that a force above the avoidance threshold was detected. The signals `IO_ROBOTSTATUS_PFL_AVOID_JOINT` and `IO_ROBOTSTATUS_PFL_AVOID_TRANS` only indicate that the avoidance mode is enabled. So, the `IO_ROBOTSTATUS_PFL_AVOIDING` signal should only be considered if one of the other two signals is on. And a new flag `bool bPFLduringRosMove` was added to the `Controller` class to track that PFL was activated. Finally, logic to manage the detection and reset of the PFL flag was added.
I believe this issue should be closed now because #382 was merged. |
@CameronDevine Thanks for the help on this. |
I am controlling a Yaskawa HC10 with the power force limiting features enabled from ROS. I have found that if the robot is in PFL stop, and the
/robot_enable
service is called, themotion_possible
flag in the/robot_state
messages is set to true, but the robot cannot be moved.I am using my own branch of
motoman_driver
(with the master branch recently merged in) available here, https://github.com/CameronDevine/motoman/tree/point-streaming-with-ioI believe I am using MotoROS v3.6.0, but I can check early next week. I am also planning to test this with the current master branch.
The text was updated successfully, but these errors were encountered: