12. 机器人焊接

12.1. 焊接开始

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 焊接开始
3* @param [in] ioType io类型 0-控制器IO; 1-扩展IO
4* @param [in] arcNum 焊机配置文件编号
5* @param [in] timeout 起弧超时时间
6* @return 错误码
7*/
8int ARCStart(int ioType, int arcNum, int timeout);

12.2. 焊接结束

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 焊接结束
3* @param [in] ioType io类型 0-控制器IO; 1-扩展IO
4* @param [in] arcNum 焊机配置文件编号
5* @param [in] timeout 熄弧超时时间
6* @return 错误码
7*/
8int ARCEnd(int ioType, int arcNum, int timeout);

12.3. 设置焊接电流与输出模拟量对应关系

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 设置焊接电流与输出模拟量对应关系
3* @param [in] currentMin 焊接电流-模拟量输出线性关系左侧点电流值(A)
4* @param [in] currentMax 焊接电流-模拟量输出线性关系右侧点电流值(A)
5* @param [in] outputVoltageMin 焊接电流-模拟量输出线性关系左侧点模拟量输出电压值(V)
6* @param [in] outputVoltageMax 焊接电流-模拟量输出线性关系右侧点模拟量输出电压值(V)
7* @return 错误码
8*/
9int WeldingSetCurrentRelation(double currentMin, double currentMax, double outputVoltageMin, double outputVoltageMax);

12.4. 设置焊接电压与输出模拟量对应关系

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 设置焊接电压与输出模拟量对应关系
3* @param [in] weldVoltageMin 焊接电压-模拟量输出线性关系左侧点焊接电压值(A)
4* @param [in] weldVoltageMax 焊接电压-模拟量输出线性关系右侧点焊接电压值(A)
5* @param [in] outputVoltageMin 焊接电压-模拟量输出线性关系左侧点模拟量输出电压值(V)
6* @param [in] outputVoltageMax 焊接电压-模拟量输出线性关系右侧点模拟量输出电压值(V)
7* @return 错误码
8*/
9int WeldingSetVoltageRelation(double weldVoltageMin, double weldVoltageMax, double outputVoltageMin, double outputVoltageMax);

12.5. 获取焊接电流与输出模拟量对应关系

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 获取焊接电流与输出模拟量对应关系
3* @param [out] currentMin 焊接电流-模拟量输出线性关系左侧点电流值(A)
4* @param [out] currentMax 焊接电流-模拟量输出线性关系右侧点电流值(A)
5* @param [out] outputVoltageMin 焊接电流-模拟量输出线性关系左侧点模拟量输出电压值(V)
6* @param [out] outputVoltageMax 焊接电流-模拟量输出线性关系右侧点模拟量输出电压值(V)
7* @return 错误码
8*/
9int WeldingGetCurrentRelation(ref double currentMin, ref double currentMax, ref double outputVoltageMin, ref double outputVoltageMax);

12.6. 获取焊接电压与输出模拟量对应关系

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 获取焊接电压与输出模拟量对应关系
3* @param [out] weldVoltageMin 焊接电压-模拟量输出线性关系左侧点焊接电压值(A)
4* @param [out] weldVoltageMax 焊接电压-模拟量输出线性关系右侧点焊接电压值(A)
5* @param [out] outputVoltageMin 焊接电压-模拟量输出线性关系左侧点模拟量输出电压值(V)
6* @param [out] outputVoltageMax 焊接电压-模拟量输出线性关系右侧点模拟量输出电压值(V)
7* @return 错误码
8*/
9int WeldingGetVoltageRelation(ref double weldVoltageMin, ref double weldVoltageMax, ref double outputVoltageMin, ref double outputVoltageMax);

12.7. 设置焊接电流

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 设置焊接电流
3* @param [in] ioType 控制IO类型 0-控制箱IO;1-扩展IO
4* @param [in] current 焊接电流值(A)
5* @param [in] AOIndex 焊接电流控制箱模拟量输出端口(0-1)
6* @return 错误码
7*/
8int WeldingSetCurrent(int ioType, double current, int AOIndex);

12.8. 设置焊接电压

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 设置焊接电压
3* @param [in] ioType 控制IO类型 0-控制箱IO;1-扩展IO
4* @param [in] voltage 焊接电压值(A)
5* @param [in] AOIndex 焊接电压控制箱模拟量输出端口(0-1)
6* @return 错误码
7*/
8int WeldingSetVoltage(int ioType, double voltage, int AOIndex);

