Skip to content

Commit

Permalink
update Fix_ESI
Browse files Browse the repository at this point in the history
  • Loading branch information
onionsflying committed Dec 19, 2018
1 parent 13a11aa commit 57853d7
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 18 deletions.
98 changes: 90 additions & 8 deletions docs/Fix_ESI.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,103 @@
修复ESI (EtherCAT Slave Infomation)
====

如果启动elfin_ros_control.launch(或 elfin_ros_control_v2.launch)时遇到类似以下的报错,原因可能是机械臂上的ESI固件错误,也可能是运行的launch文件与机械臂EtherCAT从站版本不一致(详见: [README.md](../README.md)
如果启动elfin_ros_control.launch(或 elfin_ros_control_v2.launch)时遇到类似以下的报错,可能有下面两个原因
```
ERROR: slave_no(1) : channel(352) is larger than Input bits (256)
```
## 原因1
你可能用了错的launch文件(详见: [README.md](../README.md))。如果不知道所用的Elfin的从站版本的话,只要把两个launch文件都试一下即可。
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_robot_bringup elfin_ros_control.launch
```
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_robot_bringup elfin_ros_control_v2.launch
```

## 原因2
如果确定不是第一个原因,可以考虑是机械臂上的ESI固件错误。

### 修复ESI固件的方法

打开elfin_ethercat_driver/config/write_esi.yaml文件,对网卡名,希望修复的从站编号以及写入的esi文件进行配置。本软件包提供了两个esi文件: elfin_motor.esi和elfin_motor_v2.esi 。
将Elfin通过网线连接到电脑。先通过`ifconfig`指令来确定与Elfin连接的网卡名称。本软件包默认的名称是eth0 。假如当前名称不是eth0的话,请在下面的步骤中对elfin_ethercat_driver/config/write_esi.yaml的相应部分进行修改。
```
eth_name: eth0
```
Elfin上共有4个EtherCAT从站,如果同一网卡没有连接其他EtherCAT设备的话,4个从站的编号如下图所示:
![elfin_robot](images/elfin_ethercat_slaves.png)

之后运行以下命令修复ESI
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_ethercat_driver elfin_esi_write.launch
如果有其他EtherCAT设备的话,请根据实际从站的编号对elfin_ethercat_driver/config/write_esi.yaml的相应部分进行修改。
```
slave_no: [1, 2, 3]
```
以及
```
slave_no: [4]
```

#### 使用Version 1版本EtherCAT从站的Elfin
* 写入模组的ESI
将elfin_ethercat_driver/config/write_esi.yaml文件中的参数设置如下:
```
eth_name: eth0
slave_no: [1, 2, 3]
esi_file: elfin_module.esi
```
之后运行以下命令修复ESI
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_ethercat_driver elfin_esi_write.launch
```
* 写入IO口的ESI
将elfin_ethercat_driver/config/write_esi.yaml文件中的参数设置如下:
```
eth_name: eth0
slave_no: [4]
esi_file: elfin_io_port.esi
```
之后运行以下命令修复ESI
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_ethercat_driver elfin_esi_write.launch
```
最后重启机械臂即可完成修复。
为防误操作,修复后在elfin_ethercat_driver/script/路径下会生成各个从站原ESI的备份。
#### 使用Version 2版本EtherCAT从站的Elfin
* 写入模组的ESI
将elfin_ethercat_driver/config/write_esi.yaml文件中的参数设置如下:
```
eth_name: eth0
slave_no: [1, 2, 3]
esi_file: elfin_module_v2.esi
```
之后运行以下命令修复ESI
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_ethercat_driver elfin_esi_write.launch
```
* 写入IO口的ESI
将elfin_ethercat_driver/config/write_esi.yaml文件中的参数设置如下:
```
eth_name: eth0
slave_no: [4]
esi_file: elfin_io_port_v2.esi
```
之后运行以下命令修复ESI
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_ethercat_driver elfin_esi_write.launch
```
最后重启机械臂即可完成修复。
最后重启机械臂即可完成修复。
为防误操作,修复后在elfin_ethercat_driver/script/路径下会生成各个从站原ESI的备份。
为防误操作,修复后在elfin_ethercat_driver/script/路径下会生成各个从站原ESI的备份。
100 changes: 91 additions & 9 deletions docs/Fix_ESI_english.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,103 @@
Fix ESI (EtherCAT Slave Infomation)
====

If you got an error info as follows, you may need to fix ESI on the robot or just try another launch file(elfin_ros_control.launch/elfin_ros_control_v2.launch).
If you got an error info as follows, there are two possible reasons.
```
ERROR: slave_no(1) : channel(352) is larger than Input bits (256)
```

### How to fix ESI

Open the elfin_ethercat_driver/config/write_esi.yaml file and configure the parameters(ethernet interface name, slave numbers and esi file name). This repo provides two esi files: elfin_motor.esi and elfin_motor_v2.esi .

Then fix ESI with following commands.
## Reason 1
You may have used the wrong launch file(elfin_ros_control.launch/elfin_ros_control_v2.launch) (for details: [README.md](../README.md)). If you don't know which version of Elfin you have. You can just try both of the launch files.
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_robot_bringup elfin_ros_control.launch
```
or
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_ethercat_driver elfin_esi_write.launch
$ roslaunch elfin_robot_bringup elfin_ros_control_v2.launch
```

## Reason 2
If it's not the reason 1, then the ESI on the robot may be wrong.

### How to fix ESI
Connect Elfin to the computer with a LAN cable. Then confirm the ethernet interface name of the connection with `ifconfig`. The default ethernet name is eth0. If the ethernet name is not eth0, in the next steps you should correct the following line in the file *elfin_ethercat_driver/config/write_esi.yaml*.
```
elfin_ethernet_name: eth0
```
There are 4 EtherCAT slaves on the robot. If there is no other EtherCAT device connected to the same NIC, the numbers of the 4 Elfin EtherCAT slaves are as shown below.
![elfin_robot](images/elfin_ethercat_slaves.png)

If there are other EtherCAT devices, then in the next steps you should correct the following lines in the file *elfin_ethercat_driver/config/write_esi.yaml* accordingly.
```
slave_no: [1, 2, 3]
```
and
```
slave_no: [4]
```

#### Elfin with the version 1 of EtherCAT slaves
* Fix module ESI
Please set the parameters in the file *elfin_ethercat_driver/config/write_esi.yaml* as follows.
```
eth_name: eth0
slave_no: [1, 2, 3]
esi_file: elfin_module.esi
```
Then fix ESI with following commands.
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_ethercat_driver elfin_esi_write.launch
```
* Fix IO port ESI
Please set the parameters in the file *elfin_ethercat_driver/config/write_esi.yaml* as follows.
```
eth_name: eth0
slave_no: [4]
esi_file: elfin_io_port.esi
```
Then fix ESI with following commands.
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_ethercat_driver elfin_esi_write.launch
```
Finally, restart the robot. Now ESI should be fixed.
Besides, some backup files of the original ESI of the slaves that are fixed are generated in elfin_ethercat_driver/script/ folder.
#### Elfin with the version 2 of EtherCAT slaves
* Fix module ESI
Please set the parameters in the file *elfin_ethercat_driver/config/write_esi.yaml* as follows.
```
eth_name: eth0
slave_no: [1, 2, 3]
esi_file: elfin_module_v2.esi
```
Then fix ESI with following commands.
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_ethercat_driver elfin_esi_write.launch
```
* Fix IO port ESI
Please set the parameters in the file *elfin_ethercat_driver/config/write_esi.yaml* as follows.
```
eth_name: eth0
slave_no: [4]
esi_file: elfin_io_port_v2.esi
```
Then fix ESI with following commands.
```sh
$ sudo chrt 10 bash
$ roslaunch elfin_ethercat_driver elfin_esi_write.launch
```
Finally, restart the robot. Now ESI should be fixed.
Finally, restart the robot. Now ESI should be fixed.
Besides, some backup files of the original ESI of the slaves that are fixed are generated in elfin_ethercat_driver/script/ folder.
Besides, some backup files of the original ESI of the slaves that are fixed are generated in elfin_ethercat_driver/script/ folder.
Binary file added docs/images/elfin_ethercat_slaves.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion elfin_ethercat_driver/config/write_esi.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
eth_name: eth0
slave_no: [1, 2, 3]
esi_file: elfin_motor.esi
esi_file: elfin_module.esi
Binary file not shown.
Binary file not shown.

0 comments on commit 57853d7

Please sign in to comment.