# 🦾Teach & Pneumatic

{% hint style="success" %}
**📅Update: 2020/08/17**
{% endhint %}

## Table of Contents&#x20;

{% hint style="info" %}
​​ :man\_mage: **Tips:** You can also click the TOP RIGHT **table of contents** to read the corresponding section​ 👉
{% endhint %}

[1) Teach & Pneumatic Workflow  ](#1-teach-and-pneumatic-workflow)

[2) Set Up for First Use](#2-set-up-for-first-use)

[3) Use Basic Functions ](#3-use-basic-functions)

[4) Teach & Playback](#4-teach-and-playback)

[5) Use Pneumatic Functions with G-code](#5-use-pneumatic-functions-with-g-code-programming)

## 1. Teach & Pneumatic Workflow

[Step 1: Set up Pneumatic Kit and Air Pump Box](#2-set-up-for-first-use)

[Step 2: Start Teach & Play with Rotrics Studio / Touchscreen](#4-teach-and-playback)

## 2. Set Up for First Use

Read the [**Quick Start Guide**](https://cdn.shopifycdn.net/s/files/1/0255/0195/8216/files/Rotrics_DexArm_Quick_Start_Webview_V1.0.2.pdf?v=1594021017) to check the items, assemble the pneumatic module, connect with Air Pump Box and set up DexArm for the first use.

{% hint style="info" %}
:man\_mage: **Tips:** The **M-shape** plastic part is for mounting the transparent air tube on DexArm. <img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MEw32-H1W6J9L3qD1Zp%2F-MEw4N3sB1x6wXI7g4ID%2FSnipaste_2020-08-17_19-01-53.png?alt=media&#x26;token=4996c76f-289c-4f45-81d2-14768074be72" alt="" data-size="original">&#x20;
{% endhint %}

## 3. Use Basic Functions

### Pneumatic Module Status

**1) Air pump box working status**

The air pump box has 3 working status:

* Pump in
* Pump out
* Release air
* Close all pumps

**2) Suction cup working status**

The suction cup has 2 working status:&#x20;

* Pick (pump in)
* Place (pump out)

So you only need to control Air Pump Box to pump in or pump out for a picking/placing task.&#x20;

**3) Soft gripper working status**

The soft gripper has 3 working status:&#x20;

* Pick (pump out)
* Place (pump in)
* Neutral (release air)

Except for pump in and pump out, you need to return soft gripper to neutral status after each action is done.

### With Rotrics Studio software

#### 1) Clic&#x6B;**`Basic -> Front End`**&#x74;o choose relevant modules.

![](https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MBy-dDityiosQ5o2mp6%2F-MBy0OyKlR5Z2K08Cu-1%2Fimage.png?alt=media\&token=6fc887b4-2c9e-4b51-87e9-3a33cf7750ad)

#### 2) Clic&#x6B;**`Pick / Place`**&#x75;nder Air Pick o&#x72;**`Grip / Release / Neutral`**&#x75;nder Soft Gripper to control pneumatic functions.

![](https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MBy-dDityiosQ5o2mp6%2F-MBy0bTBqR-v-5nE_dtA%2Fimage.png?alt=media\&token=64862f99-9a0e-4e9e-8ea3-a2fda5e51a1f)

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MBy-dDityiosQ5o2mp6%2F-MBy0fX3ewVmVGoWOyGW%2Fimage.png?alt=media&#x26;token=13669b9b-9ecc-4b3f-8a91-bb0782e58ecf" alt=""></div>

#### 3) After picking items up, clic&#x6B;**`X±、Y±、Z±`**&#x62;uttons i&#x6E;**`Control`**&#x73;ection to control DexArm's movement.&#x20;

![](https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MBy-dDityiosQ5o2mp6%2F-MBy0uI9WZNWIpJsMuoH%2Fimage.png?alt=media\&token=d2be011a-cc64-413f-882d-defacb613afc)

### With Touchscreen

#### 1) Connect the touchscreen with the robot arm, clic&#x6B;**`Pneumatic`**&#x74;o select the module.

Here, we are using Air Pick as an example.

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M7RnJ-rk83ytK6VlG2F%2F-M7Rnd2AjBKeHbPZ8OIJ%2Fimage.png?alt=media&#x26;token=bcbe589f-4471-4473-b1e7-c857c04034f4" alt=""></div>

#### 2) Click **`HOME`** to move DexArm to the  HOME position first.

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M7RnJ-rk83ytK6VlG2F%2F-M7Rnm_zIDCDroK1uuKh%2Fimage.png?alt=media&#x26;token=a5202388-1ba0-4695-8f11-208ab5f39459" alt=""></div>

#### 3) Click `X±、Y±、Z±` buttons to move DexArm to the item position.

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M7RnJ-rk83ytK6VlG2F%2F-M7Rny_8hQ2PcpfqM3Ut%2Fimage.png?alt=media&#x26;token=a961e243-0dfc-4e84-8060-28693bdaca97" alt=""></div>

#### 4. Click **`Pick`** to pick up the item.&#x20;

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M7RnJ-rk83ytK6VlG2F%2F-M7Ro8Wz13ggP_zRq2VP%2Fimage.png?alt=media&#x26;token=87dce1c2-8620-4c01-b926-963c572fc330" alt=""></div>

#### 5. Click X±、Y±、Z± buttons to move the item to the destination

#### 6. Click Place to place the item.&#x20;

#### 7. Repeat Step 3-6 to move all the items.

#### 8. Click `Stop` to turn OFF Air Pump Box after finished.&#x20;

## 4. Teach & Playback

Rotrics Studio software can control the picking/placing functions and record robot arm movements, you can also control robot arm movement with G-code programming.

### With Rotrics Studio software

#### 1) Clic&#x6B;**`Basic -> Teach & Play -> On`**&#x74;o enter Teach\&Play mode.&#x20;

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MBy-dDityiosQ5o2mp6%2F-MBy1uXMle1qA_5xu937%2Fimage.png?alt=media&#x26;token=debe4ede-a9f8-49f6-b5a7-fc230cd1931a" alt=""></div>

After turn on the teach\&playback function, select the right module and click OK.

![](https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MBy-dDityiosQ5o2mp6%2F-MBy2Gd1S45ouF8qaJwD%2Fimage.png?alt=media\&token=424c9613-9faa-4966-9a9b-a8eb4be7e6fa)

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MBy-dDityiosQ5o2mp6%2F-MBy2V3YQJQ8YHxNIZbs%2Fimage.png?alt=media&#x26;token=f36bff4f-5750-4416-97c2-019baed5ff3c" alt=""></div>

#### 2) Drag the Arm to a position and click <img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MEvs9GtbQYxqp23K-UH%2F-MEw-fnMzlytfrQjb5Uy%2FSnipaste_2020-08-17_18-37-59.png?alt=media&#x26;token=c508d91c-6d85-4411-89cc-5e5f466eddc3" alt="" data-size="original">**`Record`** to record this position and module status

There will be a new record in the Record List

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MBy-dDityiosQ5o2mp6%2F-MBy2ykdVIr9H1SH6p9M%2Fimage.png?alt=media&#x26;token=05a01fe7-4b78-4357-9636-b1720e8d888a" alt=""></div>

#### 3) Click Pick to pick the item up, and click<img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MEvs9GtbQYxqp23K-UH%2F-MEw-fnMzlytfrQjb5Uy%2FSnipaste_2020-08-17_18-37-59.png?alt=media&#x26;token=c508d91c-6d85-4411-89cc-5e5f466eddc3" alt="" data-size="original"> **`Record`** to record this position and module status

{% hint style="info" %}
:man\_mage: **Tips:** if you are using soft gripper for Teach & Playback, please click **`Release`** before **`Grip`** item, lower the module to relevant position and then **`Grip`**.
{% endhint %}

![](https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MBy-dDityiosQ5o2mp6%2F-MBy3iIOUWK-7qw3rhn_%2Fimage.png?alt=media\&token=531f5737-6032-44c7-983e-6bcd753ccb26)

#### 4) Move up for a target distance( such 5cm), and click<img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MEvs9GtbQYxqp23K-UH%2F-MEw-fnMzlytfrQjb5Uy%2FSnipaste_2020-08-17_18-37-59.png?alt=media&#x26;token=c508d91c-6d85-4411-89cc-5e5f466eddc3" alt="" data-size="original"> **`Record`** to record this position and module status.&#x20;

{% hint style="info" %}
:man\_mage: **Tips:** In order to prevent DexArm from accidentally colliding with the object during the movement, it is necessary to let the Arm move according to the trajectory of **∏**, which means to lift a certain distance, then move to a position above the target point, and then move down.
{% endhint %}

#### 5) Drag DexArm to a position 5cm higher than the target position, and click <img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MEvs9GtbQYxqp23K-UH%2F-MEw-fnMzlytfrQjb5Uy%2FSnipaste_2020-08-17_18-37-59.png?alt=media&#x26;token=c508d91c-6d85-4411-89cc-5e5f466eddc3" alt="" data-size="original">**`Record`** to record this position and module status.&#x20;

#### 6) Drag the Arm to the target position, and click Place to place item down. Click <img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MEvs9GtbQYxqp23K-UH%2F-MEw-fnMzlytfrQjb5Uy%2FSnipaste_2020-08-17_18-37-59.png?alt=media&#x26;token=c508d91c-6d85-4411-89cc-5e5f466eddc3" alt="" data-size="original"> **`Record`** to record this position and module status.&#x20;

#### 7) Click **`Off`** button beside Teach & Play Mode to complete teaching.&#x20;

#### 8) Scroll Record List, and check all recorded action. Clic **`Set Delay`** to add waiting time between every action.&#x20;

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MBy-dDityiosQ5o2mp6%2F-MBy4Ka0ojPt5d7IXi2o%2Fimage.png?alt=media&#x26;token=28e6e0c5-7d8d-4fd3-8d64-549fea36c949" alt=""></div>

#### 9) Click <img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MEvs9GtbQYxqp23K-UH%2F-MEw-01KegfZGYqOhQrg%2FSnipaste_2020-08-17_18-38-15.png?alt=media&#x26;token=0bee688f-62b5-4aa3-a0da-bbb41413f61a" alt="" data-size="original"> to playback all the actions.

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-MBy-dDityiosQ5o2mp6%2F-MBy4UijFFvqb0M9fo6g%2Fimage.png?alt=media&#x26;token=b5aca395-8e63-4e18-a55a-b43f40501e71" alt=""></div>

### With Touchscreen&#x20;

#### 1) Connect the touchscreen with the robot arm, clic&#x6B;**`Basic -> Reset -> Home`**&#x74;o move DexArm to HOME position.

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M7RxAF5qhVwVwq2Di8O%2F-M7Rzg84DEyRAGZ2NfQA%2Fimage.png?alt=media&#x26;token=6e82531f-6926-426f-8d46-c295a4f2c7e9" alt=""></div>

#### 2) Click **`Teach -> Air Pick / Soft Gripper`**.

Here we use Air Pick as an example.&#x20;

![](https://gblobscdn.gitbook.com/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M5_wyp3cA9Lpbm6mtfX%2F-M5aCaK-TF-Vcf-5XvWJ%2Fimage.png?alt=media\&token=13b418cb-61a5-4620-896d-3e7d9fba2048)

#### 3) Click `DISABLE` to start Teach\&Play,

<div align="left"><img src="https://2132465959-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M7RxAF5qhVwVwq2Di8O%2F-M7RzzmR2aT5wyKU-teu%2Fimage.png?alt=media&#x26;token=09c7cc64-3408-46e6-9590-710c09946bdd" alt=""></div>

{% hint style="info" %}
:man\_mage: **Tips:** DISABLE will disable the motor, and allow you to drag the arm
{% endhint %}

#### 4) Drag the Rotrics Arm and move it to the target position.

#### 5) Tap **`PICK`** to pick the item up.

![](https://gblobscdn.gitbook.com/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M5_wyp3cA9Lpbm6mtfX%2F-M5aC48XymjydO-wlyF-%2Fimage.png?alt=media\&token=2e4c5f6c-ce8d-4331-83a2-e08129f26f12)

#### 6) Click **`RECORD`**&#x74;o record this position and the module status

![](https://gblobscdn.gitbook.com/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M5_wyp3cA9Lpbm6mtfX%2F-M5aCPWXBjett0NCcF6K%2Fimage.png?alt=media\&token=afc50d76-dcc4-45b8-a1fe-43e133157fc0)

#### 7) Drag the arm to another position, click `PLACE` to place item down![](https://gblobscdn.gitbook.com/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M5_wyp3cA9Lpbm6mtfX%2F-M5aCLbRkq0vMAE0rnUc%2Fimage.png?alt=media\&token=bb1ef465-93e7-406e-8166-918883edbdfa)

#### &#x20;8) Click `RECORD` to record this position and the module status

![](https://gblobscdn.gitbook.com/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M5_wyp3cA9Lpbm6mtfX%2F-M5aCPWXBjett0NCcF6K%2Fimage.png?alt=media\&token=afc50d76-dcc4-45b8-a1fe-43e133157fc0)

#### 9) Repeat Step 4-8 to record every action and position.

![](https://gblobscdn.gitbook.com/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M5_wyp3cA9Lpbm6mtfX%2F-M5aCaK-TF-Vcf-5XvWJ%2Fimage.png?alt=media\&token=13b418cb-61a5-4620-896d-3e7d9fba2048)

{% hint style="info" %}
:man\_mage: **Tips:** You can add waiting time after each action, so the Arm will wait a few seconds before each action.
{% endhint %}

#### 10) Click **`REPLAY`** to play the whole process.

![](https://gblobscdn.gitbook.com/assets%2F-LtPFIBncU5l4J8tl5Yh%2F-M5_wyp3cA9Lpbm6mtfX%2F-M5aChTKdxk6G4doWWCQ%2Fimage.png?alt=media\&token=de90ab49-44cf-40c0-b8b1-7334ff728d62)

### Function Update

**Old Version**&#x20;

* `M893` obtain the magnetic encoder position;&#x20;
* `M894` move to the magnetic encoder position;
* The above commands remain in the new version.

\
**New Version (for firmware V2.2.0 and above)**

* **`M895`** inversely obtains the front end module position via the magnetic encoder value and the module off-set value.&#x20;
* **`M896`** moves to a specified position under Fast, Line, Jump moving mode.

**P0-2**, corresponding to the three moving modes of Fast, Line, and Jump respectively. The default is Fast mode.

* **Fast mode** corresponds to `G0` or `M2001`,
* **Line mode** corresponds to `G1` or `M2000`, added over-limit detection of interpolation points during line mode,&#x20;
* **Jump mode** is divided into three steps, from the current position to raise the height of H, move horizontally to the target position, and move vertically to the target position.
* **F** corresponds to the moving speed, H corresponds to Jump height, the F default value is 3000unit/min, the H default value is 50mm.&#x20;

\
**Sample**Obtain the current position

* Send: ​`M895`​
* recv: ​`X:0.00 Y:320.00 Z:0.00​`

Set to tech\&play and setup JUMP height, ​`M896 P2 F5000 H20`, ​Move to the target position, `​M896 X0 Y320 Z0`\
**Function Updated**-In the previous version, the target position is not exceeding the limit, but the interpolation point goes beyond the limits during line mode. In the new version, the over-limit detection of the interpolation point is added during Line Mode under `G1` and `M2000`.\
-After the M17 three-axis motor is enabled, the current position value can be obtained and set through the magnetic encoder value, and the front-end module offset value by inverse solution, no need to send `M1112` to return to HOME.

## 5. Use Pneumatic Functions with G-code Programming&#x20;

To use G-code for pneumatic work, you need to create a new **`.gcode`** file, open it with the notepad or a third-party text editor, enter the robot arm motion control commands, and send it to the robot arm through Rotrics Studio software to start picking and placing.

### **1) G-code commands instructions**

#### Motion control commands:

* **`G0 X300 Y20 Z0`** -move to position (300, 20, 0)
* **`G0 F3000`** -move speed 3000mm/min
* **`M2000`**- straight line mode
* **`M2001`**- fast mode

#### Air pump box control commands:

* **`M888 P2`** -identify the end effector as pneumatic module
* **`M1000`** -air pump box to pump in&#x20;
* **`M1001`**- air pump box to pump out
* **`M1002`**- air pump box to release air,
* **`M1003`**- stop air pump box,

### **2) Pneumatic G-code workflow:**

A. Use command M888 P2 to identify the end effector as pneumatic module.

B. Use command M2000 or M2001 to set robot arm motion mode.

C. Use command G0 to control robot arm movement.

D. Use command M1000-M1003 to control air pump box.

{% hint style="warning" %}
:brain: **Note:** the commands for the soft gripper and the suction cup is **opposite**. Specific description is as follows.
{% endhint %}

**Workflow for the suction cup**:&#x20;

* Use command **`M1000`**&#x74;o pump in and pick up items.
* Use command **`M1002`**&#x74;o release air, relieve the internal pressure of the air pump and place the item down.
* Use command **`M1003`**&#x74;o close all air values.&#x20;

**Workflow for the soft gripper:**

* Use command **`M1001`** to make the air pump box to pump out, the soft gripper will grasp, and pick up the item.
* Use command **`M1000`** to make the air pump box to pump in, the soft gripper will release and place the item down.
* Every time the soft gripper stops, use command **`M1002`**&#x74;o release air and relieve internal press of the air pump box.&#x20;
* Then use command **`M1003`** to close all air values.
