Arm#
Introduction#
The 6-Axis Robotic Arm is a robotic manipulator used in the CTE Workcell. In VEXcode EXP, Arm blocks allow an EXP Brain to move the 6-Axis Arm, rotate its end effector, check whether movements are possible, and control attached tools such as the Magnet Pickup Tool or Pen Holder Tool.
This page is for CTE Workcell projects where the 6-Axis Arm is connected to an EXP Brain. If you are using the 6-Axis Arm on its own with the CTE Tile, use the CTE Arm API page instead.
Below is a list of available blocks:
Actions — Move the 6-Axis Arm to positions or orientations.
move arm to position — Moves the 6-Axis Arm to a specified x, y, and z coordinate.
increment arm position — Moves the 6-Axis Arm by a distance from its current position.
move arm to orientation — Rotates the end effector to a specified orientation.
increment arm orientation — Rotates the end effector by a specified number of degrees.
Settings — Configure movement, tools, and control settings.
set arm speed — Sets the movement speed of the 6-Axis Arm.
set arm end effector — Selects the tool attached to the 6-Axis Arm.
set arm magnet mode — Engages or releases the Magnet Pickup Tool.
set arm pen offset — Sets the vertical offset for the Pen Holder Tool.
set arm to control stopped — Stops the 6-Axis Arm and prevents further Arm movement.
Values — Check whether a movement can run, whether movement has finished, whether a crash has occurred, read the current position or orientation, or run blocks when Arm events occur.
arm move to position? — Returns whether the 6-Axis Arm can move to a specified position.
arm increment position? — Returns whether the 6-Axis Arm can move by a specified distance.
arm move end effector? — Returns whether the end effector can rotate to a specified orientation.
arm increment orientation? — Returns whether the end effector can rotate by a specified number of degrees.
arm is done moving? — Returns whether the 6-Axis Arm has finished moving.
arm is crashed? — Returns whether the 6-Axis Arm has crashed while moving.
arm position — Returns the current position of the 6-Axis Arm along a selected axis.
arm orientation — Returns the current orientation of the end effector along a selected axis.
when arm control stopped — Runs the attached stack when control stop is enabled.
when arm crashed — Runs the attached stack when a crash is detected.
Actions#
move arm to position#
The move arm to position stack block moves the 6-Axis Arm to a specified x, y, and z coordinate.
The x, y, and z coordinates describe the position of the end effector in three-dimensional space. Use arm move to position? before this block if the target position may be outside the 6-Axis Arm’s reachable workspace.
move [Arm1 v] to position x:[120] y:[0] z:[100] [mm v] ▶
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
x |
The x-coordinate of the target position. |
y |
The y-coordinate of the target position. |
z |
The z-coordinate of the target position. |
unit |
The unit used for the x, y, and z coordinates: mm (millimeters) or inches. |
expanding arrow |
By default, the 6-Axis Arm finishes moving before the next block runs. Expand the block to and don’t wait to start the movement and immediately continue to the next block. |
Example
when started
[Move Arm1 to a standard position at the start of the project.]
move [Arm1 v] to position x:(120) y:(120) z:(75) [mm v] ▶
increment arm position#
The increment arm position stack block moves the 6-Axis Arm by a specified distance from its current position along the x, y, and z axes.
Use this block to move relative to where the end effector is now. Use arm increment position? before this block if the movement may place the 6-Axis Arm outside its reachable workspace.
increment [Arm1 v] position by x:[0] y:[0] z:[0] [mm v] ▶
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
x |
The distance to move along the x-axis. |
y |
The distance to move along the y-axis. |
z |
The distance to move along the z-axis. |
unit |
The unit used for the x, y, and z distances: mm (millimeters) or inches. |
expanding arrow |
By default, the 6-Axis Arm finishes moving before the next block runs. Expand the block to and don’t wait to start the movement and immediately continue to the next block. |
Example
when started
[Move Arm1 100 millimeters along the x-axis.]
increment [Arm1 v] position by x:[100] y:[0] z:[0] [mm v] ▶
move arm to orientation#
The move arm to orientation stack block rotates the end effector to a specified orientation.
Orientation describes how the end effector is rotated. pitch tilts the end effector up or down, roll rotates it side to side, and yaw rotates it left or right.
move [Arm1 v] to orientation [pitch v] [0] degrees ▶
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
orientation |
The axis to rotate the end effector around:
|
degrees |
The target orientation angle, in degrees. |
expanding arrow |
By default, the 6-Axis Arm finishes moving before the next block runs. Expand the block to and don’t wait to start the movement and immediately continue to the next block. |
Example
when started
[Rotate the end effector to 270 degrees of yaw.]
move [Arm1 v] to orientation [yaw v] [270] degrees ▶
increment arm orientation#
The increment arm orientation stack block rotates the end effector by a specified number of degrees from its current orientation.
Use this block to rotate relative to the end effector’s current pitch, roll, or yaw.
increment [Arm1 v] orientation by [pitch v] [0] degrees ▶
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
orientation |
The axis to rotate the end effector around:
|
degrees |
The number of degrees to rotate the end effector. |
expanding arrow |
By default, the 6-Axis Arm finishes moving before the next block runs. Expand the block to and don’t wait to start the movement and immediately continue to the next block. |
Example
when started
[Rotate the end effector 40 degrees in pitch.]
increment [Arm1 v] orientation by [pitch v] [40] degrees ▶
Settings#
set arm speed#
The set arm speed stack block sets the movement speed of the 6-Axis Arm.
The 6-Axis Arm speed is set to 50% at the start of a project.
set [Arm1 v] speed to [50]%
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
percent |
The movement speed of the 6-Axis Arm, from 1 to 100 percent. |
Example
when started
[Set Arm1's speed to 30%.]
set [Arm1 v] speed to [30]%
move [Arm1 v] to position x:[120] y:[120] z:[70] [mm v] ▶
set arm end effector#
The set arm end effector stack block selects the tool attached to the 6-Axis Arm.
When the end effector is changed, the 6-Axis Arm automatically adjusts its z-offset to match the selected tool. The end effector is set to the Magnet Pickup Tool at the start of a project.
set [Arm1 v] end effector to [magnet v]
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
end effector |
The tool attached to the 6-Axis Arm: magnet (Magnet Pickup Tool) or pen (Pen Holder Tool). |
Example
when started
[Set Arm1 to use the Pen Holder Tool.]
set [Arm1 v] end effector to [pen v]
set arm magnet mode#
The set arm magnet mode stack block engages or releases the Magnet Pickup Tool.
The magnet mode stays active until another set arm magnet mode block changes it. The magnet mode is reset to released at the start of a project.
set [Arm1 v] magnet to [engaged v]
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
mode |
The Magnet Pickup Tool state: engaged to pick up objects or released to drop any held object and not pick up new objects. |
Example
when started
[Pick up objects, then drop them after 2 seconds.]
set [Arm1 v] magnet to [engaged v]
wait [2] seconds
set [Arm1 v] magnet to [released v]
set arm pen offset#
The set arm pen offset stack block sets the vertical offset for the Pen Holder Tool.
Set the end effector to pen before using this block. If the Pen Holder Tool is not selected, this block has no effect.
The pen offset is the distance from the top of the Pen Holder Tool to the tip of the Dry-Erase Marker. At the start of a project, the pen offset is set to 0. A pen offset of 0 places the arm’s z-axis origin at the point where the Pen Holder Tool connects to the 6-Axis Arm.
set [Arm1 v] pen offset to [0] [mm v]
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
offset |
The pen offset value. |
unit |
The unit used for the pen offset: mm (millimeters) or inches. |
Example
when started
[Set the end effector to the Pen Holder Tool and set the pen offset to 1 inch.]
set [Arm1 v] end effector to [pen v]
set [Arm1 v] pen offset to [1] [inches v]
move [Arm1 v] to position x:[120] y:[120] z:[0] [mm v] ▶
set arm to control stopped#
The set arm to control stopped stack block immediately stops the 6-Axis Arm and prevents any more Arm blocks from running.
Once this block runs, the 6-Axis Arm cannot be re-enabled until the project is restarted.
set [Arm1 v] to control stopped
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
Example
when started
[Control stop after a movement.]
move [Arm1 v] to position x:[120] y:[120] z:[70] [mm v] ▶
set [Arm1 v] to control stopped
Values#
arm move to position?#
The arm move to position? Boolean block returns whether the 6-Axis Arm can move to a specified x, y, and z coordinate.
This block checks a target position before the 6-Axis Arm moves. It can help prevent a project from trying to move the arm outside its reachable workspace.
<[Arm1 v] move to position x:[0] y:[0] z:[0] [mm v] ?>
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
x |
The x-coordinate of the target position. |
y |
The y-coordinate of the target position. |
z |
The z-coordinate of the target position. |
unit |
The unit used for the x, y, and z coordinates: mm (millimeters) or inches. |
Example
when started
[Check if Arm1 can move to a position.]
if <not <[Arm1 v] move to position x:[0] y:[0] z:[0] [mm v] ?>> then
print [The 6-Axis Arm can't move to this position.] on screen ▶
end
arm increment position?#
The arm increment position? Boolean block returns whether the 6-Axis Arm can move the specified distance from its current position.
This block checks an incremental movement before the 6-Axis Arm moves.
<[Arm1 v] increment position by x:[0] y:[0] z:[0] [mm v] ?>
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
x |
The distance to move along the x-axis. |
y |
The distance to move along the y-axis. |
z |
The distance to move along the z-axis. |
unit |
The unit used for the x, y, and z distances: mm (millimeters) or inches. |
Example
when started
[Check if Arm1 can increment from its current position.]
if <not <[Arm1 v] increment position by x:[0] y:[500] z:[0] [mm v] ?>> then
print [The 6-Axis Arm can't move that distance.] on screen ▶
end
arm move end effector?#
The arm move end effector? Boolean block returns whether the end effector can rotate to a specified orientation.
Use this block to check whether a target pitch, roll, or yaw value is within the allowed range before rotating the end effector.
<[Arm1 v] move end effector to [pitch v] [0] degrees?>
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
orientation |
The axis to rotate the end effector around:
|
degrees |
The target orientation angle, in degrees. |
Example
when started
[Check if Arm1 can roll its end effector to an orientation.]
if <[Arm1 v] move end effector to [roll v] [40] degrees?> then
print [The end effector can roll to that orientation.] on screen ▶
end
arm increment orientation?#
The arm increment orientation? Boolean block returns whether the end effector can rotate by a specified number of degrees from its current orientation.
Use this block to check an incremental pitch, roll, or yaw movement before rotating the end effector.
<[Arm1 v] increment orientation by [pitch v] [0] degrees?>
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
orientation |
The axis to rotate the end effector around:
|
degrees |
The number of degrees to rotate the end effector. |
Example
when started
[Check if Arm1 can increment yaw.]
if <[Arm1 v] increment orientation by [yaw v] [20] degrees?> then
print [The end effector can increment yaw by 20 degrees.] on screen ▶
end
arm is done moving?#
The arm is done moving? Boolean block returns whether the 6-Axis Arm has finished moving.
This block is useful after a movement block is expanded to and don’t wait.
<[Arm1 v] is done moving?>
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
Example
when started
[Display the current y-position while Arm1 moves.]
move [Arm1 v] to position x:(-100) y:(200) z:(100) [mm v] ◀ and don't wait
repeat until <[Arm1 v] is done moving?>
print ([Arm1 v] position [y v] in [mm v]) on screen ◀ and set cursor to next row
wait [0.25] seconds
end
arm is crashed?#
The arm is crashed? Boolean block returns whether the 6-Axis Arm has crashed while moving.
When a crash is detected, the 6-Axis Arm stops motor movement and may appear to go limp. This reduces strain and helps protect the motors from accidental damage.
<[Arm1 v] is crashed?>
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
Example
when started
[Quickly move to the specified location.]
set [Arm1 v] speed to [100] %
move [Arm1 v] to position x: [-20] y: [240] z: [40] [mm v] ◀ and don't wait
[While moving, check for a crash.]
forever
if <[Arm1 v] is crashed?> then
[Indicate a crash with the Signal Tower and Brain screen.]
print [Crash Detected] on screen ▶
set [SignalTower2 v] to [green v] and [off v]
set [SignalTower2 v] to [red v] and [solid v]
break
end
end
arm position#
The arm position reporter block returns the current position of the 6-Axis Arm along a selected axis.
Use this block to read where the end effector is currently located along the x, y, or z axis.
([Arm1 v] position [x v] in [mm v])
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
axis |
The position axis to report:
|
unit |
The unit used for the position value: mm (millimeters) or inches. |
Example
when started
[Display the current y-position while Arm1 moves.]
move [Arm1 v] to position x:(-100) y:(200) z:(100) [mm v] ◀ and don't wait
repeat until <[Arm1 v] is done moving?>
print ([Arm1 v] position [y v] in [mm v]) on screen ◀ and set cursor to next row
wait [0.25] seconds
end
arm orientation#
The arm orientation reporter block returns the current orientation of the end effector about a selected axis in degrees.
Use this block to read the end effector’s current pitch, roll, or yaw.
([Arm1 v] orientation [pitch v] in degrees)
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
orientation |
The orientation axis to report:
|
Example
when started
[Display the current yaw after rotating the end effector.]
move [Arm1 v] to orientation [yaw v] [90] degrees ◀ and don't wait
repeat until <[Arm1 v] is done moving?>
print ([Arm1 v] orientation [yaw v] in degrees) on screen ◀ and set cursor to next row
wait [0.25] seconds
end
when arm control stopped#
The when arm control stopped Hat block runs the attached stack when the 6-Axis Arm’s control stop has been enabled.
when [Arm1 v] control stopped :: hat events
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
when arm crashed#
The when arm crashed Hat block runs the attached stack when the 6-Axis Arm has crashed while moving.
When a crash is detected, the 6-Axis Arm stops motor movement and may appear to go limp. This reduces strain and helps protect the motors from accidental damage.
when [Arm1 v] crashed :: hat events
Parameter |
Description |
|---|---|
device |
The configured 6-Axis Arm to use. |
Example
when [Arm1 v] crashed :: hat events
[Indicate a crash with the Signal Tower and Brain screen.]
print [Crash Detected] on screen ▶
set [SignalTower2 v] to [red v] and [solid v]