12.9. 设置摆动参数

在 C#SDK-v1.0.4 版本加入.

 1/**
 2* @brief 设置摆动参数
 3* @param [in] weaveNum 摆焊参数配置编号
 4* @param [in] weaveType 摆动类型 0-平面三角波摆动;1-垂直L型三角波摆动;2-顺时针圆形摆动;3-逆时针圆形摆动;4-平面正弦波摆动;5-垂直L型正弦波摆动;6-垂直三角波摆动;7-垂直正弦波摆动
 5* @param [in] weaveFrequency 摆动频率(Hz)
 6* @param [in] weaveIncStayTime 等待模式 0-周期不包含等待时间;1-周期包含等待时间
 7* @param [in] weaveRange 摆动幅度(mm)
 8* @param [in] weaveLeftStayTime 摆动左停留时间(ms)
 9* @param [in] weaveRightStayTime 摆动右停留时间(ms)
10* @param [in] weaveCircleRadio 圆形摆动-回调比率(0-100%)
11* @param [in] weaveStationary 摆动位置等待,0-等待时间内位置继续移动;1-等待时间内位置静止
12* @return 错误码
13*/
14int WeaveSetPara(int weaveNum, int weaveType, double weaveFrequency, int weaveIncStayTime, double weaveRange, int weaveLeftStayTime, int weaveRightStayTime, int weaveCircleRadio, int weaveStationary);

12.10. 即时设置摆动参数

在 C#SDK-v1.0.4 版本加入.

 1/**
 2* @brief 即时设置摆动参数
 3* @param [in] weaveNum 摆焊参数配置编号
 4* @param [in] weaveType 摆动类型 0-平面三角波摆动;1-垂直L型三角波摆动;2-顺时针圆形摆动;3-逆时针圆形摆动;4-平面正弦波摆动;5-垂直L型正弦波摆动;6-垂直三角波摆动;7-垂直正弦波摆动
 5* @param [in] weaveFrequency 摆动频率(Hz)
 6* @param [in] weaveIncStayTime 等待模式 0-周期不包含等待时间;1-周期包含等待时间
 7* @param [in] weaveRange 摆动幅度(mm)
 8* @param [in] weaveLeftStayTime 摆动左停留时间(ms)
 9* @param [in] weaveRightStayTime 摆动右停留时间(ms)
10* @param [in] weaveCircleRadio 圆形摆动-回调比率(0-100%)
11* @param [in] weaveStationary 摆动位置等待,0-等待时间内位置继续移动;1-等待时间内位置静止
12* @return 错误码
13*/
14int WeaveOnlineSetPara(int weaveNum, int weaveType, double weaveFrequency, int weaveIncStayTime, double weaveRange, int weaveLeftStayTime, int weaveRightStayTime, int weaveCircleRadio, int weaveStationary);

12.11. 摆动开始

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 摆动开始
3* @param [in] weaveNum 摆焊参数配置编号
4* @return 错误码
5*/
6int WeaveStart(int weaveNum);

12.12. 摆动结束

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 摆动结束
3* @param [in] weaveNum 摆焊参数配置编号
4* @return 错误码
5*/
6int WeaveEnd(int weaveNum);

12.13. 正向送丝

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 正向送丝
3* @param [in] ioType io类型  0-控制器IO;1-扩展IO
4* @param [in] wireFeed 送丝控制  0-停止送丝;1-送丝
5* @return 错误码
6*/
7int SetForwardWireFeed(int ioType, int wireFeed);

12.14. 反向送丝

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 反向送丝
3* @param [in] ioType io类型  0-控制器IO;1-扩展IO
4* @param [in] wireFeed 送丝控制  0-停止送丝;1-送丝
5* @return 错误码
6*/
7int SetReverseWireFeed(int ioType, int wireFeed);

12.15. 送气

在 C#SDK-v1.0.4 版本加入.

1/**
2* @brief 送气
3* @param [in] ioType io类型  0-控制器IO;1-扩展IO
4* @param [in] airControl 送气控制  0-停止送气;1-送气
5* @return 错误码
6*/
7int SetAspirated(int ioType, int airControl);

12.16. 段焊

