6. Allgemeine Roboter-Einstellungen
6.1. Werkzeug-Referenzpunkt einstellen - Sechs-Punkt-Methode
1/**
2* @brief Legt den Werkzeug-Referenzpunkt fest - Sechs-Punkt-Methode
3* @param [in] point_num Punktnummer, Bereich [1~6]
4* @return Fehlercode
5*/
6int SetToolPoint(int point_num);
6.2. Werkzeugkoordinatensystem berechnen - Sechs-Punkt-Methode
1/**
2* @brief Berechnet das Werkzeugkoordinatensystem
3* @param [out] tcp_pose Werkzeugkoordinatensystem
4* @return Fehlercode
5*/
6int ComputeTool(ref DescPose tcp_pose);
6.3. Werkzeug-Referenzpunkt einstellen - Vier-Punkt-Methode
1/**
2* @brief Legt den Werkzeug-Referenzpunkt fest - Vier-Punkt-Methode
3* @param [in] point_num Punktnummer, Bereich [1~4]
4* @return Fehlercode
5*/
6int SetTcp4RefPoint(int point_num);
6.4. Werkzeugkoordinatensystem berechnen - Vier-Punkt-Methode
1/**
2* @brief Berechnet das Werkzeugkoordinatensystem
3* @param [out] tcp_pose Werkzeugkoordinatensystem
4* @return Fehlercode
5*/
6int ComputeTcp4(ref DescPose tcp_pose);
6.5. Werkzeugkoordinatensystem einstellen
1/**
2* @brief Stellt das Werkzeugkoordinatensystem ein
3* @param [in] id Koordinatensystem-Nummer, Bereich [0~14]
4* @param [in] coord Pose des Werkzeugmittelpunkts relativ zur Flanschmitte
5* @param [in] type 0-Werkzeugkoordinatensystem, 1-Sensorkoordinatensystem
6* @param [in] install Einbauort, 0-Roboterflansch, 1-außerhalb des Roboters
7* @param [in] toolID Werkzeug-ID
8* @param [in] loadNum Nutzlastnummer
9* @return Fehlercode
10*/
11int SetToolCoord(int id, DescPose coord, int type, int install, int toolID, int loadNum);
6.6. Werkzeugkoordinatensystem basierend auf Punkten berechnen
1/**
2* @brief Berechnet das Werkzeugkoordinatensystem basierend auf Punkten
3* @param [in] method Berechnungsmethode; 0-Vier-Punkt-Methode; 1-Sechs-Punkt-Methode
4* @param [in] pos Array von Gelenkpositionen, Länge 4 für Vier-Punkt, Länge 6 für Sechs-Punkt
5* @return Fehlercode
6*/
7
8int ComputeToolCoordWithPoints(int method, JointPos[] pos, ref DescPose coordRtn);
6.7. Liste der Werkzeugkoordinatensysteme einstellen
1/**
2* @brief Stellt die Liste der Werkzeugkoordinatensysteme ein
3* @param [in] id Koordinatensystem-Nummer, Bereich [0~14]
4* @param [in] coord Pose des Werkzeugmittelpunkts relativ zur Flanschmitte
5* @param [in] type 0-Werkzeugkoordinatensystem, 1-Sensorkoordinatensystem
6* @param [in] install Einbauort, 0-Roboterflansch, 1-außerhalb des Roboters
7* @param [in] loadNum Nutzlastnummer
8* @return Fehlercode
9*/
10int SetToolList(int id, DescPose coord, int type, int install, int loadNum);
6.8. Aktuelles Werkzeugkoordinatensystem abrufen
1/**
2* @brief Gibt das aktuelle Werkzeugkoordinatensystem zurück
3* @param [in] flag 0-blockierend, 1-nicht blockierend
4* @param [out] desc_pos Pose des Werkzeugkoordinatensystems
5* @return Fehlercode
6*/
7int GetTCPOffset(byte flag, ref DescPose desc_pos);
6.9. Codebeispiel für Operationen mit Roboter-Werkzeugkoordinatensystemen
1private void button18_Click(object sender, EventArgs e)
2{
3 DescPose p1Desc = new DescPose(186.331f, 487.913f, 209.850f, 149.030f, 0.688f, -114.347f);
4 JointPos p1Joint = new JointPos(-127.876f, -75.341f, 115.417f, -122.741f, -59.820f, 74.300f);
5
6 DescPose p2Desc = new DescPose(69.721f, 535.073f, 202.882f, -144.406f, -14.775f, -89.012f);
7 JointPos p2Joint = new JointPos(-101.780f, -69.828f, 110.917f, -125.740f, -127.841f, 74.300f);
8
9 DescPose p3Desc = new DescPose(146.861f, 578.426f, 205.598f, 175.997f, -36.178f, -93.437f);
10 JointPos p3Joint = new JointPos(-112.851f, -60.191f, 86.566f, -80.676f, -97.463f, 74.300f);
11
12 DescPose p4Desc = new DescPose(136.284f, 509.876f, 225.613f, 178.987f, 1.372f, -100.696f);
13 JointPos p4Joint = new JointPos(-116.397f, -76.281f, 113.845f, -128.611f, -88.654f, 74.299f);
14
15 DescPose p5Desc = new DescPose(138.395f, 505.972f, 298.016f, 179.134f, 2.147f, -101.110f);
16 JointPos p5Joint = new JointPos(-116.814f, -82.333f, 109.162f, -118.662f, -88.585f, 74.302f);
17
18 DescPose p6Desc = new DescPose(105.553f, 454.325f, 232.017f, -179.426f, 0.444f, -99.952f);
19 JointPos p6Joint = new JointPos(-115.649f, -84.367f, 122.447f, -128.663f, -90.432f, 74.303f);
20
21 ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
22 DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
23
24 JointPos[] posJ = new JointPos[] { p1Joint, p2Joint, p3Joint, p4Joint, p5Joint, p6Joint };
25 DescPose coordRtn = new DescPose();
26 int rtn = robot.ComputeToolCoordWithPoints(1, posJ, ref coordRtn);
27 Console.WriteLine($"ComputeToolCoordWithPoints {rtn} coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
28
29 robot.MoveJ( p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
30 robot.SetToolPoint(1);
31 robot.MoveJ( p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
32 robot.SetToolPoint(2);
33 robot.MoveJ( p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
34 robot.SetToolPoint(3);
35 robot.MoveJ( p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
36 robot.SetToolPoint(4);
37 robot.MoveJ( p5Joint, p5Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
38 robot.SetToolPoint(5);
39 robot.MoveJ( p6Joint, p6Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
40 robot.SetToolPoint(6);
41 rtn = robot.ComputeTool(ref coordRtn);
42 Console.WriteLine($"6 Point ComputeTool {rtn} coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
43 robot.SetToolList(1, coordRtn, 0, 0, 0);
44
45 robot.MoveJ( p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
46 robot.SetTcp4RefPoint(1);
47 robot.MoveJ( p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
48 robot.SetTcp4RefPoint(2);
49 robot.MoveJ( p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
50 robot.SetTcp4RefPoint(3);
51 robot.MoveJ( p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
52 robot.SetTcp4RefPoint(4);
53 rtn = robot.ComputeTcp4(ref coordRtn);
54 Console.WriteLine($"4 Point ComputeTool {rtn} coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
55
56 robot.SetToolCoord(2, coordRtn, 0, 0, 1, 0);
57
58 DescPose getCoord = new DescPose();
59 rtn = robot.GetTCPOffset(0, ref getCoord);
60 Console.WriteLine($"GetTCPOffset {rtn} coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
61}
6.10. Externen Werkzeug-Referenzpunkt einstellen - Drei-Punkt-Methode
1/**
2* @brief Legt den externen Werkzeug-Referenzpunkt fest - Drei-Punkt-Methode
3* @param [in] point_num Punktnummer, Bereich [1~3]
4* @return Fehlercode
5*/
6int SetExTCPPoint(int point_num);
6.11. Externes Werkzeugkoordinatensystem berechnen - Drei-Punkt-Methode
1/**
2* @brief Berechnet das externe Werkzeugkoordinatensystem - Drei-Punkt-Methode
3* @param [out] tcp_pose Externes Werkzeugkoordinatensystem
4* @return Fehlercode
5*/
6int ComputeExTCF(ref DescPose tcp_pose);
6.12. Externes Werkzeugkoordinatensystem einstellen
1/**
2* @brief Stellt das externe Werkzeugkoordinatensystem ein
3* @param [in] id Koordinatensystem-Nummer, Bereich [0~14]
4* @param [in] etcp Pose des Werkzeugmittelpunkts relativ zur Flanschmitte
5* @param [in] etool Unbestimmt
6* @return Fehlercode
7*/
8int SetExToolCoord(int id, DescPose etcp, DescPose etool);
6.13. Liste der externen Werkzeugkoordinatensysteme einstellen
1/**
2* @brief Stellt die Liste der externen Werkzeugkoordinatensysteme ein
3* @param [in] id Koordinatensystem-Nummer, Bereich [0~14]
4* @param [in] etcp Pose des Werkzeugmittelpunkts relativ zur Flanschmitte
5* @param [in] etool Unbestimmt
6* @return Fehlercode
7*/
8int SetExToolList(int id, DescPose etcp, DescPose etool);
6.14. Werkstückkoordinatensystem basierend auf Punkten berechnen
1/**
2* @brief Berechnet das Werkstückkoordinatensystem basierend auf Punkten
3* @param [in] method Berechnungsmethode; 0: Ursprung - X-Achse - Z-Achse 1: Ursprung - X-Achse - XY-Ebene
4* @param [in] pos Array von drei TCP-Positionen
5* @param [in] refFrame Referenzkoordinatensystem
6* @return Fehlercode
7*/
8int ComputeWObjCoordWithPoints(int method, DescPose[] pos, int refFrame, ref DescPose coordRtn);
6.15. Codebeispiel für Operationen mit externen Roboter-Werkzeugkoordinatensystemen
1private void button20_Click(object sender, EventArgs e)
2{
3 DescPose p1Desc = new DescPose(-89.606f, 779.517f, 193.516f, 178.000f, 0.476f, -92.484f);
4 JointPos p1Joint = new JointPos(-108.145f, -50.137f, 85.818f, -125.599f, -87.946f, 74.329f);
5
6 DescPose p2Desc = new DescPose(-24.656f, 850.384f, 191.361f, 177.079f, -2.058f, -95.355f);
7 JointPos p2Joint = new JointPos(-111.024f, -41.538f, 69.222f, -114.913f, -87.743f, 74.329f);
8
9 DescPose p3Desc = new DescPose(-99.813f, 766.661f, 241.878f, -176.817f, 1.917f, -91.604f);
10 JointPos p3Joint = new JointPos(-107.266f, -56.116f, 85.971f, -122.560f, -92.548f, 74.331f);
11
12 ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
13 DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
14
15 DescPose[] posTCP = new DescPose[] { p1Desc, p2Desc, p3Desc };
16 DescPose coordRtn = new DescPose();
17
18 robot.MoveJ( p1Joint, p1Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
19 robot.SetExTCPPoint(1);
20 robot.MoveJ( p2Joint, p2Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
21 robot.SetExTCPPoint(2);
22 robot.MoveJ( p3Joint, p3Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
23 robot.SetExTCPPoint(3);
24 int rtn = robot.ComputeExTCF(ref coordRtn);
25 Console.WriteLine($"ComputeExTCF {rtn} coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
26
27 robot.SetExToolCoord(1, coordRtn, offdese);
28 robot.SetExToolList(1, coordRtn, offdese);
29}
6.16. Werkstück-Referenzpunkt einstellen - Drei-Punkt-Methode
1/**
2* @brief Legt den Werkstück-Referenzpunkt fest - Drei-Punkt-Methode
3* @param [in] point_num Punktnummer, Bereich [1~3]
4* @return Fehlercode
5*/
6int SetWObjCoordPoint(int point_num);
6.17. Werkstückkoordinatensystem berechnen
1/**
2* @brief Berechnet das Werkstückkoordinatensystem
3* @param [in] method Berechnungsmethode 0: Ursprung - X-Achse - Z-Achse 1: Ursprung - X-Achse - XY-Ebene
4* @param [in] refFrame Referenzkoordinatensystem
5* @param [out] wobj_pose Werkstückkoordinatensystem
6* @return Fehlercode
7*/
8int ComputeWObjCoord(int method, int refFrame, ref DescPose wobj_pose);
6.18. Werkstückkoordinatensystem einstellen
1/**
2* @brief Stellt das Werkstückkoordinatensystem ein
3* @param [in] id Koordinatensystem-Nummer, Bereich [1~15]
4* @param [in] coord Pose des Werkstückkoordinatensystems relativ zur Flanschmitte
5* @param [in] refFrame Referenzkoordinatensystem
6* @return Fehlercode
7*/
8int SetWObjCoord(int id, DescPose coord, int refFrame);
6.19. Liste der Werkstückkoordinatensysteme einstellen
1/**
2* @brief Stellt die Liste der Werkstückkoordinatensysteme ein
3* @param [in] id Koordinatensystem-Nummer, Bereich [0~14]
4* @param [in] coord Pose des Werkstückkoordinatensystems relativ zur Flanschmitte
5* @param [in] refFrame Referenzkoordinatensystem
6* @return Fehlercode
7*/
8int SetWObjList(int id, DescPose coord, int refFrame);
6.20. Aktuelles Werkstückkoordinatensystem abrufen
1/**
2* @brief Gibt das aktuelle Werkstückkoordinatensystem zurück
3* @param [in] flag 0-blockierend, 1-nicht blockierend
4* @param [out] desc_pos Pose des Werkstückkoordinatensystems
5* @return Fehlercode
6*/
7int GetWObjOffset(byte flag, ref DescPose desc_pos);
6.21. Codebeispiel für Operationen mit Roboter-Werkstückkoordinatensystemen
1private void button19_Click(object sender, EventArgs e)
2{
3 DescPose p1Desc = new DescPose(-89.606, 779.517, 193.516, 178.000, 0.476, -92.484);
4 JointPos p1Joint = new JointPos(-108.145, -50.137, 85.818, -125.599, -87.946, 74.329);
5
6 DescPose p2Desc = new DescPose(-24.656, 850.384, 191.361, 177.079, -2.058, -95.355);
7 JointPos p2Joint = new JointPos(-111.024, -41.538, 69.222, -114.913, -87.743, 74.329);
8
9 DescPose p3Desc = new DescPose(-99.813, 766.661, 241.878, -176.817, 1.917, -91.604);
10 JointPos p3Joint = new JointPos(-107.266, -56.116, 85.971, -122.560, -92.548, 74.331);
11
12 robot.GetForwardKin(p1Joint,ref p1Desc);
13 robot.GetForwardKin(p2Joint,ref p2Desc);
14 robot.GetForwardKin(p3Joint, ref p3Desc);
15
16 ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
17 DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
18
19 DescPose[] posTCP = new DescPose[] { p1Desc, p2Desc, p3Desc };
20 DescPose coordRtn = new DescPose();
21 int rtn = robot.ComputeWObjCoordWithPoints(1, posTCP, 0, ref coordRtn);
22 Console.WriteLine($"ComputeWObjCoordWithPoints {rtn} coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
23
24 robot.MoveJ( p1Joint, p1Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
25 robot.SetWObjCoordPoint(1);
26 robot.MoveJ( p2Joint, p2Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
27 robot.SetWObjCoordPoint(2);
28 robot.MoveJ( p3Joint, p3Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
29 robot.SetWObjCoordPoint(3);
30 rtn = robot.ComputeWObjCoord(1, 0, ref coordRtn);
31 Console.WriteLine($"ComputeWObjCoord {rtn} coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
32
33 robot.SetWObjCoord(1, coordRtn, 0);
34 robot.SetWObjList(1, coordRtn, 0);
35
36 DescPose getWobjDesc = new DescPose();
37 rtn = robot.GetWObjOffset(0, ref getWobjDesc);
38 Console.WriteLine($"GetWObjOffset {rtn} coord is {coordRtn.tran.x} {coordRtn.tran.y} {coordRtn.tran.z} {coordRtn.rpy.rx} {coordRtn.rpy.ry} {coordRtn.rpy.rz}");
39}
6.22. Globale Geschwindigkeit einstellen
1/**
2* @brief Stellt die globale Geschwindigkeit ein
3* @param [in] vel Geschwindigkeit in Prozent, Bereich [0~100]
4* @return Fehlercode
5*/
6int SetSpeed(int vel);
6.23. Roboter-Beschleunigung einstellen
1/**
2* @brief Stellt die Roboter-Beschleunigung ein
3* @param [in] acc Roboter-Beschleunigung in Prozent
4* @return Fehlercode
5*/
6int SetOaccScale(double acc);
6.24. Standardgeschwindigkeit des Roboters abrufen
1/**
2* @brief Gibt die Standardgeschwindigkeit des Roboters zurück
3* @param [out] vel Geschwindigkeit, Einheit mm/s
4* @return Fehlercode
5*/
6int GetDefaultTransVel(ref double vel);
6.25. Endnutzlastgewicht einstellen
1/**
2* @brief Stellt das Endnutzlastgewicht ein
3* @param [in] loadNum Nutzlastnummer
4* @param [in] weight Nutzlastgewicht, Einheit kg
5* @return Fehlercode
6*/
7int SetLoadWeight(int loadNum, float weight);
6.26. Endnutzlast-Schwerpunktkoordinaten einstellen
1/**
2* @brief Stellt die Endnutzlast-Schwerpunktkoordinaten ein
3* @param [in] coord Schwerpunktkoordinaten, Einheit mm
4* @return Fehlercode
5*/
6int SetLoadCoord(DescTran coord);
6.27. Aktuelles Nutzlastgewicht abrufen
1/**
2* @brief Gibt das Gewicht der aktuellen Nutzlast zurück
3* @param [in] flag 0-blockierend, 1-nicht blockierend
4* @param [out] weight Nutzlastgewicht, Einheit kg
5* @return Fehlercode
6*/
7int GetTargetPayload(byte flag, ref double weight);
6.28. Aktuellen Nutzlast-Schwerpunkt abrufen
1/**
2* @brief Gibt den Schwerpunkt der aktuellen Nutzlast zurück
3* @param [in] flag 0-blockierend, 1-nicht blockierend
4* @param [out] cog Nutzlast-Schwerpunkt, Einheit mm
5* @return Fehlercode
6*/
7int GetTargetPayloadCog(byte flag, ref DescTran cog);
6.29. Roboter-Installationsart einstellen
1/**
2* @brief Stellt die Installationsart des Roboters ein
3* @param [in] install Installationsart, 0-normal, 1-Seitenmontage, 2-Überkopfmontage
4* @return Fehlercode
5*/
6int SetRobotInstallPos(byte install);
6.30. Roboter-Installationswinkel einstellen (freie Installation)
1/**
2* @brief Stellt die Installationswinkel des Roboters ein (freie Installation)
3* @param [in] yangle Neigungswinkel
4* @param [in] zangle Rotationswinkel
5* @return Fehlercode
6*/
7int SetRobotInstallAngle(double yangle, double zangle);
6.31. Roboter-Installationswinkel abrufen
1/**
2* @brief Gibt die Installationswinkel des Roboters zurück
3* @param [out] yangle Neigungswinkel
4* @param [out] zangle Rotationswinkel
5* @return Fehlercode
6*/
7int GetRobotInstallAngle(ref double yangle, ref double zangle);
6.32. Systemvariablenwert setzen
1/**
2* @brief Setzt den Wert einer Systemvariablen
3* @param [in] id Variablen-Nummer, Bereich [1~20]
4* @param [in] value Variablenwert
5* @return Fehlercode
6*/
7int SetSysVarValue(int id, double value);
6.33. Systemvariablenwert abrufen
1/**
2* @brief Gibt den Wert einer Systemvariablen zurück
3* @param [in] id Systemvariablen-Nummer, Bereich [1~20]
4* @param [out] value Systemvariablenwert
5* @return Fehlercode
6*/
7int GetSysVarValue(int id, ref double value);
6.34. Codebeispiel für allgemeine Roboter-Einstellungen
1private void button21_Click(object sender, EventArgs e)
2{
3 for (int i = 1; i < 100; i++)
4 {
5 robot.SetSpeed(i);
6 robot.SetOaccScale(i);
7 Thread.Sleep(30);
8 }
9
10 double defaultVel = 0.0f;
11 robot.GetDefaultTransVel(ref defaultVel);
12 Console.WriteLine($"GetDefaultTransVel is {defaultVel}");
13
14 for (int i = 1; i < 21; i++)
15 {
16 robot.SetSysVarValue(i, i + 0.5f);
17 Thread.Sleep(100);
18 }
19
20 for (int i = 1; i < 21; i++)
21 {
22 double value = 0;
23 robot.GetSysVarValue(i, ref value);
24 Console.WriteLine($"sys value {i} is :{value}");
25 Thread.Sleep(100);
26 }
27
28 robot.SetLoadWeight(0, 2.5f);
29
30 DescTran loadCoord = new DescTran();
31 loadCoord.x = 3.0f;
32 loadCoord.y = 4.0f;
33 loadCoord.z = 5.0f;
34 robot.SetLoadCoord( loadCoord);
35
36 Thread.Sleep(1000);
37
38 double getLoad = 0.0f;
39 robot.GetTargetPayload(0, ref getLoad);
40
41 DescTran getLoadTran = new DescTran();
42 robot.GetTargetPayloadCog(0, ref getLoadTran);
43 Console.WriteLine($"get load is {getLoad}; get load cog is {getLoadTran.x} {getLoadTran.y} {getLoadTran.z}");
44
45 robot.SetRobotInstallPos(0);
46 robot.SetRobotInstallAngle(15.0f, 25.0f);
47
48 double anglex = 0.0f;
49 double angley = 0.0f;
50 robot.GetRobotInstallAngle(ref anglex, ref angley);
51 Console.WriteLine($"GetRobotInstallAngle x: {anglex}; y: {angley}");
52}
6.35. Schalter für Gelenk-Reibungskompensation
1/**
2* @brief Schalter für Gelenk-Reibungskompensation
3* @param [in] state 0-Aus, 1-Ein
4* @return Fehlercode
5*/
6int FrictionCompensationOnOff(byte state);
6.36. Koeffizienten für Gelenk-Reibungskompensation einstellen - Normalmontage
1/**
2* @brief Stellt die Koeffizienten für Gelenk-Reibungskompensation ein - Normalmontage
3* @param [in] coeff Kompensationskoeffizienten für sechs Gelenke, Bereich [0~1]
4* @return Fehlercode
5*/
6int SetFrictionValue_level(double[] coeff);
6.37. Koeffizienten für Gelenk-Reibungskompensation einstellen - Seitenmontage
1/**
2* @brief Stellt die Koeffizienten für Gelenk-Reibungskompensation ein - Seitenmontage
3* @param [in] coeff Kompensationskoeffizienten für sechs Gelenke, Bereich [0~1]
4* @return Fehlercode
5*/
6int SetFrictionValue_wall(double[] coeff);
6.38. Koeffizienten für Gelenk-Reibungskompensation einstellen - Überkopfmontage
1/**
2* @brief Stellt die Koeffizienten für Gelenk-Reibungskompensation ein - Überkopfmontage
3* @param [in] coeff Kompensationskoeffizienten für sechs Gelenke, Bereich [0~1]
4* @return Fehlercode
5*/
6int SetFrictionValue_ceiling(double[] coeff);
6.39. Koeffizienten für Gelenk-Reibungskompensation einstellen - freie Installation
1/**
2* @brief Stellt die Koeffizienten für Gelenk-Reibungskompensation ein - freie Installation
3* @param [in] coeff Kompensationskoeffizienten für sechs Gelenke, Bereich [0~1]
4* @return Fehlercode
5*/
6int SetFrictionValue_freedom(double[] coeff);
6.40. Codebeispiel für Roboter-Joint-Friction-Compensation
1private void btnRobotSafetySet_Click(object sender, EventArgs e)
2{
3 double[] lcoeff = { 0.9f, 0.9f, 0.9f, 0.9f, 0.9f, 0.9f };
4 double[] wcoeff = { 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f };
5 double[] ccoeff = { 0.6f, 0.6f, 0.6f, 0.6f, 0.6f, 0.6f };
6 double[] fcoeff = { 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f };
7
8 int rtn = robot.FrictionCompensationOnOff(1);
9 Console.WriteLine($"FrictionCompensationOnOff rtn is{rtn}");
10
11 rtn = robot.SetFrictionValue_level(lcoeff);
12 Console.WriteLine($"SetFrictionValue_level rtn is {rtn}");
13
14 rtn = robot.SetFrictionValue_wall(wcoeff);
15 Console.WriteLine($"SetFrictionValue_wall rtn is{rtn}");
16
17 rtn = robot.SetFrictionValue_ceiling(ccoeff);
18 Console.WriteLine($"SetFrictionValue_ceiling rtn is {rtn}");
19
20 rtn = robot.SetFrictionValue_freedom(fcoeff);
21 Console.WriteLine($"SetFrictionValue_freedom rtn is {rtn}");
22}
6.41. Roboter-Fehlercode abfragen
1/**
2* @brief Fragt den Roboter-Fehlercode ab
3* @param [out] maincode Hauptfehlercode
4* @param [out] subcode Unterfehlercode
5* @return Fehlercode
6*/
7int GetRobotErrorCode(ref int maincode, ref int subcode);
6.42. Fehlerzustand löschen
1/**
2* @brief Löscht den Fehlerzustand
3* @return Fehlercode
4*/
5int ResetAllError();
6.43. Codebeispiel für Roboter-Fehlerstatusabfrage und -löschung
1private void btnRobotSafetySet_Click(object sender, EventArgs e)
2{
3 int maincode=0, subcode=0;
4 robot.GetRobotErrorCode(ref maincode, ref subcode);
5 Console.WriteLine($"robot maincode is{maincode}; subcode is {subcode}" );
6
7 robot.ResetAllError();
8
9 Thread.Sleep(1000);
10
11 robot.GetRobotErrorCode(ref maincode, ref subcode);
12 Console.WriteLine($"robot maincode is{maincode}; subcode is{subcode}");
13}
6.44. Parameter für die Überwachung der Temperatur und Lüfterdrehzahl des Weitbereichs-Steuerschranks einstellen
Neu in Version C#SDK-V1.1.4: Web-3.8.3
1/**
2* @brief Stellt die Parameter für die Überwachung der Temperatur und Lüfterdrehzahl des Weitbereichs-Steuerschranks ein
3* @param [in] enable 0-Überwachung deaktivieren; 1-Überwachung aktivieren
4* @param [in] period Überwachungsperiode (s), Bereich 1-100
5* @return Fehlercode
6*/
7int SetWideBoxTempFanMonitorParam(int enable, int period);
6.45. Parameter für die Überwachung der Temperatur und Lüfterdrehzahl des Weitbereichs-Steuerschranks abrufen
Neu in Version C#SDK-V1.1.4: Web-3.8.3
1/**
2* @brief Gibt die Parameter für die Überwachung der Temperatur und Lüfterdrehzahl des Weitbereichs-Steuerschranks zurück
3* @param [out] enable 0-Überwachung deaktiviert; 1-Überwachung aktiviert
4* @param [out] period Überwachungsperiode (s), Bereich 1-100
5* @return Fehlercode
6*/
7int GetWideBoxTempFanMonitorParam(ref int enable, ref int period);
6.46. Codebeispiel
Neu in Version C#SDK-V1.1.4: Web-3.8.3
1private void button46_Click(object sender, EventArgs e)
2{
3 var pkg = new ROBOT_STATE_PKG();
4 robot.SetWideBoxTempFanMonitorParam(1, 2);
5 int enable = 0;
6 int period = 0;
7 robot.GetWideBoxTempFanMonitorParam(ref enable, ref period);
8 Console.WriteLine($"GetWideBoxTempFanMonitorParam enable is {enable} period is {period}");
9 for (int i = 0; i < 100; i++)
10 {
11 robot.GetRobotRealTimeState(ref pkg);
12 Console.WriteLine($"robot ctrl box temp is {pkg.wideVoltageCtrlBoxTemp}, fan current is {pkg.wideVoltageCtrlBoxFanVel}");
13 Thread.Sleep(100);
14 }
15 int rtn = robot.SetWideBoxTempFanMonitorParam(0, 2);
16 Console.WriteLine($"SetWideBoxTempFanMonitorParam rtn is {rtn}");
17 enable = 0;
18 period = 0;
19 robot.GetWideBoxTempFanMonitorParam(ref enable, ref period);
20 Console.WriteLine($"GetWideBoxTempFanMonitorParam enable is {enable} period is {period}");
21 for (int i = 0; i < 100; i++)
22 {
23 robot.GetRobotRealTimeState(ref pkg);
24 Console.WriteLine($" robot ctrl box temp is {pkg.wideVoltageCtrlBoxTemp}, fan current is {pkg.wideVoltageCtrlBoxFanVel}");
25 Thread.Sleep(100);
26 }
27}
6.47. Fokus-Kalibrierpunkt setzen
Neu in Version C#SDK-V1.1.5: Web-3.8.4
1/**
2* @brief Setzt einen Fokus-Kalibrierpunkt
3* @param [in] pointNum Fokus-Kalibrierpunktnummer 1-8
4* @param [in] point Koordinaten des Kalibrierpunkts
5* @return Fehlercode
6*/
7int SetFocusCalibPoint(int pointNum, DescPose point);
6.48. Fokus-Koordinaten setzen
Neu in Version C#SDK-V1.1.5: Web-3.8.4
1/**
2* @brief Setzt die Fokus-Koordinaten
3* @param [in] pos Fokus-Koordinaten XYZ
4* @return Fehlercode
5*/
6int SetFocusPosition(DescTran pos);
6.49. Fokus-Verfolgung starten
Neu in Version C#SDK-V1.1.5: Web-3.8.4
1/**
2* @brief Startet die Fokus-Verfolgung
3* @param [in] kp Proportionalparameter, Standard 50.0
4* @param [in] kpredict Vorsteuerungsparameter, Standard 19.0
5* @param [in] aMax Maximale Winkelbeschleunigungsbegrenzung, Standard 1440°/s^2
6* @param [in] vMax Maximale Winkelgeschwindigkeitsbegrenzung, Standard 180°/s
7* @param [in] type Sperren der X-Achsen-Ausrichtung (0-Referenz-Eingabevektor; 1-horizontal; 2-vertikal)
8* @return Fehlercode
9*/
10int FocusStart(double kp, double kpredict, double aMax, double vMax, int type);
6.50. Fokus-Verfolgung stoppen
Neu in Version C#SDK-V1.1.5: Web-3.8.4
1/**
2* @brief Stoppt die Fokus-Verfolgung
3* @return Fehlercode
4*/
5int FocusEnd();
6.51. Codebeispiel für Fokus-Verfolgung
Neu in Version C#SDK-V1.1.5: Web-3.8.4
1private void button81_Click(object sender, EventArgs e)
2{
3 DescPose p1Desc=new DescPose(186.331, 487.913, 209.850, 149.030, 0.688, -114.347);
4 JointPos p1Joint = new JointPos(-127.876, -75.341, 115.417, -122.741, -59.820, 74.300);
5 DescPose p2Desc = new DescPose(69.721, 535.073, 202.882, -144.406, -14.775, -89.012);
6 JointPos p2Joint = new JointPos(-101.780, -69.828, 110.917, -125.740, -127.841, 74.300);
7 DescPose p3Desc = new DescPose(146.861, 578.426, 205.598, 175.997, -36.178, -93.437);
8 JointPos p3Joint = new JointPos(-112.851, -60.191, 86.566, -80.676, -97.463, 74.300);
9 DescPose p4Desc = new DescPose(136.284, 509.876, 225.613, 178.987, 1.372, -100.696);
10 JointPos p4Joint = new JointPos(-116.397, -76.281, 113.845, -128.611, -88.654, 74.299);
11 DescPose p5Desc = new DescPose(138.395, 505.972, 298.016, 179.134, 2.147, -101.110);
12 JointPos p5Joint = new JointPos(-116.814, -82.333, 109.162, -118.662, -88.585, 74.302);
13 DescPose p6Desc = new DescPose(105.553, 454.325, 232.017, -179.426, 0.444, -99.952);
14 JointPos p6Joint = new JointPos(-115.649, -84.367, 122.447, -128.663, -90.432, 74.303);
15 ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
16 DescPose offdese = new DescPose(0, 0, 100, 0, 0, 0);
17 robot.GetForwardKin(p1Joint,ref p1Desc);
18 robot.GetForwardKin(p2Joint, ref p2Desc);
19 robot.GetForwardKin(p3Joint, ref p3Desc);
20 robot.GetForwardKin(p4Joint, ref p4Desc);
21 robot.GetForwardKin(p5Joint, ref p5Desc);
22 robot.GetForwardKin(p6Joint, ref p6Desc);
23 robot.MoveJ(p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
24 robot.SetTcp4RefPoint(1);
25 robot.MoveJ(p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
26 robot.SetTcp4RefPoint(2);
27 robot.MoveJ(p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
28 robot.SetTcp4RefPoint(3);
29 robot.MoveJ(p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
30 robot.SetTcp4RefPoint(4);
31 DescPose coordRtn = new DescPose(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
32 int rtn = robot.ComputeTcp4(ref coordRtn);
33 Console.WriteLine($"4 Point ComputeTool {rtn} coord is {coordRtn.tran.x} ,{coordRtn.tran.y} ,{coordRtn.tran.z} ,{coordRtn.rpy.rx} ,{coordRtn.rpy.ry} ,{coordRtn.rpy.rz} ");
34 robot.SetToolCoord(1, coordRtn, 0, 0, 1, 0);
35 robot.GetForwardKin(p1Joint, ref p1Desc);
36 robot.GetForwardKin(p2Joint, ref p2Desc);
37 robot.GetForwardKin(p3Joint, ref p3Desc);
38 robot.SetFocusCalibPoint(1, p1Desc);
39 robot.SetFocusCalibPoint(2, p2Desc);
40 robot.SetFocusCalibPoint(3, p3Desc);
41 DescTran resultPos = new DescTran(0.0, 0.0, 0.0);
42 double accuracy = 0.0;
43 rtn = robot.ComputeFocusCalib(3, ref resultPos, ref accuracy);
44 Console.WriteLine($"ComputeFocusCalib coord is {rtn},{ resultPos.x} ,{ resultPos.y}, { resultPos.z}, accuracy is {accuracy} ");
45 rtn = robot.SetFocusPosition(resultPos);
46 robot.GetForwardKin(p5Joint, ref p5Desc);
47 robot.GetForwardKin(p6Joint, ref p6Desc);
48 robot.MoveL(p5Joint, p5Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese);
49 robot.MoveL(p6Joint, p6Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese);
50 robot.FocusStart(50, 19, 710, 90, 0);
51 robot.MoveL(p5Joint, p5Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese);
52 robot.MoveL(p6Joint, p6Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese);
53 robot.FocusEnd();
54}
6.52. Aktivierung der Gelenk-Drehmomentsensor-Empfindlichkeitskalibrierung
Neu in Version C#SDK-V1.1.9: Web-3.8.7
1/**
2* @brief Aktivierung der Gelenk-Drehmomentsensor-Empfindlichkeitskalibrierung
3* @param [in] status 0-deaktivieren; 1-aktivieren
4* @return Fehlercode
5*/
6public int JointSensitivityEnable(int status);
6.53. Datenerfassung für Gelenk-Drehmomentsensor-Empfindlichkeit
Neu in Version C#SDK-V1.1.9: Web-3.8.7
1/**
2* @brief Datenerfassung für Gelenk-Drehmomentsensor-Empfindlichkeit
3* @return Fehlercode
4*/
5public int JointSensitivityCollect();
6.54. Ergebnis der Gelenk-Drehmomentsensor-Empfindlichkeitskalibrierung abrufen
Neu in Version C#SDK-V1.1.9: Web-3.8.7
1/**
2* @brief Gibt das Ergebnis der Gelenk-Drehmomentsensor-Empfindlichkeitskalibrierung zurück
3* @param [out] calibResult J1~J6 Gelenkempfindlichkeit [0-1]
4* @param [out] linearity J1~J6 Gelenklinearität [0-1]
5* @return Fehlercode
6*/
7public int JointSensitivityCalibration(double calibResult[6], double linearity[6]);
6.55. Gelenk-Drehmomentsensor-Hysteresefehler abrufen
1/**
2* @brief Gibt den Hysteresefehler des Gelenk-Drehmomentsensors zurück
3* @param [out] hysteresisError J1~J6 Hysteresefehler
4* @return Fehlercode
5*/
6public int JointHysteresisError(ref double[] hysteresisError);
6.56. Gelenk-Drehmomentsensor-Wiederholgenauigkeit abrufen
1/**
2* @brief Gibt die Wiederholgenauigkeit des Gelenk-Drehmomentsensors zurück
3* @param [out] repeatability J1~J6 Wiederholgenauigkeit
4* @return Fehlercode
5*/
6public int JointRepeatability(ref double[] repeatability);
6.57. Gelenk-Kraftsensor-Parameter einstellen
1/**
2* @brief Stellt die Gelenk-Kraftsensor-Parameter ein
3* @param [in] M J1-J6 Massenkoeffizient [0.001 ~ 10]
4* @param [in] B J1-J6 Dämpfungskoeffizient [0.001 ~ 10]
5* @param [in] K J1-J6 Steifigkeitskoeffizient [0.001 ~ 10]
6* @param [in] threshold Kraftregelungsschwelle, Nm
7* @param [in] sensitivity Empfindlichkeit, Nm/V, [0 ~ 10]
8* @param [in] setZeroFlag Funktionsaktivierungs-Flag; 0-deaktivieren; 1-aktivieren; 2-Position 1 Nullpunkt aufzeichnen; 3-Position 2 Nullpunkt aufzeichnen
9* @return Fehlercode
10*/
11public int SetAdmittanceParams(double[] M, double[] B, double[] K, double[] threshold, double[] sensitivity, int setZeroFlag);
6.58. Codebeispiel für automatische Gelenk-Drehmomentsensor-Empfindlichkeitskalibrierung
Neu in Version C#SDK-V1.1.9: Web-3.8.7
1public int TestSensitivityCalib()
2{
3 int rtn;
4 rtn = robot.JointSensitivityEnable(0);
5 rtn = robot.JointSensitivityEnable(1);
6 Console.WriteLine($"JointSensitivityEnable rtn is {rtn}");
7
8 JointPos curJPos = new JointPos(0, 0, 0, 0, 0, 0);
9 robot.GetActualJointPosDegree(0, ref curJPos);
10 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
11 DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
12 JointPos[] jointPoses = new JointPos[]
13 {
14 new JointPos(curJPos.jPos[0], 0, 0, -90, 0.02, curJPos.jPos[5]),
15 new JointPos(curJPos.jPos[0], -30, 0, -90, 0.02, curJPos.jPos[5]),
16 new JointPos(curJPos.jPos[0], -60, 0, -90, 0.02, curJPos.jPos[5]),
17 new JointPos(curJPos.jPos[0], -90, 0, -90, 0.02, curJPos.jPos[5]),
18 new JointPos(curJPos.jPos[0], -120, 0, -90, 0.02, curJPos.jPos[5]),
19 new JointPos(curJPos.jPos[0], -150, 0, -90, 0.02, curJPos.jPos[5]),
20 new JointPos(curJPos.jPos[0], -180, 0, -90, 0.02, curJPos.jPos[5])
21 };
22 for (int i = 0; i < jointPoses.Length; i++)
23 {
24 DescPose descPos = new DescPose(0, 0, 0, 0, 0, 0);
25 robot.GetForwardKin(jointPoses[i], ref descPos);
26 robot.MoveJ(jointPoses[i], descPos, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
27
28 Thread.Sleep(i == 0 ? 200 : 100);
29 rtn = robot.JointSensitivityCollect();
30 Console.WriteLine($"JointSensitivityCollect {i + 1} rtn is {rtn}");
31 Thread.Sleep(100);
32 }
33
34 for (int i = jointPoses.Length - 2; i >= 0; i--)
35 {
36 DescPose descPos = new DescPose();
37 robot.GetForwardKin(jointPoses[i], ref descPos);
38 robot.MoveJ(jointPoses[i], descPos, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
39 Thread.Sleep(100);
40 rtn = robot.JointSensitivityCollect();
41 Console.WriteLine($"JointSensitivityCollect {jointPoses.Length + (jointPoses.Length - 1 - i)} rtn is {rtn}");
42 Thread.Sleep(100);
43 }
44 double[] calibResult = new double[6];
45 double[] linearity = new double[6];
46 rtn = robot.JointSensitivityCalibration(ref calibResult, ref linearity);
47 Console.WriteLine($"JointSensitivityCalibration rtn is {rtn}");
48 rtn = robot.JointSensitivityEnable(0);
49 Console.WriteLine($"JointSensitivityEnable rtn is {rtn}");
50 Console.WriteLine($"jointSensor Calib result is {calibResult[0]:F6} {calibResult[1]:F6} {calibResult[2]:F6} {calibResult[3]:F6} {calibResult[4]:F6} {calibResult[5]:F6}");
51 Console.WriteLine($"jointSensor linearity is {linearity[0]:F6} {linearity[1]:F6} {linearity[2]:F6} {linearity[3]:F6} {linearity[4]:F6} {linearity[5]:F6}");
52 double[] hysteresisError = new double[6];
53 rtn = robot.JointHysteresisError(ref hysteresisError);
54 Console.WriteLine($"JointHysteresisError result is {hysteresisError[0]:F6} {hysteresisError[1]:F6} {hysteresisError[2]:F6} {hysteresisError[3]:F6} {hysteresisError[4]:F6} {hysteresisError[5]:F6}");
55 double[] repeatability = new double[6];
56 rtn = robot.JointRepeatability(ref repeatability);
57 Console.WriteLine($"JointRepeatability result is {repeatability[0]:F6} {repeatability[1]:F6} {repeatability[2]:F6} {repeatability[3]:F6} {repeatability[4]:F6} {repeatability[5]:F6}");
58 double[] M = new double[6] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
59 double[] B = new double[6] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
60 double[] K = new double[6] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
61 double[] threshold = new double[6] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
62 int setZeroFlag = 1;
63 rtn = robot.SetAdmittanceParams(M, B, K, threshold, calibResult, setZeroFlag);
64 Console.WriteLine($"SetAdmittanceParams rtn is {rtn}");
65 robot.CloseRPC();
66 return 0;
67}
6.59. Fehlerzähler der 8 Slave-Ports des Roboters abrufen
Neu in Version C#SDK-V1.1.9: Web-3.8.7
1/**
2* @brief Gibt die Fehlerzähler der 8 Slave-Ports des Roboters zurück
3* @param [out] inRecvErr Eingang Empfangsfehlerzähler
4* @param [out] inCRCErr Eingang CRC-Fehlerzähler
5* @param [out] inTransmitErr Eingang Übertragungsfehlerzähler
6* @param [out] inLinkErr Eingang Verbindungsfehlerzähler
7* @param [out] outRecvErr Ausgang Empfangsfehlerzähler
8* @param [out] outCRCErr Ausgang CRC-Fehlerzähler
9* @param [out] outTransmitErr Ausgang Übertragungsfehlerzähler
10* @param [out] outLinkErr Ausgang Verbindungsfehlerzähler
11* @return Fehlercode
12*/
13public int GetSlavePortErrCounter(ref int[] inRecvErr,ref int[] inCRCErr,ref int[] inTransmitErr,ref int[] inLinkErr,ref int[] outRecvErr,ref int[] outCRCErr,ref int[] outTransmitErr,ref int[] outLinkErr);
6.60. Slave-Port-Fehlerzähler zurücksetzen
Neu in Version C#SDK-V1.1.9: Web-3.8.7
1/**
2* @brief Setzt den Fehlerzähler eines Slave-Ports zurück
3* @param [in] slaveID Slave-Nummer 0~7
4* @return Fehlercode
5*/
6public int SlavePortErrCounterClear(int slaveID);
6.61. Codebeispiel für Slave-Port-Fehlerzähler
Neu in Version C#SDK-V1.1.9: Web-3.8.7
1public void TestSlavePortErr()
2{
3 int[] inRecvErr = new int[8];
4 int[] inCRCErr = new int[8];
5 int[] inTransmitErr = new int[8];
6 int[] inLinkErr = new int[8];
7 int[] outRecvErr = new int[8];
8 int[] outCRCErr = new int[8];
9 int[] outTransmitErr = new int[8];
10 int[] outLinkErr = new int[8];
11
12 robot.GetSlavePortErrCounter(ref inRecvErr, ref inCRCErr, ref inTransmitErr, ref inLinkErr,
13 ref outRecvErr, ref outCRCErr, ref outTransmitErr, ref outLinkErr);
14
15 for (int i = 0; i < 8; i++)
16 {
17 if (inRecvErr[i] != 0)
18 {
19 Console.WriteLine($"inRecvErr {i} is {inRecvErr[i]}");
20 }
21
22 if (inCRCErr[i] != 0)
23 {
24 Console.WriteLine($"inCRCErr {i} is {inCRCErr[i]}");
25 }
26
27 if (inTransmitErr[i] != 0)
28 {
29 Console.WriteLine($"inTransmitErr {i} is {inTransmitErr[i]}");
30 }
31
32 if (inLinkErr[i] != 0)
33 {
34 Console.WriteLine($"inLinkErr {i} is {inLinkErr[i]}");
35 }
36
37 if (outRecvErr[i] != 0)
38 {
39 Console.WriteLine($"outRecvErr {i} is {outRecvErr[i]}");
40 }
41
42 if (outCRCErr[i] != 0)
43 {
44 Console.WriteLine($"outCRCErr {i} is {outCRCErr[i]}");
45 }
46
47 if (outTransmitErr[i] != 0)
48 {
49 Console.WriteLine($"outTransmitErr {i} is {outTransmitErr[i]}");
50 }
51
52 if (outLinkErr[i] != 0)
53 {
54 Console.WriteLine($"outLinkErr {i} is {outLinkErr[i]}");
55 }
56 }
57 Console.WriteLine("others has no err!");
58
59 for (int i = 0; i < 8; i++)
60 {
61 robot.SlavePortErrCounterClear(i);
62 }
63
64 robot.CloseRPC();
65}
6.62. Geschwindigkeits-Vorsteuerungskoeffizienten für jede Achse einstellen
Neu in Version C#SDK-V1.1.9: Web-3.8.7
1/**
2* @brief Stellt die Geschwindigkeits-Vorsteuerungskoeffizienten für jede Achse ein
3* @param [in] radio Geschwindigkeits-Vorsteuerungskoeffizienten für jede Achse
4* @return Fehlercode
5*/
6public int SetVelFeedForwardRatio(double radio[6]);
6.63. Geschwindigkeits-Vorsteuerungskoeffizienten für jede Achse abrufen
Neu in Version C#SDK-V1.1.9: Web-3.8.7
1/**
2* @brief Gibt die Geschwindigkeits-Vorsteuerungskoeffizienten für jede Achse zurück
3* @param [out] radio Geschwindigkeits-Vorsteuerungskoeffizienten für jede Achse
4* @return Fehlercode
5*/
6public int GetVelFeedForwardRatio(ref double radio[6]);
6.64. Codebeispiel für Slave-Port-Fehlerzähler
Neu in Version C#SDK-V1.1.9: Web-3.8.7
1public void TestVelFeedForwardRatio()
2{
3
4 double[] setRadio = new double[6] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
5 robot.SetVelFeedForwardRatio(setRadio);
6 double[] getRadio = new double[6] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
7 robot.GetVelFeedForwardRatio(ref getRadio);
8 Console.WriteLine($" {getRadio[0]:F6} {getRadio[1]:F6} {getRadio[2]:F6} {getRadio[3]:F6} {getRadio[4]:F6} {getRadio[5]:F6}");
9}
6.65. Photoelektrischer Sensor TCP-Kalibrierung - Werkzeug-RPY berechnen
1/**
2* @brief Photoelektrischer Sensor TCP-Kalibrierung - Werkzeug-RPY berechnen
3* @param [in] Btool Roboter-kartesische Position
4* @param [in] Etool Aktueller Werkzeugkoordinatenwert
5* @param [in] sensor Aktueller Sensorkoordinatenwert (noch nicht freigegeben)
6* @param [in] radius Radius der Kreisbewegung mm (noch nicht freigegeben)
7* @param [in] dz Bewegungsabstand entlang der negativen Z-Achse des Basiskoordinatensystems; wenn dz = 10000, gibt die Funktion direkt das Werkzeug-RPY zurück
8* @param [out] TCPRPY Werkzeug-RPY-Wert
9* @return Fehlercode
10*/
11public int TCPComputeRPY(DescPose Btool, DescPose Etool, DescPose sensor, double radius, double dz, out Rpy TCPRPY);
6.66. Photoelektrischer Sensor TCP-Kalibrierung - Werkzeug-XYZ berechnen
1/**
2* @brief Photoelektrischer Sensor TCP-Kalibrierung - Werkzeug-XYZ berechnen
3* @param [in] select 0-Werkzeug-TCP berechnen; 1-Sensorursprung berechnen; 2-Sensorausrichtung berechnen; 3-Werkzeug-TCP direkt zurückgeben; 4-Aktuelles Werkstück- und Werkzeugkoordinatensystem aufzeichnen
4* @param [in] originDirection 0-X-Richtung; 1-Y-Richtung; 2-Z-Richtung
5* @param [in] pos1 Roboter-kartesische Position 1
6* @param [in] pos2 Roboter-kartesische Position 2
7* @param [in] pos3 Roboter-kartesische Position 3
8* @param [in] pos4 Roboter-kartesische Position 4
9* @param [out] TCP Werkzeug-XYZ-Wert
10* @return Fehlercode
11*/
12public int TCPComputeXYZ(int select, double originDirection, DescTran pos1, DescTran pos2,DescTran pos3, DescTran pos4, out DescTran TCP);
6.67. Photoelektrischer Sensor TCP-Kalibrierung - Aufzeichnung der Flanschmittelpunktposition starten
1/**
2* @brief Photoelektrischer Sensor TCP-Kalibrierung - Aufzeichnung der Flanschmittelpunktposition starten
3* @return Fehlercode
4*/
5errno_t TCPRecordFlangePosStart();
6.68. Photoelektrischer Sensor TCP-Kalibrierung - Aufzeichnung der Flanschmittelpunktposition stoppen
1/**
2* @brief Photoelektrischer Sensor TCP-Kalibrierung - Aufzeichnung der Flanschmittelpunktposition stoppen
3* @return Fehlercode
4*/
5public int TCPRecordFlangePosEnd();
6.69. Photoelektrischer Sensor TCP-Kalibrierung - Werkzeugmittelpunktposition abrufen
1/**
2* @brief Photoelektrischer Sensor TCP-Kalibrierung - Werkzeugmittelpunktposition abrufen
3* @param [out] TCP Werkzeugmittelpunktposition (x, y, z)
4* @return Fehlercode
5*/
6public int TCPGetRecordFlangePos(out DescTran TCP);
6.70. Photoelektrischer Sensor TCP-Kalibrierung
1/**
2* @brief Photoelektrischer Sensor TCP-Kalibrierung
3* @param [in] luaPath Pfad zum automatischen Kalibrierungs-Lua-Programm: QX-Roboter - "/fruser/FR_CalibrateTheToolTcp.lua"; LA-Roboter - "/usr/local/etc/controller/lua/FR_CalibrateTheToolTcp.lua"
4* @param [in] offsetX Teachpunktversatz (x, y, z) mm
5* @param [out] TCP Kalibriertes Werkzeugkoordinatensystem (x, y, z, rx, ry, rz)
6* @return Fehlercode
7*/
8public int PhotoelectricSensorTCPCalibration(string luaPath, DescTran offset, out DescPose TCP);
6.71. Codebeispiel für Photoelektrische Sensor TCP-Kalibrierung
1public void TestPhotoelectricSensorTCPCalib()
2{
3 ROBOT_STATE_PKG pkg =new ROBOT_STATE_PKG();
4 DescTran offset = new DescTran( 10.0, 10.0, 3.0 );
5 DescPose TCP = new DescPose();
6 int rtn = robot.PhotoelectricSensorTCPCalibration("/fruser/FR_CalibrateTheToolTcp.lua", offset, out TCP);
7 Console.WriteLine($"PhotoelectricSensorTCPCalibration : {rtn}");
8 Console.WriteLine($"Werkzeug-TCP Koordinaten: X={TCP.tran.x:F3}, Y={TCP.tran.y:F3}, Z={TCP.tran.z:F3}");
9 Console.WriteLine($"Werkzeug-RPY Ausrichtung: RX={TCP.rpy.rx:F3}, RY={TCP.rpy.ry:F3}, RZ={TCP.rpy.rz:F3}");
10}