UnderAutomation
Eine Frage?

[email protected]

Kontakt
UnderAutomation
⌘Q
Diese Seite ist nur auf Englisch verfügbar.

Motion

Move a Yaskawa robot from a PC: linear and joint moves to a Cartesian target, relative moves, moves in pulses, speed units, frames and posture.

  • Prerequisites
  • Cartesian move
  • Command type
  • Speed
  • Relative move
  • Joint move
  • Posture
  • End of the move
  • Try it in the demo application
  • Reference

This page shows how to move a Yaskawa Motoman robot from a PC with the SDK, without a job: Cartesian moves in mm and degrees, relative moves, and joint moves in pulses. The moves need the remote mode and the servo power.

Prerequisites

  • The controller accepts the remote commands: see Connect to your robot.
  • No alarm is active, and the robot is not held.
  • The servo power is on: ServoCommand(OnOffCommandType.Servo, true).

A move sent by the SDK is a real move of the robot. Test at low speed, in a cell with its safety functions active.

Cartesian move

MoveCartesian moves the tool center point to a position given in mm and degrees, in a frame.

var robot = new YaskawaRobot();
robot.Connect("192.168.0.1");
// The servo must be on, the controller in remote mode
robot.HighSpeedEServer.ServoCommand(OnOffCommandType.Servo, true);
// Linear move to an absolute position of the robot frame, at 50 mm/s
robot.HighSpeedEServer.MoveCartesian(
x: 850, y: 0, z: 400, // mm
rx: 180, ry: 0, rz: 0, // degrees
PositionCommandClassification.Cartesian_MM_S,
speed: 50,
PositionCommandOperationCoordinate.Robot,
commandtype: PositionCommandType.StraightAbsolute);
// Joint interpolated move to the same target, at 10 % of the maximum speed
robot.HighSpeedEServer.MoveCartesian(
850, 0, 400, 180, 0, 0,
PositionCommandClassification.LinkPercent,
speed: 10,
PositionCommandOperationCoordinate.Robot,
commandtype: PositionCommandType.LinkAbsolute);
robot.Disconnect();
}
Click to see the full code
ArgumentMeaning
x, y, zPosition, in mm
rx, ry, rzOrientation, in degrees
classificationUnit of speed, see below
speedSpeed of the move
coordinateFrame of the position: Base, Robot, User or Tool
posturePosture of the target, see below. null: the default posture
commandtypeAbsolute or relative move, see below. Default: StraightIncrement
RobotControlGroup, StationControlGroupRobot and station that move. Default: robot 1, no station
toolTool number. Default: 0
userCoordinateUser frame number, when coordinate is User. Default: 0

Command type

PositionCommandTypePathTarget
LinkAbsoluteJoint interpolatedThe position given
StraightAbsoluteStraight lineThe position given
StraightIncrementStraight lineThe current position plus the values given

The default command type of MoveCartesian is StraightIncrement: without commandtype, the values are an offset from the current position. Always pass commandtype when you give an absolute position.

Speed

PositionCommandClassificationUnit of speed
LinkPercentPercent of the maximum joint speed
Cartesian_MM_Smm/s of the tool center point
Cartesian_DEG_SDegrees/s of the orientation

Use LinkPercent with LinkAbsolute, and a Cartesian speed with the straight moves.

Relative move

With StraightIncrement, the values are an offset. The frame gives the direction of the offset: Base to move along the axes of the base, Tool to move along the axes of the tool.

var robot = new YaskawaRobot();
robot.Connect("192.168.0.1");
robot.HighSpeedEServer.ServoCommand(OnOffCommandType.Servo, true);
// Move the tool 20 mm up in the base frame, in a straight line at 20 mm/s.
// StraightIncrement is the default command type of MoveCartesian
robot.HighSpeedEServer.MoveCartesian(
0, 0, 20, 0, 0, 0,
PositionCommandClassification.Cartesian_MM_S,
speed: 20,
PositionCommandOperationCoordinate.Base,
commandtype: PositionCommandType.StraightIncrement);
// Move 10 mm along the Z axis of tool 1
robot.HighSpeedEServer.MoveCartesian(
0, 0, 10, 0, 0, 0,
PositionCommandClassification.Cartesian_MM_S,
speed: 20,
PositionCommandOperationCoordinate.Tool,
commandtype: PositionCommandType.StraightIncrement,
tool: 1);
robot.Disconnect();
}
Click to see the full code

Joint move

MoveJoints moves each axis to a position in pulses, the unit of GetRobotJointPosition.