在 C#SDK-v1.0.4 版本加入.

 1/**
 2* @brief 段焊开始
 3* @param [in] startDesePos 起始点笛卡尔位置
 4* @param [in] endDesePos 结束点笛卡尔位姿
 5* @param [in] startJPos 起始点关节位姿
 6* @param [in] endJPos 结束点关节位姿
 7* @param [in] weldLength 焊接段长度(mm)
 8* @param [in] noWeldLength 非焊接段长度(mm)
 9* @param [in] weldIOType 焊接IO类型(0-控制箱IO;1-扩展IO)
10* @param [in] arcNum 焊机配置文件编号
11* @param [in] weldTimeout 起/收弧超时时间
12* @param [in] isWeave 是否摆动
13* @param [in] weaveNum 摆焊参数配置编号
14* @param [in] tool 工具号
15* @param [in] user 工件号
16* @param [in] vel  速度百分比,范围[0~100]
17* @param [in] acc  加速度百分比,范围[0~100],暂不开放
18* @param [in] ovl  速度缩放因子,范围[0~100]
19* @param [in] blendR [-1.0]-运动到位(阻塞),[0~1000.0]-平滑半径(非阻塞),单位mm
20* @param [in] epos  扩展轴位置,单位mm
21* @param [in] search  0-不焊丝寻位,1-焊丝寻位
22* @param [in] offset_flag  0-不偏移,1-基坐标系/工件坐标系下偏移,2-工具坐标系下偏移
23* @param [in] offset_pos  位姿偏移量
24* @return 错误码
25*/
26int SegmentWeldStart(DescPose startDesePos, DescPose endDesePos, JointPos startJPos, JointPos endJPos, double weldLength, double noWeldLength, int weldIOType, int arcNum, int weldTimeout,bool isWeave, int weaveNum, int tool, int user, float vel, float acc, float ovl, float blendR, ExaxisPos epos, byte search, byte offset_flag, DescPose offset_pos);

12.17. 代码示例

在 C#SDK-v1.0.4 版本加入.

 1private void btnWeldStart_Click(object sender, EventArgs e)
 2{
 3    Robot robot = new Robot();
 4    robot.RPC("192.168.58.2");
 5    DescPose startdescPose = new DescPose(-525.55, 562.3, 417.199, -178.325, 0.847, 31.109);
 6    JointPos startjointPos = new JointPos(-58.978, -76.817, 112.494, -127.348, -89.145, -0.063);
 7    DescPose enddescPose = new DescPose(-345.155, 535.733, 421.269, 179.475, 0.571, 18.332);
 8    JointPos endjointPos = new JointPos(-71.746, -87.177, 123.953, -126.25, -89.429, -0.089);
 9
10    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
11    DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
12
13    robot.WeldingSetCurrentRelation(0, 400, 0, 10);
14    robot.WeldingSetVoltageRelation(0, 40, 0, 10);
15    double curmin = 0;
16    double curmax = 0;
17    double vurvolmin = 0;
18    double curvolmax = 0;
19    double volmax = 0;
20    double volmin = 0;
21    double volvolmin = 0;
22    double volvolmax = 0;
23
24    robot.WeldingGetCurrentRelation(ref curmin, ref curmax, ref vurvolmin, ref curvolmax);
25    robot.WeldingGetVoltageRelation(ref volmin, ref volmax, ref volvolmin, ref volvolmax);
26
27    robot.WeldingSetCurrent(0, 100, 0);
28    robot.WeldingSetVoltage(0, 19, 1);
29
30    robot.WeaveSetPara(0,0,1,0,10,100,100,0,0);
31
32    robot.SetForwardWireFeed(0, 1);
33    Thread.Sleep(1000);
34    robot.SetForwardWireFeed(0, 0);
35    robot.SetReverseWireFeed(0, 1);
36    Thread.Sleep(1000);
37    robot.SetReverseWireFeed(0, 0);
38    robot.SetAspirated(0, 1);
39    Thread.Sleep(1000);
40    robot.SetAspirated(0, 0);
41
42    robot.SetSpeed(5);
43    robot.MoveL(startjointPos, startdescPose, 1, 0, 100, 100, 100, 0, exaxisPos, 0, 0, offdese);
44    robot.ARCStart(0, 0, 1000);
45    robot.WeaveStart(0);
46    robot.MoveL(endjointPos, enddescPose, 1, 0, 100, 100, 100, 0, exaxisPos, 0, 0, offdese);
47    robot.ARCEnd(0, 0, 1000);
48    robot.WeaveEnd(0);
49}