Motion
Move a Yaskawa robot through the Ethernet Server: linear and joint moves to a Cartesian target in a frame, relative moves and moves to a target in pulses.
This page shows how to move a Yaskawa Motoman robot from a PC through the Ethernet Server, without a job: joint and linear moves to a Cartesian target, relative moves, and moves to a target in pulses. It covers the YRC1000 and YRC1000micro controllers.
Prerequisites
- The controller is in play mode and in remote mode, without alarm.
- The servo power is on:
SetServo(true). - The target is checked: the controller moves the real robot. Test at low speed first, in a cell with its safety functions active.
Move to a Cartesian target
var robot = new YaskawaRobot();robot.Connect(parameters);robot.EServer.SetServo(true);// Straight line to X=400 Y=0 Z=300 (mm), Rx=180 Ry=0 Rz=0 (degrees), at 50 mm/s, tool 0robot.EServer.MoveLinear(HostControlSpeedType.MillimetersPerSecond, 50,HostControlCoordinateSystem.Base, 400, 0, 300, 180, 0, 0);// Joint move to another target, at 10 % of the maximum speedrobot.EServer.MoveJoint(10, HostControlCoordinateSystem.Base, 400, 100, 300, 180, 0, 0);robot.Disconnect();}
| Method | Path | Speed |
|---|---|---|
MoveLinear | Straight line of the tool center point | HostControlSpeedType.MillimetersPerSecond or Percentage |
MoveJoint | Each joint moves to its target, the tool path is a curve | Percent of the maximum speed |
The target is X, Y, Z in mm and Rx, Ry, Rz in degrees, in the frame given by HostControlCoordinateSystem (base, robot, user frame 1 to 8 or tool). The last two optional parameters are:
type: the posture of the arm. Pass theTypeof a position read withGetRobotCartesianPosition()to keep its posture. See Positions.toolNumber: the tool, 0 to 63.
Relative move
MoveIncremental moves the robot by an offset from its current position, in a straight line. In the Tool frame, the offset follows the axes of the tool: X = 20 moves the tool 20 mm along its own X axis.
var robot = new YaskawaRobot();robot.Connect(parameters);robot.EServer.SetServo(true);// 50 mm up from the current position, at 20 mm/srobot.EServer.MoveIncremental(HostControlSpeedType.MillimetersPerSecond, 20,HostControlCoordinateSystem.Base, 0, 0, 50, 0, 0, 0);// 20 mm along the X axis of the toolrobot.EServer.MoveIncremental(HostControlSpeedType.MillimetersPerSecond, 20,HostControlCoordinateSystem.Tool, 20, 0, 0, 0, 0, 0);robot.Disconnect();}
Move to a target in pulses
MovePulseJoint and MovePulseLinear take the target of each axis in encoder pulses (S, L, U, R, B, T), as read with GetRobotJointPosition().
var robot = new YaskawaRobot();robot.Connect(parameters);robot.EServer.SetServo(true);// Joint move to a target in pulses (S, L, U, R, B, T), at 5 % of the maximum speedrobot.EServer.MovePulseJoint(5, 0, 0, 0, 0, 0, 0);// Linear move to a target in pulses, at 30 mm/sHostControlJointPositionData current = robot.EServer.GetRobotJointPosition();robot.EServer.MovePulseLinear(HostControlSpeedType.MillimetersPerSecond, 30,current.S + 1000, current.L, current.U, current.R, current.B, current.T);robot.Disconnect();}
End of the move
A move method returns when the controller answers. The SDK waits for this answer up to MotionTimeoutMilliseconds (30 s by default). To know that the robot has stopped, read GetStatusInformation().Running until it is false. To stop a move, hold the robot with SetHold(true).
Reference
Methods of HostControlClientBase :// Moves the robot incrementally using linear interpolation. Movement is relative to the current position.HostControlResponse MoveIncremental(HostControlSpeedType speedType, double speed, HostControlCoordinateSystem coordinateSystem, double dx, double dy, double dz, double drx, double dry, double drz, int toolNumber = 0);// Moves the robot to a Cartesian position using joint interpolation. Joint motion is faster but the path is not linear.HostControlResponse MoveJoint(int speedPercent, HostControlCoordinateSystem coordinateSystem, double x, double y, double z, double rx, double ry, double rz, int type = 0, int toolNumber = 0);// Moves the robot to a Cartesian position using linear interpolation. Linear motion follows a straight line path.HostControlResponse MoveLinear(HostControlSpeedType speedType, double speed, HostControlCoordinateSystem coordinateSystem, double x, double y, double z, double rx, double ry, double rz, int type = 0, int toolNumber = 0);// Moves the robot to a pulse position using joint interpolation.HostControlResponse MovePulseJoint(int speedPercent, int s, int l, int u, int r, int b, int t, int toolNumber = 0);// Moves the robot to a pulse position using linear interpolation.HostControlResponse MovePulseLinear(HostControlSpeedType speedType, double speed, int s, int l, int u, int r, int b, int t, int toolNumber = 0);
Specifies the speed type for motion commands.
| Name | Value | Description |
|---|---|---|
MillimetersPerSecond | 1 | Speed is specified in mm/s (VE). |
Percentage | 0 | Speed is specified as a percentage of maximum speed (V). |
Specifies the coordinate system for position commands.
| Name | Value | Description |
|---|---|---|
Base | 0 | Base coordinate system (robot base frame). |
Robot | 1 | Robot coordinate system. |
Tool | 16 | Tool coordinate system. |
User1 | 2 | User coordinate system 1. |
User2 | 3 | User coordinate system 2. |
User3 | 4 | User coordinate system 3. |
User4 | 5 | User coordinate system 4. |
User5 | 6 | User coordinate system 5. |
User6 | 7 | User coordinate system 6. |
User7 | 8 | User coordinate system 7. |
User8 | 9 | User coordinate system 8. |
What to read next
- Move the robot from a PC: which protocol to choose, and a complete program.
- Offline kinematics: check that a target can be reached before you send it.