var robot = new YaskawaRobot();
robot.Connect("192.168.0.1");
robot.HighSpeedEServer.ServoCommand(OnOffCommandType.Servo, true);
// Read the current pulses and change the first axis
int[] target = robot.HighSpeedEServer.GetRobotJointPosition().Axes;
target[0] += 10000;
// Joint interpolated move to absolute pulses, at 5 % of the maximum speed
robot.HighSpeedEServer.MoveJoints(
target,
PositionCommandClassification.LinkPercent,
speed: 5,
PositionCommandType.LinkAbsolute,
RobotControlGroup: 1,
StationControlGroup: 0);
robot.Disconnect();
}
Click to see the full code

Pass the command type LinkAbsolute and the speed in LinkPercent, as above. axesPulse has one value per axis, up to 8: start from the current pulses and change the axes you want to move.

Posture

A Cartesian position can be reached with several postures: arm in front or behind, upper or lower arm, wrist flipped or not, and the ranges of some axes. RobotPosture selects one. The posture of the current position is the Form of GetRobotCartesianPosition(): pass it to stay in the same configuration.

var robot = new YaskawaRobot();
robot.Connect("192.168.0.1");
// The posture of the current position
RobotPosture current = robot.HighSpeedEServer.GetRobotCartesianPosition().Form;
Console.WriteLine(current);
// A posture written field by field
var posture = new RobotPosture(
orientation: OrientationFlipInformation.Front,
arm: ArmFlipInformation.Upper,
flip: FlipNoFlipInformation.Flip);
// The posture selects one of the joint solutions of the Cartesian target
robot.HighSpeedEServer.MoveCartesian(
850, 0, 400, 180, 0, 0,
PositionCommandClassification.Cartesian_MM_S, 50,
PositionCommandOperationCoordinate.Robot,
posture: posture,
commandtype: PositionCommandType.StraightAbsolute);
robot.Disconnect();
}
Click to see the full code

In Python, create a posture with RobotPosture.from_integer(0), then set its fields.

End of the move

MoveCartesian and MoveJoints return when the controller accepts the move, not at the end of the move. To wait for the end, read the position until it reaches the target: see Move the robot from a PC.

To stop a move, hold the robot: ServoCommand(OnOffCommandType.Hold, true).

Try it in the demo application

Everything on this page can be tried without writing code, in the Move robot page of the demo application.

Move robot page of the Yaskawa SDK demo application

The demo application is open source. The C# source of this page is MoveControl.cs.

Reference

Methods of HighSpeedEServerClientBase :
C#
// Commands the robot to move to a Cartesian position (X, Y, Z, Rx, Ry, Rz). Movement is relative to the specified coordinate system.
RobotDataHeader MoveCartesian(double x, double y, double z, double rx, double ry, double rz, PositionCommandClassification classification, double speed, PositionCommandOperationCoordinate coordinate, RobotPosture posture = null, PositionCommandType commandtype = PositionCommandType.StraightIncrement, int RobotControlGroup = 1, int StationControlGroup = 0, int tool = 0, int userCoordinate = 0);
// Commands the robot to move using joint (pulse) positions. This specifies the position of each axis directly in encoder pulses.
RobotDataHeader MoveJoints(int[] axesPulse, PositionCommandClassification classification, double speed, PositionCommandType commandtype = PositionCommandType.StraightIncrement, int RobotControlGroup = 1, int StationControlGroup = 1, int tool = 0);
Enum
PositionCommandType
C#

Specifies the type of position command (motion instruction) to execute. Determines the path type and whether position is absolute or incremental.

NameValueDescription
LinkAbsolute
1
Link (joint interpolated) motion to an absolute position. All joints move simultaneously to reach the target, resulting in non-linear TCP path.
StraightAbsolute
2
Straight (linear interpolated) motion to an absolute position. TCP moves in a straight line to the target position.
StraightIncrement
3
Straight (linear interpolated) motion by an incremental offset. TCP moves in a straight line relative to current position.
Enum
PositionCommandClassification
C#

Specifies the speed classification (units) for motion commands. Determines how the speed value is interpreted by the controller.

NameValueDescription
Cartesian_DEG_S
2
Speed in degrees per second for rotational motion. Valid range depends on robot model.
Cartesian_MM_S
1
Speed in millimeters per second for linear motion. Valid range depends on robot model.
LinkPercent
0
Speed as percentage of maximum link (joint) speed. Valid range: 0.01 to 100.00 percent.
Enum
PositionCommandOperationCoordinate
C#

Specifies the coordinate system for position command interpretation. Determines how X, Y, Z, Rx, Ry, Rz values are interpreted.

NameValueDescription
Base
16
Base coordinate system (world frame at robot base). Fixed reference frame typically aligned with robot mounting.
Robot
17
Robot coordinate system. Reference frame at the robot's origin point.
Tool
18
Tool coordinate system. Reference frame at the tool center point (TCP).
User
19
User-defined coordinate system. Custom reference frame defined for specific workpiece or fixture.
Class
RobotPosture
C#

Represents the complete robot posture (form) configuration. Encodes the kinematic configuration choices that determine which of multiple inverse kinematics solutions is used to reach a Cartesian position.

MemberTypeDescription
RobotPosture()
Constructor
Creates a new RobotPosture with default values.
RobotPosture(int, int)
Constructor
Creates a new RobotPosture with specified form values.
  • form : Primary form byte value.
  • extendedForm : Extended form byte value.
RobotPosture(OrientationFlipInformation, ArmFlipInformation, FlipNoFlipInformation, AxisFlipInformation, AxisFlipInformation, AxisFlipInformation, OrientationFlipInformation, RegardedReversePositionSpecified, AxisFlipInformation, AxisFlipInformation, AxisFlipInformation, AxisFlipInformation, AxisFlipInformation)
Constructor
Creates a new RobotPosture with specified configuration values.
  • orientation : Front/back orientation configuration.
  • arm : Upper/lower arm configuration.
  • flip : Flip/no-flip wrist configuration.
  • rAxis : R-axis angle range configuration.
  • tAxis : T-axis angle range configuration.
  • sAxis : S-axis angle range configuration.
  • redundant : Redundant axis orientation configuration.
  • regardedReversePositionSpecified : Reverse position specification mode.
  • lAxis : L-axis angle range configuration.
  • uAxis : U-axis angle range configuration.
  • bAxis : B-axis angle range configuration.
  • eAxis : E-axis angle range configuration.
  • wAxis : W-axis angle range configuration.
Arm
Property
ArmFlipInformation
Gets or sets the upper/lower arm configuration based on L and U axis positions.
BAxis
Property
AxisFlipInformation
Gets or sets the B-axis (wrist bend) angle range configuration from extended form.
EAxis
Property
AxisFlipInformation
Gets or sets the E-axis (external/elbow) angle range configuration from extended form.
ExtendedForm
Property
int
Gets or sets the extended form byte for additional axis configurations. Bit-encoded: L-axis, U-axis, B-axis, E-axis, W-axis range flags.
Flip
Property
FlipNoFlipInformation
Gets or sets the flip/no-flip wrist configuration.
Form
Property
int
Gets or sets the primary form byte encoding basic posture flags. Bit-encoded: orientation, arm, flip, R-axis, T-axis, S-axis, redundant, reverse position.
LAxis
Property
AxisFlipInformation
Gets or sets the L-axis (lower arm) angle range configuration from extended form.
Orientation
Property
OrientationFlipInformation
Gets or sets the front/back orientation configuration. Specifies where the B-axis rotation center locates relative to the S-axis when viewing the L and U axes from the right-hand side.
RAxis
Property
AxisFlipInformation
Gets or sets the R-axis (wrist rotation) angle range configuration.
Redundant
Property
OrientationFlipInformation
Gets or sets the redundant axis orientation configuration (for 7+ axis robots).
RegardedReversePositionSpecified
Property
RegardedReversePositionSpecified
Gets or sets the reverse position specification mode.
SAxis
Property
AxisFlipInformation
Gets or sets the S-axis (base rotation) angle range configuration.
TAxis
Property
AxisFlipInformation
Gets or sets the T-axis (tool rotation) angle range configuration.
UAxis
Property
AxisFlipInformation
Gets or sets the U-axis (upper arm) angle range configuration from extended form.
WAxis
Property
AxisFlipInformation
Gets or sets the W-axis angle range configuration from extended form.
Default
Field
static
RobotPosture
Default posture with Form=0 and ExtendedForm=0.
Equals(object)
Method
bool
FromInteger(int)
Method
static
RobotPosture
Creates a RobotPosture from a combined 16-bit integer value.
  • value : Combined integer with Form in low byte and ExtendedForm in high byte.
GetHashCode()
Method
int
ToInteger()
Method
int
Converts the posture to a single 16-bit integer value. Form is stored in the low byte, ExtendedForm in the high byte.
ToString()
Method
string

Integrieren Sie Roboter von Universal Robots, Fanuc, Yaskawa, ABB oder Staubli ganz einfach in Ihre .NET-, Python-, LabVIEW- oder Matlab-Anwendungen

UnderAutomation
KontaktLegal

© All rights reserved.