4. Movimento del robot
4.1. Jog (movimento a scatti)
1/**
2* @brief Jog (movimento a scatti)
3* @param [in] refType Tipo di movimento a scatti: 0-Jog giunto, 2-Jog in sistema di coordinate base, 4-Jog in sistema di coordinate utensile, 8-Jog in sistema di coordinate pezzo
4* @param [in] nb 1-Giunto 1 (o asse x), 2-Giunto 2 (o asse y), 3-Giunto 3 (o asse z), 4-Giunto4 (o rotazione attorno all'asse x), 5-Giunto5 (o rotazione attorno all'asse y), 6-Giunto6 (o rotazione attorno all'asse z)
5* @param [in] dir 0-Direzione negativa, 1-Direzione positiva
6* @param [in] vel Percentuale velocità, [0~100]
7* @param [in] acc Percentuale accelerazione, [0~100]
8* @param [in] max_dis Angolo massimo per singolo movimento a scatti, unità [°] o distanza, unità [mm]
9* @return Codice di errore
10*/
11int StartJOG(byte refType, byte nb, byte dir, float vel, float acc, float max_dis);
4.2. Arresto decelerato movimento a scatti (Jog)
1/**
2* @brief Arresto decelerato movimento a scatti (Jog)
3* @param [in] ref 1-Arresto decelerato movimento a scatti giunto, 3-Arresto decelerato movimento a scatti in sistema di coordinate base, 5-Arresto decelerato movimento a scatti in sistema di coordinate utensile, 9-Arresto decelerato movimento a scatti in sistema di coordinate pezzo
4* @return Codice di errore
5*/
6int StopJOG(byte stopType);
4.3. Arresto immediato movimento a scatti (Jog)
1/**
2* @brief Arresto immediato movimento a scatti (Jog)
3* @return Codice di errore
4*/
5int ImmStopJOG();
4.4. Esempio di codice per il controllo movimento a scatti del robot
1private void btnJOG_Click(object sender, EventArgs e)
2{
3 Robot robot = new Robot();
4 robot.RPC("192.168.58.2");
5
6 robot.SetSpeed(35);
7 robot.StartJOG(0, 1, 0, 15, 20.0f, 30.0f); //Movimento giunto singolo, StartJOG è un'istruzione non bloccante, durante il movimento altre istruzioni di movimento (incluso StartJOG) vengono ignorate
8 Thread.Sleep(1000);
9 robot.StopJOG(1); //Arresto decelerato movimento a scatti giunto singolo robot
10 //robot.ImmStopJOG(); //Arresto immediato movimento a scatti giunto singolo robot
11 robot.StartJOG(0, 2, 1, 15, 20.0f, 30.0f);
12 Thread.Sleep(1000);
13 robot.ImmStopJOG();
14 robot.StartJOG(0, 3, 1, 15, 20.0f, 30.0f);
15 Thread.Sleep(1000);
16 robot.ImmStopJOG();
17 robot.StartJOG(0, 4, 1, 15, 20.0f, 30.0f);
18 Thread.Sleep(1000);
19 robot.ImmStopJOG();
20 robot.StartJOG(0, 5, 1, 15, 20.0f, 30.0f);
21 Thread.Sleep(1000);
22 robot.ImmStopJOG();
23 robot.StartJOG(0, 6, 1, 15, 20.0f, 30.0f);
24 Thread.Sleep(1000);
25 robot.ImmStopJOG();
26
27 robot.StartJOG(2, 1, 0, 15, 20.0f, 30.0f); //Movimento a scatti in sistema di coordinate base
28 Thread.Sleep(1000);
29 robot.StopJOG(3); //Arresto decelerato movimento a scatti giunto singolo robot
30 //robot.ImmStopJOG(); //Arresto immediato movimento a scatti giunto singolo robot
31 robot.StartJOG(2, 2, 1, 15, 20.0f, 30.0f);
32 Thread.Sleep(1000);
33 robot.ImmStopJOG();
34 robot.StartJOG(2, 3, 1, 15, 20.0f, 30.0f);
35 Thread.Sleep(1000);
36 robot.ImmStopJOG();
37 robot.StartJOG(2, 4, 1, 15, 20.0f, 30.0f);
38 Thread.Sleep(1000);
39 robot.ImmStopJOG();
40 robot.StartJOG(2, 5, 1, 15, 20.0f, 30.0f);
41 Thread.Sleep(1000);
42 robot.ImmStopJOG();
43 robot.StartJOG(2, 6, 1, 15, 20.0f, 30.0f);
44 Thread.Sleep(1000);
45 robot.ImmStopJOG();
46
47 robot.StartJOG(4, 1, 0, 15, 20.0f, 30.0f); //Movimento a scatti in sistema di coordinate utensile
48 Thread.Sleep(1000);
49 robot.StopJOG(5); //Arresto decelerato movimento a scatti giunto singolo robot
50 //robot.ImmStopJOG(); //Arresto immediato movimento a scatti giunto singolo robot
51 robot.StartJOG(4, 2, 1, 15, 20.0f, 30.0f);
52 Thread.Sleep(1000);
53 robot.ImmStopJOG();
54 robot.StartJOG(4, 3, 1, 15, 20.0f, 30.0f);
55 Thread.Sleep(1000);
56 robot.ImmStopJOG();
57 robot.StartJOG(4, 4, 1, 15, 20.0f, 30.0f);
58 Thread.Sleep(1000);
59 robot.ImmStopJOG();
60 robot.StartJOG(4, 5, 1, 15, 20.0f, 30.0f);
61 Thread.Sleep(1000);
62 robot.ImmStopJOG();
63 robot.StartJOG(4, 6, 1, 15, 20.0f, 30.0f);
64 Thread.Sleep(1000);
65 robot.ImmStopJOG();
66
67 robot.StartJOG(8, 1, 0, 15, 20.0f, 30.0f); //Movimento a scatti in sistema di coordinate pezzo
68 Thread.Sleep(1000);
69 robot.StopJOG(9); //Arresto decelerato movimento a scatti giunto singolo robot
70 //robot.ImmStopJOG(); //Arresto immediato movimento a scatti giunto singolo robot
71 robot.StartJOG(8, 2, 1, 15, 20.0f, 30.0f);
72 Thread.Sleep(1000);
73 robot.ImmStopJOG();
74 robot.StartJOG(8, 3, 1, 15, 20.0f, 30.0f);
75 Thread.Sleep(1000);
76 robot.ImmStopJOG();
77 robot.StartJOG(8, 4, 1, 15, 20.0f, 30.0f);
78 Thread.Sleep(1000);
79 robot.ImmStopJOG();
80 robot.StartJOG(8, 5, 1, 15, 20.0f, 30.0f);
81 Thread.Sleep(1000);
82 robot.ImmStopJOG();
83 robot.StartJOG(8, 6, 1, 15, 20.0f, 30.0f);
84 Thread.Sleep(1000);
85 robot.ImmStopJOG();
86}
4.5. Movimento nello spazio giunti (PTP)
1/**
2* @brief Movimento nello spazio giunti (PTP)
3* @param [in] joint_pos Posizione giunti target, unità deg
4* @param [in] desc_pos Posa cartesiana target
5* @param [in] tool Numero sistema di coordinate utensile, intervallo [0~14]
6* @param [in] user Numero sistema di coordinate pezzo, intervallo [0~14]
7* @param [in] vel Percentuale velocità, intervallo [0~100]
8* @param [in] acc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
9* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
10* @param [in] epos Posizione asse esteso, unità mm
11* @param [in] blendT [-1.0]-Movimento fino a posizione (bloccante), [0~500.0]-Tempo smooth (non bloccante), unità ms
12* @param [in] offset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
13* @param [in] offset_pos Quantità offset posa
14* @return Codice di errore
15*/
16int MoveJ(JointPos joint_pos, DescPose desc_pos, int tool, int user, float vel, float acc, float ovl, ExaxisPos epos, float blendT, byte offset_flag, DescPose offset_pos);
4.6. Movimento nello spazio giunti (calcolo cinematica diretta automatico)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Movimento nello spazio giunti (calcolo cinematica diretta automatico)
3* @param [in] joint_pos Posizione giunti target, unità deg
4* @param [in] tool Numero sistema di coordinate utensile, intervallo [0~14]
5* @param [in] user Numero sistema di coordinate pezzo, intervallo [0~14]
6* @param [in] vel Percentuale velocità, intervallo [0~100]
7* @param [in] acc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
8* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
9* @param [in] epos Posizione asse esteso, unità mm
10* @param [in] blendT [-1.0]-Movimento fino a posizione (bloccante), [0~500.0]-Tempo smooth (non bloccante), unità ms
11* @param [in] offset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
12* @param [in] offset_pos Quantità offset posa
13* @return Codice di errore
14*/
15int MoveJ(JointPos joint_pos, int tool, int user, double vel, double acc, double ovl, ExaxisPos epos, double blendT, int offset_flag, DescPose offset_pos)
4.7. Movimento lineare nello spazio cartesiano (LIN)
1/**
2* @brief Movimento lineare nello spazio cartesiano
3* @param [in] joint_pos Posizione articolare target, unità deg
4* @param [in] desc_pos Posa cartesiana target
5* @param [in] tool Numero coordinate utensile, intervallo [0~14]
6* @param [in] user Numero coordinate pezzo, intervallo [0~14]
7* @param [in] vel Percentuale velocità, intervallo [0~100]
8* @param [in] acc Percentuale accelerazione, intervallo [0~100], attualmente non disponibile
9* @param [in] ovl Fattore di scala velocità [0~100]/Velocità fisica (mm/s)
10* @param [in] blendR [-1.0]-Movimento a posizione (bloccante), [0~1000.0]-Raggio di transizione (non bloccante), unità mm
11* @param [in] blendMode Modalità transizione; 0-Transizione inscritta; 1-Transizione angolo
12* @param [in] epos Posizione asse esteso, unità mm
13* @param [in] search 0-Nessun tracking filo saldatura, 1-Tracking filo saldatura
14* @param [in] offset_flag 0-Nessun offset, 1-Offset in sistema coordinate base/pezzo, 2-Offset in sistema coordinate utensile
15* @param [in] offset_pos Offset di posa
16* @param [in] oacc Fattore di scala accelerazione [0-100]/Accelerazione fisica (mm/s²)
17* @param [in] velAccParamMode Modalità parametri velocità/accelerazione; 0-Percentuale; 1-Velocità fisica (mm/s) e accelerazione (mm/s²)
18* @param [in] overSpeedStrategy Strategia gestione sovravelocità, 1-Standard; 2-Errore e arresto su sovravelocità; 3-Riduzione velocità adattativa, default è 0
19* @param [in] speedPercent Percentuale soglia riduzione velocità consentita [0-100], default 10%
20* @return Codice errore
21*/
22public int MoveL(JointPos joint_pos, DescPose desc_pos, int tool, int user, float vel, float acc, float ovl, float blendR, int blendMode, ExaxisPos epos, int search, int offset_flag, DescPose offset_pos, float oacc, int velAccParamMode, int overSpeedStrategy = 0, int speedPercent = 10)
4.8. Movimento lineare nello spazio cartesiano (calcolo cinematica inversa automatico)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Movimento lineare nello spazio cartesiano (calcolo cinematica inversa automatico)
3* @param [in] desc_pos Posa cartesiana target
4* @param [in] tool Numero sistema di coordinate utensile, intervallo [1~15]
5* @param [in] user Numero sistema di coordinate pezzo, intervallo [1~15]
6* @param [in] vel Percentuale velocità, intervallo [0~100]
7* @param [in] acc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
8* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
9* @param [in] blendR [-1.0]-Movimento fino a posizione (bloccante), [0~1000.0]-Raggio smooth (non bloccante), unità mm
10* @param [in] blendMode Modalità transizione; 0-Transizione tangente interna; 1-Transizione ad angolo
11* @param [in] epos Posizione asse esteso, unità mm
12* @param [in] search 0-Nessuna ricerca del filo di saldatura, 1-Ricerca del filo di saldatura
13* @param [in] offset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
14* @param [in] offset_pos Quantità offset posa
15* @param [in] config Configurazione spazio giunti per cinematica inversa, [-1]-Calcolo riferito alla posizione giunti corrente, [0~7]-Soluzione basata su specifica configurazione spazio giunti
16* @param [in] overSpeedStrategy Strategia gestione sovra-velocità, 1-Standard; 2-Arresto con errore in caso di sovra-velocità; 3-Decelerazione adattativa, default 0
17* @param [in] speedPercent Percentuale soglia di decelerazione consentita [0-100], default 10%
18* @return Codice di errore
19*/
20int MoveL(DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, int blendMode, ExaxisPos epos, int search, int offset_flag, DescPose offset_pos, int config, int overSpeedStrategy, int speedPercent)
4.9. Movimento lineare nello spazio cartesiano (aggiunto parametro modalità velocità/accelerazione velAccParamMode)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Movimento lineare nello spazio cartesiano (aggiunto parametro modalità velocità/accelerazione velAccParamMode)
3* @param [in] joint_pos Posizione giunti target, unità deg
4* @param [in] desc_pos Posa cartesiana target
5* @param [in] tool Numero sistema di coordinate utensile, intervallo [1~15]
6* @param [in] user Numero sistema di coordinate pezzo, intervallo [1~15]
7* @param [in] vel Percentuale velocità, intervallo [0~100]
8* @param [in] acc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
9* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
10* @param [in] blendR [-1.0]-Movimento fino a posizione (bloccante), [0~1000.0]-Raggio smooth (non bloccante), unità mm
11* @param [in] epos Posizione asse esteso, unità mm
12* @param [in] search 0-Nessuna ricerca del filo di saldatura, 1-Ricerca del filo di saldatura
13* @param [in] offset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
14* @param [in] offset_pos Quantità offset posa
15* @param [in] velAccParamMode Modalità parametri velocità/accelerazione; 0-Percentuale; 1-Velocità fisica (mm/s) accelerazione (mm/s2)
16* @param [in] overSpeedStrategy Strategia gestione sovra-velocità, 1-Standard; 2-Arresto con errore in caso di sovra-velocità; 3-Decelerazione adattativa, default 0
17* @param [in] speedPercent Percentuale soglia di decelerazione consentita [0-100], default 10%
18* @return Codice di errore
19*/
20public int MoveL(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, ExaxisPos epos, int search, int offset_flag, DescPose offset_pos, int velAccParamMode, int overSpeedStrategy, int speedPercent)
4.10. Movimento lineare nello spazio cartesiano (overload 1 aggiunto blendMode)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Movimento lineare nello spazio cartesiano (overload 1 aggiunto blendMode)
3* @param [in] joint_pos Posizione giunti target, unità deg
4* @param [in] desc_pos Posa cartesiana target
5* @param [in] tool Numero sistema di coordinate utensile, intervallo [1~15]
6* @param [in] user Numero sistema di coordinate pezzo, intervallo [1~15]
7* @param [in] vel Percentuale velocità, intervallo [0~100]
8* @param [in] acc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
9* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
10* @param [in] blendR [-1.0]-Movimento fino a posizione (bloccante), [0~1000.0]-Raggio smooth (non bloccante), unità mm
11* @param [in] blendMode Modalità transizione; 0-Transizione tangente interna; 1-Transizione ad angolo
12* @param [in] epos Posizione asse esteso, unità mm
13* @param [in] search 0-Nessuna ricerca del filo di saldatura, 1-Ricerca del filo di saldatura
14* @param [in] offset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
15* @param [in] offset_pos Quantità offset posa
16* @param [in] velAccParamMode Modalità parametri velocità/accelerazione; 0-Percentuale; 1-Velocità fisica (mm/s) accelerazione (mm/s2)
17* @param [in] overSpeedStrategy Strategia gestione sovra-velocità, 1-Standard; 2-Arresto con errore in caso di sovra-velocità; 3-Decelerazione adattativa, default 0
18* @param [in] speedPercent Percentuale soglia di decelerazione consentita [0-100], default 10%
19* @return Codice di errore
20*/
21public int MoveL(JointPos joint_pos, DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, int blendMode, ExaxisPos epos, int search, int offset_flag, DescPose offset_pos, int velAccParamMode, int overSpeedStrategy, int speedPercent)
4.11. Movimento lineare nello spazio cartesiano (overload 2 senza input posizione giunti)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Movimento lineare nello spazio cartesiano (overload 2 senza input posizione giunti)
3* @param [in] desc_pos Posa cartesiana target
4* @param [in] tool Numero sistema di coordinate utensile, intervallo [1~15]
5* @param [in] user Numero sistema di coordinate pezzo, intervallo [1~15]
6* @param [in] vel Percentuale velocità, intervallo [0~100]
7* @param [in] acc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
8* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
9* @param [in] blendR [-1.0]-Movimento fino a posizione (bloccante), [0~1000.0]-Raggio smooth (non bloccante), unità mm
10* @param [in] blendMode Modalità transizione; 0-Transizione tangente interna; 1-Transizione ad angolo
11* @param [in] epos Posizione asse esteso, unità mm
12* @param [in] search 0-Nessuna ricerca del filo di saldatura, 1-Ricerca del filo di saldatura
13* @param [in] offset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
14* @param [in] offset_pos Quantità offset posa
15* @param [in] config Configurazione spazio giunti per cinematica inversa, [-1]-Calcolo riferito alla posizione giunti corrente, [0~7]-Soluzione basata su specifica configurazione spazio giunti
16* @param [in] velAccParamMode Modalità parametri velocità/accelerazione; 0-Percentuale; 1-Velocità fisica (mm/s) accelerazione (mm/s2)
17* @param [in] overSpeedStrategy Strategia gestione sovra-velocità, 1-Standard; 2-Arresto con errore in caso di sovra-velocità; 3-Decelerazione adattativa, default 0
18* @param [in] speedPercent Percentuale soglia di decelerazione consentita [0-100], default 10%
19* @return Codice di errore
20*/
21public int MoveL(DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, int blendMode, ExaxisPos epos, int search, int offset_flag, DescPose offset_pos, int config, int velAccParamMode, int overSpeedStrategy, int speedPercent)
4.12. Movimento circolare nello spazio cartesiano (CIRC/ARC)
1/**
2* @brief Movimento circolare nello spazio cartesiano (CIRC/ARC)
3* @param [in] joint_pos_p Posizione giunti punto di percorso, unità deg
4* @param [in] desc_pos_p Posa cartesiana punto di percorso
5* @param [in] ptool Numero sistema di coordinate utensile punto di percorso, intervallo [0~14]
6* @param [in] puser Numero sistema di coordinate pezzo punto di percorso, intervallo [0~14]
7* @param [in] pvel Percentuale velocità, intervallo [0~100]
8* @param [in] pacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
9* @param [in] epos_p Posizione asse esteso punto intermedio, unità mm
10* @param [in] poffset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
11* @param [in] offset_pos_p Quantità offset posa
12* @param [in] joint_pos_t Posizione giunti punto target, unità deg
13* @param [in] desc_pos_t Posa cartesiana punto target
14* @param [in] ttool Numero sistema di coordinate utensile punto target, intervallo [0~14]
15* @param [in] tuser Numero sistema di coordinate pezzo punto target, intervallo [0~14]
16* @param [in] tvel Percentuale velocità, intervallo [0~100]
17* @param [in] tacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
18* @param [in] epos_t Posizione asse esteso, unità mm
19* @param [in] toffset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
20* @param [in] offset_pos_t Quantità offset posa
21* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
22* @param [in] blendR [-1.0]-Movimento fino a posizione (bloccante), [0~1000.0]-Raggio smooth (non bloccante), unità mm
23* @param [in] oacc Fattore di scala accelerazione [0-100]/Accelerazione fisica (mm/s²)
24* @param [in] velAccParamMode Modalità parametri velocità/accelerazione; 0-Percentuale; 1-Velocità fisica (mm/s) e accelerazione (mm/s²)
25* @return Codice di errore
26*/
27public int MoveC(JointPos joint_pos_p, DescPose desc_pos_p, int ptool, int puser, float pvel, float pacc,ExaxisPos epos_p, int poffset_flag, DescPose offset_pos_p,JointPos joint_pos_t, DescPose desc_pos_t, int ttool, int tuser, float tvel, float tacc,ExaxisPos epos_t, int toffset_flag, DescPose offset_pos_t,float ovl, float blendR, float oacc, int velAccParamMode)
4.13. Movimento circolare nello spazio cartesiano (calcolo cinematica inversa automatico)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Movimento circolare nello spazio cartesiano (calcolo cinematica inversa automatico)
3* @param [in] desc_pos_p Posa cartesiana punto di percorso
4* @param [in] ptool Numero sistema di coordinate utensile punto di percorso, intervallo [1~15]
5* @param [in] puser Numero sistema di coordinate pezzo punto di percorso, intervallo [1~15]
6* @param [in] pvel Percentuale velocità, intervallo [0~100]
7* @param [in] pacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
8* @param [in] epos_p Posizione asse esteso punto intermedio, unità mm
9* @param [in] poffset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
10* @param [in] offset_pos_p Quantità offset posa
11* @param [in] desc_pos_t Posa cartesiana punto target
12* @param [in] ttool Numero sistema di coordinate utensile punto target, intervallo [1~15]
13* @param [in] tuser Numero sistema di coordinate pezzo punto target, intervallo [1~15]
14* @param [in] tvel Percentuale velocità, intervallo [0~100]
15* @param [in] tacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
16* @param [in] epos_t Posizione asse esteso, unità mm
17* @param [in] toffset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
18* @param [in] offset_pos_t Quantità offset posa
19* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
20* @param [in] blendR [-1.0]-Movimento fino a posizione (bloccante), [0~1000.0]-Raggio smooth (non bloccante), unità mm
21* @param [in] config Configurazione spazio giunti per cinematica inversa, [-1]-Calcolo riferito alla posizione giunti corrente, [0~7]-Soluzione basata su specifica configurazione spazio giunti
22* @return Codice di errore
23*/
24int MoveC(DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, int poffset_flag, DescPose offset_pos_p, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, int toffset_flag, DescPose offset_pos_t, double ovl, double blendR, int config)
4.14. Movimento circolare nello spazio cartesiano (aggiunto parametro modalità velocità/accelerazione velAccParamMode)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Movimento circolare nello spazio cartesiano (aggiunto parametro modalità velocità/accelerazione velAccParamMode)
3* @param [in] joint_pos_p Posizione giunti punto di percorso, unità deg
4* @param [in] desc_pos_p Posa cartesiana punto di percorso
5* @param [in] ptool Numero sistema di coordinate utensile punto di percorso, intervallo [1~15]
6* @param [in] puser Numero sistema di coordinate pezzo punto di percorso, intervallo [1~15]
7* @param [in] pvel Percentuale velocità, intervallo [0~100]
8* @param [in] pacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
9* @param [in] epos_p Posizione asse esteso punto intermedio, unità mm
10* @param [in] poffset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
11* @param [in] offset_pos_p Quantità offset posa
12* @param [in] joint_pos_t Posizione giunti punto target, unità deg
13* @param [in] desc_pos_t Posa cartesiana punto target
14* @param [in] ttool Numero sistema di coordinate utensile punto target, intervallo [1~15]
15* @param [in] tuser Numero sistema di coordinate pezzo punto target, intervallo [1~15]
16* @param [in] tvel Percentuale velocità, intervallo [0~100]
17* @param [in] tacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
18* @param [in] epos_t Posizione asse esteso, unità mm
19* @param [in] toffset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
20* @param [in] offset_pos_t Quantità offset posa
21* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
22* @param [in] blendR [-1.0]-Movimento fino a posizione (bloccante), [0~1000.0]-Raggio smooth (non bloccante), unità mm
23* @param [in] velAccParamMode Modalità parametri velocità/accelerazione; 0-Percentuale; 1-Velocità fisica (mm/s) accelerazione (mm/s2)
24* @return Codice di errore
25*/
26public int MoveC(JointPos joint_pos_p, DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, int poffset_flag, DescPose offset_pos_p, JointPos joint_pos_t, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, int toffset_flag, DescPose offset_pos_t, double ovl, double blendR, int velAccParamMode)
4.15. Movimento circolare nello spazio cartesiano (overload 1 senza input posizione giunti)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Movimento circolare nello spazio cartesiano (overload 1 senza input posizione giunti)
3* @param [in] desc_pos_p Posa cartesiana punto di percorso
4* @param [in] ptool Numero sistema di coordinate utensile punto di percorso, intervallo [1~15]
5* @param [in] puser Numero sistema di coordinate pezzo punto di percorso, intervallo [1~15]
6* @param [in] pvel Percentuale velocità, intervallo [0~100]
7* @param [in] pacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
8* @param [in] epos_p Posizione asse esteso punto intermedio, unità mm
9* @param [in] poffset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
10* @param [in] offset_pos_p Quantità offset posa
11* @param [in] desc_pos_t Posa cartesiana punto target
12* @param [in] ttool Numero sistema di coordinate utensile punto target, intervallo [1~15]
13* @param [in] tuser Numero sistema di coordinate pezzo punto target, intervallo [1~15]
14* @param [in] tvel Percentuale velocità, intervallo [0~100]
15* @param [in] tacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
16* @param [in] epos_t Posizione asse esteso, unità mm
17* @param [in] toffset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
18* @param [in] offset_pos_t Quantità offset posa
19* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
20* @param [in] blendR [-1.0]-Movimento fino a posizione (bloccante), [0~1000.0]-Raggio smooth (non bloccante), unità mm
21* @param [in] config Configurazione spazio giunti per cinematica inversa, [-1]-Calcolo riferito alla posizione giunti corrente, [0~7]-Soluzione basata su specifica configurazione spazio giunti
22* @param [in] velAccParamMode Modalità parametri velocità/accelerazione; 0-Percentuale; 1-Velocità fisica (mm/s) accelerazione (mm/s2)
23* @return Codice di errore
24*/
25public int MoveC(DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, int poffset_flag, DescPose offset_pos_p, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, int toffset_flag, DescPose offset_pos_t, double ovl, double blendR, int config, int velAccParamMode)
4.16. Movimento punto a punto nello spazio cartesiano
1/**
2* @brief Movimento punto a punto nello spazio cartesiano
3* @param [in] desc_pos Posa cartesiana target nel sistema di coordinate base
4* @param [in] tool Numero sistema di coordinate utensile, intervallo [0~14]
5* @param [in] user Numero sistema di coordinate pezzo, intervallo [0~14]
6* @param [in] vel Percentuale velocità, intervallo [0~100]
7* @param [in] acc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
8* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
9* @param [in] blendT [-1.0]-Movimento fino a posizione (bloccante), [0~500.0]-Tempo smooth (non bloccante), unità ms
10* @param [in] config Configurazione spazio giunti, [-1]-Calcolo riferito alla posizione giunti corrente, [0~7]-Calcolo riferito a specifica configurazione spazio giunti, default -1
11* @return Codice di errore
12*/
13int MoveCart(DescPose desc_pos, int tool, int user, float vel, float acc, float ovl, float blendT, int config);
4.17. Movimento cerchio completo nello spazio cartesiano
Nuovo nella versione C#SDK-V1.1.4: Web-3.8.3
1/**
2* @brief Movimento cerchio completo nello spazio cartesiano
3* @param [in] joint_pos_p Posizione giunti punto di percorso 1, unità deg
4* @param [in] desc_pos_p Posa cartesiana punto di percorso 1
5* @param [in] ptool Numero sistema di coordinate utensile punto di percorso 1, intervallo [0~14]
6* @param [in] puser Numero sistema di coordinate pezzo punto di percorso 1, intervallo [0~14]
7* @param [in] pvel Percentuale velocità, intervallo [0~100]
8* @param [in] pacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
9* @param [in] epos_p Posizione asse esteso punto di percorso 1, unità mm
10* @param [in] joint_pos_t Posizione giunti punto di percorso 2, unità deg
11* @param [in] desc_pos_t Posa cartesiana punto di percorso 2
12* @param [in] ttool Numero sistema di coordinate utensile punto di percorso 2, intervallo [0~14]
13* @param [in] tuser Numero sistema di coordinate pezzo punto di percorso 2, intervallo [0~14]
14* @param [in] tvel Percentuale velocità, intervallo [0~100]
15* @param [in] tacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
16* @param [in] epos_t Posizione asse esteso punto di percorso 2, unità mm
17* @param [in] ovl Fattore di scala velocità [0~100]/Velocità fisica (mm/s)
18* @param [in] offset_flag 0-Nessun offset, 1-Offset in sistema coordinate base/pezzo, 2-Offset in sistema coordinate utensile
19* @param [in] offset_pos Offset di posa
20* @param [in] oacc Fattore di scala accelerazione [0-100]/Accelerazione fisica (mm/s²)
21* @param [in] blendR -1: Bloccante; 0~1000: Raggio di transizione
22* @param [in] velAccParamMode Modalità parametri velocità/accelerazione; 0-Percentuale; 1-Velocità fisica (mm/s) e accelerazione (mm/s²)
23* @return Codice errore
24*/
25public int Circle(JointPos joint_pos_p, DescPose desc_pos_p, int ptool, int puser, float pvel, float pacc,ExaxisPos epos_p, JointPos joint_pos_t, DescPose desc_pos_t, int ttool, int tuser,float tvel, float tacc, ExaxisPos epos_t, float ovl, int offset_flag,DescPose offset_pos, double oacc, double blendR, int velAccParamMode)
4.18. Movimento cerchio completo nello spazio cartesiano (calcolo cinematica inversa automatico)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2 * @brief Movimento cerchio completo nello spazio cartesiano (calcolo cinematica inversa automatico)
3 * @param [in] desc_pos_p Posa cartesiana punto di percorso 1
4 * @param [in] ptool Numero sistema di coordinate utensile punto di percorso 1, intervallo [0~14]
5 * @param [in] puser Numero sistema di coordinate pezzo punto di percorso 1, intervallo [0~14]
6 * @param [in] pvel Percentuale velocità, intervallo [0~100]
7 * @param [in] pacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
8 * @param [in] epos_p Posizione asse esteso punto di percorso 1, unità mm
9 * @param [in] desc_pos_t Posa cartesiana punto di percorso 2
10 * @param [in] ttool Numero sistema di coordinate utensile punto di percorso 2, intervallo [0~14]
11 * @param [in] tuser Numero sistema di coordinate pezzo punto di percorso 2, intervallo [0~14]
12 * @param [in] tvel Percentuale velocità, intervallo [0~100]
13 * @param [in] tacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
14 * @param [in] epos_t Posizione asse esteso punto di percorso 2, unità mm
15 * @param [in] ovl Fattore di scala velocità, intervallo [0~100]
16 * @param [in] offset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
17 * @param [in] offset_pos Quantità offset posa
18 * @param [in] oacc Percentuale accelerazione
19 * @param [in] blendR -1: Bloccante; 0~1000: Raggio smooth
20 * @param [in] config Configurazione spazio giunti per cinematica inversa, [-1]-Calcolo riferito alla posizione giunti corrente, [0~7]-Soluzione basata su specifica configurazione spazio giunti
21 * @return Codice di errore
22 */
23int Circle(DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, double ovl, int offset_flag, DescPose offset_pos, double oacc, double blendR,int config)
4.19. Movimento cerchio completo nello spazio cartesiano (aggiunto parametro modalità velocità/accelerazione velAccParamMode)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2*@brief Movimento cerchio completo nello spazio cartesiano (aggiunto parametro modalità velocità/accelerazione velAccParamMode)
3*@param [in] joint_pos_p Posizione giunti punto di percorso 1, unità deg
4*@param [in] desc_pos_p Posa cartesiana punto di percorso 1
5*@param [in] ptool Numero sistema di coordinate utensile punto di percorso 1, intervallo [1~15]
6*@param [in] puser Numero sistema di coordinate pezzo punto di percorso 1, intervallo [1~15]
7*@param [in] pvel Percentuale velocità, intervallo [0~100]
8*@param [in] pacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
9*@param [in] epos_p Posizione asse esteso punto di percorso 1, unità mm
10*@param [in] joint_pos_t Posizione giunti punto di percorso 2, unità deg
11*@param [in] desc_pos_t Posa cartesiana punto di percorso 2
12*@param [in] ttool Numero sistema di coordinate utensile punto di percorso 2, intervallo [1~15]
13*@param [in] tuser Numero sistema di coordinate pezzo punto di percorso 2, intervallo [1~15]
14*@param [in] tvel Percentuale velocità, intervallo [0~100]
15*@param [in] tacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
16*@param [in] epos_t Posizione asse esteso punto di percorso 2, unità mm
17*@param [in] ovl Fattore di scala velocità, intervallo [0~100]
18*@param [in] offset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
19*@param [in] offset_pos Quantità offset posa
20*@param [in] oacc Percentuale accelerazione
21*@param [in] blendR -1: Bloccante; 0~1000: Raggio smooth
22*@param [in] velAccParamMode Modalità parametri velocità/accelerazione; 0-Percentuale; 1-Velocità fisica (mm/s) accelerazione (mm/s2)
23*@return Codice di errore
24*/
25public int Circle(JointPos joint_pos_p, DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, JointPos joint_pos_t, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, double ovl, int offset_flag, DescPose offset_pos, double oacc, double blendR, int velAccParamMode)
4.20. Movimento cerchio completo nello spazio cartesiano (overload 1 senza input posizione giunti)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Movimento cerchio completo nello spazio cartesiano (overload 1 senza input posizione giunti)
3* @param [in] desc_pos_p Posa cartesiana punto di percorso 1
4* @param [in] ptool Numero sistema di coordinate utensile punto di percorso 1, intervallo [0~14]
5* @param [in] puser Numero sistema di coordinate pezzo punto di percorso 1, intervallo [0~14]
6* @param [in] pvel Percentuale velocità, intervallo [0~100]
7* @param [in] pacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
8* @param [in] epos_p Posizione asse esteso punto di percorso 1, unità mm
9* @param [in] desc_pos_t Posa cartesiana punto di percorso 2
10* @param [in] ttool Numero sistema di coordinate utensile punto di percorso 2, intervallo [0~14]
11* @param [in] tuser Numero sistema di coordinate pezzo punto di percorso 2, intervallo [0~14]
12* @param [in] tvel Percentuale velocità, intervallo [0~100]
13* @param [in] tacc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
14* @param [in] epos_t Posizione asse esteso punto di percorso 2, unità mm
15* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
16* @param [in] offset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
17* @param [in] offset_pos Quantità offset posa
18* @param [in] oacc Percentuale accelerazione
19* @param [in] blendR -1: Bloccante; 0~1000: Raggio smooth
20* @param [in] config Configurazione spazio giunti per cinematica inversa, [-1]-Calcolo riferito alla posizione giunti corrente, [0~7]-Soluzione basata su specifica configurazione spazio giunti
21* @param [in] velAccParamMode Modalità parametri velocità/accelerazione; 0-Percentuale; 1-Velocità fisica (mm/s) accelerazione (mm/s2)
22* @return Codice di errore
23*/
24public int Circle(DescPose desc_pos_p, int ptool, int puser, double pvel, double pacc, ExaxisPos epos_p, DescPose desc_pos_t, int ttool, int tuser, double tvel, double tacc, ExaxisPos epos_t, double ovl, int offset_flag, DescPose offset_pos, double oacc, double blendR, int config, int velAccParamMode)
4.21. Esempio di codice per movimento cerchio completo
Nuovo nella versione C#SDK-V1.1.4: Web-3.8.3
1private void btnMovetest_Click(object sender, EventArgs e)
2{
3 int rtn = 0;
4 DescPose middescPoseCir1 = new DescPose(-435.414, -342.926, 309.205, -171.382, -4.513, 171.520);
5 JointPos midjointPosCir1 = new JointPos(26.804, -79.866, 106.642, -125.433, -85.562, -54.721);
6 DescPose enddescPoseCir1 = new DescPose(-524.862, -217.402, 308.459, -171.425, -4.810, 156.088);
7 JointPos endjointPosCir1 = new JointPos(11.399, -78.055, 104.603, -125.421, -85.770, -54.721);
8
9 DescPose middescPoseCir2 = new DescPose(-482.691, -587.899, 318.594, -171.001, -4.999, -172.996);
10 JointPos midjointPosCir2 = new JointPos(42.314, -53.600, 67.296, -112.969, -85.533, -54.721);
11 DescPose enddescPoseCir2 = new DescPose(-403.942, -489.061, 317.038, -163.189, -10.425, -175.627);
12 JointPos endjointPosCir2 = new JointPos(39.959, -70.616, 96.679, -134.243, -82.276, -54.721);
13
14 DescPose middescPoseMoveC = new DescPose(-435.414, -342.926, 309.205, -171.382, -4.513, 171.520);
15 JointPos midjointPosMoveC = new JointPos(26.804, -79.866, 106.642, -125.433, -85.562, -54.721);
16 DescPose enddescPoseMoveC = new DescPose(-524.862, -217.402, 308.459, -171.425, -4.810, 156.088);
17 JointPos endjointPosmoveC = new JointPos(11.399, -78.055, 104.603, -125.421, -85.770, -54.721);
18
19 DescPose middescPoseCir3 = new DescPose(-435.414, -342.926, 309.205, -171.382, -4.513, 171.520);
20 JointPos midjointPosCir3 = new JointPos(26.804, -79.866, 106.642, -125.433, -85.562, -54.721);
21 DescPose enddescPoseCir3 = new DescPose(-569.505, -405.378, 357.596, -172.862, -10.939, 171.108);
22 JointPos endjointPosCir3 = new JointPos(27.138, -63.750, 78.586, -117.861, -90.588, -54.721);
23
24 DescPose middescPoseCir4 = new DescPose(-482.691, -587.899, 318.594, -171.001, -4.999, -172.996);
25 JointPos midjointPosCir4 = new JointPos(42.314, -53.600, 67.296, -112.969, -85.533, -54.721);
26 DescPose enddescPoseCir4 = new DescPose(-569.505, -405.378, 357.596, -172.862, -10.939, 171.108);
27 JointPos endjointPosCir4 = new JointPos(27.138, -63.750, 78.586, -117.861, -90.588, -54.721);
28
29 DescPose startdescPose = new DescPose(-569.505, -405.378, 357.596, -172.862, -10.939, 171.108);
30 JointPos startjointPos = new JointPos(27.138, -63.750, 78.586, -117.861, -90.588, -54.721);
31
32 DescPose linedescPose = new DescPose(-403.942, -489.061, 317.038, -163.189, -10.425, -175.627);
33 JointPos linejointPos = new JointPos(39.959, -70.616, 96.679, -134.243, -82.276, -54.721);
34
35
36 ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
37 DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
38
39
40 robot.MoveJ(startjointPos, startdescPose, 3, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
41 rtn = robot.Circle(midjointPosCir1, middescPoseCir1, 3, 0, 100, 100, exaxisPos, endjointPosCir1, enddescPoseCir1, 3, 0, 100, 100, exaxisPos, 100, -1, offdese, 100, 20);
42 Console.WriteLine("Circle1" + rtn);
43 rtn = robot.Circle(midjointPosCir2, middescPoseCir2, 3, 0, 100, 100, exaxisPos, endjointPosCir2, enddescPoseCir2, 3, 0, 100, 100, exaxisPos, 100, -1, offdese, 100, 20);
44 Console.WriteLine("Circle2" + rtn);
45
46 robot.MoveC(midjointPosMoveC, middescPoseMoveC, 3, 0, 100, 100, exaxisPos, 0, offdese, endjointPosmoveC, enddescPoseMoveC, 3, 0, 100, 100, exaxisPos, 0, offdese, 100, 20);
47 rtn = robot.Circle(midjointPosCir3, middescPoseCir3, 3, 0, 100, 100, exaxisPos, endjointPosCir3, enddescPoseCir3, 3, 0, 100, 100, exaxisPos, 100, -1, offdese, 100, 20);
48 Console.WriteLine("Circle3" + rtn);
49 rtn = robot.MoveL(linejointPos, linedescPose, 3, 0, 100, 100, 100, -1, 0, exaxisPos, 0, 0, offdese);
50 Console.WriteLine("MoveL " + rtn);
51 rtn = robot.Circle(midjointPosCir4, middescPoseCir4, 3, 0, 100, 100, exaxisPos, endjointPosCir4, enddescPoseCir4, 3, 0, 100, 100, exaxisPos, 100, -1, offdese, 100, 20);
52 Console.WriteLine("Circle4" + rtn);
53}
4.22. Esempio di codice per istruzioni di movimento base del robot
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1public void TestMove()
2 int rtn;
3 JointPos j1 = new JointPos(-11.904f, -99.669f, 117.473f, -108.616f, -91.726f, 74.256f);
4 JointPos j2 = new JointPos(-45.615f, -106.172f, 124.296f, -107.151f, -91.282f, 74.255f);
5 JointPos j3 = new JointPos(-29.777f, -84.536f, 109.275f, -114.075f, -86.655f, 74.257f);
6 JointPos j4 = new JointPos(-31.154f, -95.317f, 94.276f, -88.079f, -89.740f, 74.256f);
7 DescPose desc_pos1 = new DescPose(-419.524f, -13.000f, 351.569f, -178.118f, 0.314f, 3.833f);
8 DescPose desc_pos2 = new DescPose(-321.222f, 185.189f, 335.520f, -179.030f, -1.284f, -29.869f);
9 DescPose desc_pos3 = new DescPose(-487.434f, 154.362f, 308.576f, 176.600f, 0.268f, -14.061f);
10 DescPose desc_pos4 = new DescPose(-443.165f, 147.881f, 480.951f, 179.511f, -0.775f, -15.409f);
11 DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
12 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
13 int tool = 0;
14 int user = 0;
15 float vel = 100.0f;
16 float acc = 100.0f;
17 float ovl = 100.0f;
18 float oacc = 100.0f;
19 float blendT = 0.0f;
20 float blendR = 0.0f;
21 byte flag = 0;
22 byte search = 0;
23 int blendMode = 0;
24 int velAccMode = 0;
25 robot.SetSpeed(20);
26 rtn = robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
27 Console.WriteLine($"movej errcode:{rtn}");
28 rtn = robot.MoveL(j2, desc_pos2, tool, user, vel, acc, ovl, blendR, blendMode, epos, search, flag, offset_pos, oacc, velAccMode,0,10);
29 Console.WriteLine($"movel errcode:{rtn}");
30 rtn = robot.MoveC(j3, desc_pos3, tool, user, vel, acc, epos, flag, offset_pos,j4, desc_pos4, tool, user, vel, acc, epos, flag, offset_pos, ovl, blendR, oacc, velAccMode);
31 Console.WriteLine($"movec errcode:{rtn}");
32 rtn = robot.MoveJ(j2, desc_pos2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
33 Console.WriteLine($"movej errcode:{rtn}");
34 rtn = robot.Circle(j3, desc_pos3, tool, user, vel, acc, epos,j1, desc_pos1, tool, user, vel, acc, epos,ovl, flag, offset_pos, oacc, -1, velAccMode);
35 Console.WriteLine($"circle errcode:{rtn}");
36 rtn = robot.MoveCart(desc_pos4, tool, user, vel, acc, ovl, blendT, -1);
37 Console.WriteLine($"MoveCart errcode:{rtn}");
38 rtn = robot.MoveJ(j1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
39 Console.WriteLine($"movej errcode:{rtn}");
40 rtn = robot.MoveL(desc_pos2, tool, user, vel, acc, ovl, blendR, blendMode, epos, search, flag, offset_pos, -1, velAccMode);
41 Console.WriteLine($"movel errcode:{rtn}");
42 rtn = robot.MoveC(desc_pos3, tool, user, vel, acc, epos, flag, offset_pos,desc_pos4, tool, user, vel, acc, epos, flag, offset_pos,ovl, blendR, -1, velAccMode);
43 Console.WriteLine($"movec errcode:{rtn}");
44 rtn = robot.MoveJ(j2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
45 Console.WriteLine($"movej errcode:{rtn}");
46 rtn = robot.Circle(desc_pos3, tool, user, vel, acc, epos, desc_pos1, tool, user, vel, acc, epos,ovl, flag, offset_pos, oacc, blendR, -1, velAccMode);
47 Console.WriteLine($"circle errcode:{rtn}");
48}
4.23. Movimento elicoidale nello spazio cartesiano
1/**
2* @brief Movimento elicoidale nello spazio cartesiano
3* @param [in] joint_pos Posizione giunti target, unità deg
4* @param [in] desc_pos Posa cartesiana target
5* @param [in] tool Numero sistema di coordinate utensile, intervallo [0~14]
6* @param [in] user Numero sistema di coordinate pezzo, intervallo [0~14]
7* @param [in] vel Percentuale velocità, intervallo [0~100]
8* @param [in] acc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
9* @param [in] epos Posizione asse esteso, unità mm
10* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
11* @param [in] offset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
12* @param [in] offset_pos Quantità offset posa
13* @param [in] spiral_param Parametri elica
14* @return Codice di errore
15*/
16int NewSpiral(JointPos joint_pos, DescPose desc_pos, int tool, int user, float vel, float acc, ExaxisPos epos, float ovl, byte offset_flag, DescPose offset_pos, SpiralParam spiral_param);
4.24. Movimento elicoidale nello spazio cartesiano (calcolo cinematica inversa automatico)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Movimento elicoidale nello spazio cartesiano (calcolo cinematica inversa automatico)
3* @param [in] desc_pos Posa cartesiana target
4* @param [in] tool Numero sistema di coordinate utensile, intervallo [0~14]
5* @param [in] user Numero sistema di coordinate pezzo, intervallo [0~14]
6* @param [in] vel Percentuale velocità, intervallo [0~100]
7* @param [in] acc Percentuale accelerazione, intervallo [0~100], non ancora disponibile
8* @param [in] epos Posizione asse esteso, unità mm
9* @param [in] ovl Fattore di scala velocità, intervallo [0~100]
10* @param [in] offset_flag 0-Nessun offset, 1-Offset nel sistema base/pezzo, 2-Offset nel sistema utensile
11* @param [in] offset_pos Quantità offset posa
12* @param [in] spiral_param Parametri elica
13* @param [in] config Configurazione spazio giunti per cinematica inversa, [-1]-Calcolo riferito alla posizione giunti corrente, [0~7]-Soluzione basata su specifica configurazione spazio giunti
14* @return Codice di errore
15*/
16int NewSpiral(DescPose desc_pos, int tool, int user, double vel, double acc, ExaxisPos epos, double ovl, int offset_flag, DescPose offset_pos, SpiralParam spiral_param,int config)
4.25. Esempio di codice per movimento elicoidale
1public static int TestSpiral(Robot robot)
2{
3 int rtn=-1;
4 JointPos j=new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256);
5 DescPose desc_pos=new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833);
6 DescPose offset_pos1=new DescPose(50, 0, 0, -30, 0, 0);
7 DescPose offset_pos2=new DescPose(50, 0, 0, -5, 0, 0);
8 ExaxisPos epos=new ExaxisPos(0, 0, 0, 0);
9 SpiralParam sp=new SpiralParam(1,5.0,50.0,10.0,10.0,0);
10
11 int tool = 0;
12 int user = 0;
13 double vel = 100.0;
14 double acc = 100.0;
15 double ovl = 100.0;
16 double blendT = 0.0;
17 int flag = 2;
18
19 rtn = robot.MoveJ(j, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos1);
20 Console.WriteLine("movej errcode:"+ rtn);
21
22 rtn = robot.NewSpiral(desc_pos, tool, user, vel, acc, epos, ovl, flag, offset_pos2, sp,-1);
23 Console.WriteLine("newspiral errcode:"+ rtn);
24
25 return 0;
26}
4.26. Avvio Movimento Servo
1/**
2* @brief Avvia il movimento servo, utilizzato con i comandi ServoJ e ServoCart
3* @param[in] comType Tipo di invio comando; 0-xmlrpc; 1-UDP (corrisponde alla porta 20007 del robot)
4* @return Codice di errore
5*/
6public int ServoMoveStart (int comType = 0)
4.27. Fine Movimento Servo
1/**
2* @brief Termina il movimento servo, utilizzato con i comandi ServoJ e ServoCart
3* @param[in] comType Tipo di invio comando; 0-xmlrpc; 1-UDP (corrisponde alla porta 20007 del robot)
4* @return Codice di errore
5*/
6public int ServoMoveEnd (int comType = 0)
4.28. Movimento in Modalità Servo nello Spazio dei Giunti
Nuovo nella versione C#SDK-V1.1.4: Web-3.8.3
1/**
2* @brief Movimento in modalità servo nello spazio dei giunti
3* @param [in] joint_pos Posizione giunto target, unità deg
4* @param [in] axisPos Posizione assi esterni, unità mm
5* @param [in] acc Percentuale di accelerazione, intervallo [0~100], temporaneamente non aperta, default 0
6* @param [in] vel Percentuale di velocità, intervallo [0~100], temporaneamente non aperta, default 0
7* @param [in] cmdT Periodo di invio comando, unità s, intervallo consigliato [0.001~0.0016]
8* @param [in] filterT Tempo di filtro, unità s, temporaneamente non aperto, default 0
9* @param [in] gain Amplificatore proporzionale per la posizione target, temporaneamente non aperto, default 0
10* @param [in] id ID comando ServoJ, default 0
11* @param [in] comType Tipo di invio comando; 0-xmlrpc; 1-UDP (corrisponde alla porta 20007 del robot)
12* @return Codice di errore
13*/
14public int ServoJ(JointPos joint_pos, ExaxisPos axisPos, float acc, float vel, float cmdT, float filterT, float gain, int id = 0, int comType = 0)
4.29. Esempio di Codice SDK per ServoJ, ServoMoveStart, ServoMoveEnd basato su Comunicazione UDP
Nuovo nella versione C#SDK-V1.1.4: Web-3.8.3
1public void TestServoJUDP()
2{
3 // Iscriviti al callback
4 robot.OnUdpFrameReceived += (comType, frameCount, frameCmdID, contentLen, content) =>
5 {
6 Console.WriteLine($"[] comType={comType}, count={frameCount}, cmdID={frameCmdID}, content={content}");
7 };
8
9 ROBOT_STATE_PKG pkg = new ROBOT_STATE_PKG();
10
11 float vel = 0.0f;
12 float acc = 0.0f;
13 float cmdT = 0.008f;
14 float filterT = 0.0f;
15 float gain = 0.0f;
16 byte flag = 0;
17 int count = 300;
18 float dt = 0.1f;
19 int cmdID = 0;
20
21 while (true)
22 {
23 JointPos j = new JointPos(0, -90, 90, 0, 0, 0);
24 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
25 DescPose offset_pos = new DescPose(0, -90, 90, 0, 0, 0);
26 robot.MoveJ(j, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
27 int ret = robot.GetActualJointPosDegree(flag, ref j);
28 if (ret == 0)
29 {
30 count = 300;
31 cmdID += 1;
32 robot.ServoMoveStart(1);
33
34 while (count > 0)
35 {
36 robot.ServoJ(j, epos, acc, vel, cmdT, filterT, gain, cmdID, 1);
37 j.jPos[0] += dt;
38 j.jPos[1] += dt;
39 j.jPos[3] += dt;
40 j.jPos[4] += dt;
41 j.jPos[5] += dt;
42 epos.ePos[0] += dt;
43 count -= 1;
44 Thread.Sleep(1);
45 robot.GetRobotRealTimeState(ref pkg);
46 }
47 robot.ServoMoveEnd(1);
48
49 Thread.Sleep(1000);
50 count = 300;
51 robot.ServoMoveStart(1);
52 while (count > 0)
53 {
54 robot.ServoJ(j, epos, acc, vel, cmdT, filterT, gain, cmdID, 1);
55 j.jPos[0] -= dt;
56 j.jPos[1] -= dt;
57 j.jPos[3] -= dt;
58 j.jPos[4] -= dt;
59 j.jPos[5] -= dt;
60 epos.ePos[0] -= dt;
61 count -= 1;
62 Thread.Sleep(1);
63 robot.GetRobotRealTimeState(ref pkg);
64 }
65 robot.ServoMoveEnd(1);
66 }
67 else
68 {
69 Console.WriteLine($"GetActualJointPosDegree errcode:{ret}");
70 }
71 }
72}
4.30. Esempio di codice movimento modalità servomotore spazio articolare
Nuovo nella versione C#SDK-V1.1.4: Web-3.8.3
1private void btnJointServoMove_Click(object sender, EventArgs e)
2{
3 JointPos j = new JointPos(0, 0, 0, 0, 0, 0);
4 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
5
6 float vel = 0.0f;
7 float acc = 0.0f;
8 float cmdT = 0.008f;
9 float filterT = 0.0f;
10 float gain = 0.0f;
11 byte flag = 0;
12 int count = 500;
13 float dt = 0.1f;
14 int cmdID = 0;
15 int ret = robot.GetActualJointPosDegree(flag, ref j);
16 if (ret == 0)
17 {
18 robot.ServoMoveStart();
19
20 try
21 {
22 while (count > 0)
23 {
24
25 robot.ServoJ(j, epos, acc, vel, cmdT, filterT, gain, cmdID);
26
27
28 j.jPos[0] += dt;
29 count--;
30
31
32 robot.WaitMs((int)(cmdT * 1000));
33 }
34 }
35 finally
36 {
37
38 robot.ServoMoveEnd();
39 }
40 }
41 else
42 {
43 Console.WriteLine($"GetActualJointPosDegree error code: {ret}");
44
45 }
46}
4.31. Avvio Controllo di Coppia dei Giunti
1/**
2* @brief Avvia il controllo di coppia dei giunti
3* @param [in] comType Tipo di invio comando; 0-xmlrpc; 1-UDP (corrisponde alla porta 20007 del robot)
4* @return Codice di errore
5*/
6public int ServoJTStart (int comType = 0)
4.32. Controllo di Coppia dei Giunti
1/**
2* @brief Controllo di coppia dei giunti
3* @param [in] torque Coppia giunti j1~j6, unità Nm
4* @param [in] interval Periodo del comando, unità s, intervallo [0.001~0.008]
5* @param [in] checkFlag Strategia di rilevamento 0-nessuna limitazione; 1-limitazione potenza; 2-limitazione velocità; 3-limitazione simultanea potenza e velocità
6* @param [in] jPowerLimit Limite massimo potenza giunto (W)
7* @param [in] jVelLimit Velocità massima giunto (°/s)
8* @param [in] comType Tipo di invio comando; 0-xmlrpc; 1-UDP (corrisponde alla porta 20007 del robot)
9* @return Codice di errore
10*/
11public int ServoJT(double[] torque, double interval, int checkFlag, double[] jPowerLimit, double[] jVelLimit, int comType = 0)
4.33. Fine Controllo di Coppia dei Giunti
1/**
2* @brief Termina il controllo di coppia dei giunti
3* @param[in] comType Tipo di invio comando; 0-xmlrpc; 1-UDP (corrisponde alla porta 20007 del robot)
4* @return Codice di errore
5*/
6public int ServoJTEnd (int comType = 0)
4.34. Esempio di Codice SDK per ServoJT, ServoJTStart, ServoJTEnd basato su Comunicazione UDP
1public int ServoJTWithSafetyUDP()
2{
3 // Iscriviti al callback
4 robot.OnUdpFrameReceived += (comType, frameCount, frameCmdID, contentLen, content) =>
5 {
6 Console.WriteLine($"[Risposta UDP] comType={comType}, count={frameCount}, cmdID={frameCmdID}, content={content}");
7 };
8 while (true)
9 {
10 robot.ResetAllError();
11 Thread.Sleep(500);
12
13 JointPos j = new JointPos(7.053, -89.699, 156.141, -72.751, 7.829, 1.889);
14 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
15 DescPose offset_pos = new DescPose(-151.288, -321.186, 221.989, 89.140, 4.361, -0.795);
16 robot.MoveJ(j, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
17
18 double[] torques = new double[6] { 0, 0, 0, 0, 0, 0 };
19 robot.GetJointTorques(1, torques);
20
21 robot.ServoJTStart(1);
22 ROBOT_STATE_PKG pkg = new ROBOT_STATE_PKG();
23 robot.DragTeachSwitch(1);
24
25 int checkFlag = 0;
26 double[] jPowerLimit = new double[6] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
27 double[] jVelLimit = new double[6] { 50, 50, 50, 50, 50, 50 };
28 int error = 0;
29 while (true)
30 {
31
32 torques[0] = 0.1;
33 error = robot.ServoJT(torques, 0.008, checkFlag, jPowerLimit, jVelLimit, 1);
34
35 Console.WriteLine($"ServoJT rtn is {error}");
36 Thread.Sleep(1);
37
38 robot.GetRobotRealTimeState(ref pkg);
39 Console.WriteLine($"maincode {pkg.main_code}, subcode {pkg.sub_code}");
40 if (pkg.jt_cur_pos[0] > 30)
41 {
42 break;
43 }
44 }
45
46 while (true)
47 {
48
49 torques[0] = -0.1;
50 error = robot.ServoJT(torques, 0.008, checkFlag, jPowerLimit, jVelLimit, 1);
51
52 Console.WriteLine($"ServoJT rtn is {error}");
53 Thread.Sleep(1);
54
55 robot.GetRobotRealTimeState(ref pkg);
56 Console.WriteLine($"maincode {pkg.main_code}, subcode {pkg.sub_code}");
57 if (pkg.jt_cur_pos[0] < 0)
58 {
59 break;
60 }
61 }
62
63 robot.DragTeachSwitch(0);
64 error = robot.ServoJTEnd(1);
65 }
66 return 0;
67}
4.35. Esempio di codice controllo coppia articolare
1private void button27_Click(object sender, EventArgs e)
2{
3 robot.DragTeachSwitch(1);
4 robot.SetPowerLimit(1, 200);
5 double[] torques = { 0, 0, 0, 0, 0, 0 };
6 robot.GetJointTorques(1, torques);
7
8 int count = 100;
9 robot.ServoJTStart();
10 int error = 0;
11 while (count > 0)
12 {
13 error = robot.ServoJT(torques, 0.001f);
14 count--;
15 Thread.Sleep(1);
16 }
17 error = robot.ServoJTEnd();
18 robot.DragTeachSwitch(0);
19}
4.36. Esempio di codice controllo coppia articolare con protezione sovra-velocità
1public int ServoJTWithSafety()
2{
3 robot.ResetAllError();
4 Thread.Sleep(500);
5
6 double[] torques = new double[6] { 0, 0, 0, 0, 0, 0 };
7 robot.GetJointTorques(1, torques);
8
9 robot.ServoJTStart();
10 ROBOT_STATE_PKG pkg = new ROBOT_STATE_PKG();
11 robot.DragTeachSwitch(1);
12
13 int checkFlag = 0;
14 double[] jPowerLimit = new double[6] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
15 //double[] jPowerLimit = new double[6] { 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 };
16 // double[] jVelLimit = new double[6] { 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 };
17 double[] jVelLimit = new double[6] {50, 50, 50, 50, 50, 50 };
18 int count = 80000;
19 int errorNum = 0;
20 int error = 0;
21 while (count > 0)
22 {
23
24 torques[2] = torques[2] + 0.01;
25 error = robot.ServoJT(torques, 0.008, checkFlag, jPowerLimit, jVelLimit);
26
27 Console.WriteLine($"ServoJT rtn is {error}");
28 count = count - 1;
29 Thread.Sleep(1);
30
31 robot.GetRobotRealTimeState(ref pkg);
32 Console.WriteLine($"maincode {pkg.main_code}, subcode {pkg.sub_code}");
33 if (error != 0)
34 {
35 errorNum++;
36 if (errorNum > 5)
37 {
38 break;
39 }
40
41 }
42 }
43 robot.DragTeachSwitch(0);
44 error = robot.ServoJTEnd();
45
46 return 0;
47}
4.37. Movimento modalità servomotore spazio cartesiano
1
4.38. Movimento in Modalità Servo Spazio Cartesiano
1/**
2* @brief Movimento in modalità servo spazio cartesiano
3* @param [in] mode 0-Movimento assoluto (sistema coordinate base), 1-Movimento incrementale (sistema coordinate base), 2-Movimento incrementale (sistema coordinate utensile)
4* @param [in] desc_pos Posa cartesiana target o incremento di posa
5* @param [in] exaxis Posizione asse esteso
6* @param [in] pos_gain Coefficiente proporzionalità incremento posa, effettivo solo nel movimento incrementale, intervallo [0~1]
7* @param [in] acc Percentuale accelerazione, intervallo [0~100], temporaneamente non disponibile, predefinito 0
8* @param [in] vel Percentuale velocità, intervallo [0~100], temporaneamente non disponibile, predefinito 0
9* @param [in] cmdT Periodo trasmissione comando, unità s, intervallo consigliato [0.001~0.016]
10* @param [in] filterT Tempo filtro, unità s, temporaneamente non disponibile, predefinito 0
11* @param [in] gain Amplificatore proporzionale posizione target, temporaneamente non disponibile, predefinito 0
12* @return Codice errore
13*/
14public int ServoCart(int mode, DescPose desc_pose, ExaxisPos exaxis, double[] pos_gain, double acc, double vel, double cmdT, double filterT, double gain);
4.39. Esempio di codice movimento modalità servomotore spazio cartesiano
1public void TestServoCart()
2{
3 ROBOT_STATE_PKG pkg = new ROBOT_STATE_PKG();
4
5 int rtn;
6 DescPose desc_pos_dt = new DescPose(83.00800f, 50.525000f, 29.246f, 179.629f, -7.138f, -166.975f);
7 ExaxisPos exaxis = new ExaxisPos(100.0f, 0.0f, 0.0f, 0.0f);
8 double[] pos_gain = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
9 int mode = 0;
10 float vel = 0.0f;
11 float acc = 0.0f;
12 float cmdT = 0.001f;
13 float filterT = 0.0f;
14 float gain = 0.0f;
15 byte flag = 0;
16 int count = 5000;
17
18 robot.SetSpeed(20);
19
20 while (count > 0)
21 {
22 rtn = robot.ServoCart(mode, desc_pos_dt, exaxis, pos_gain, acc, vel, cmdT, filterT, gain);
23 Console.WriteLine($"ServoCart rtn is {rtn}");
24 count -= 1;
25 desc_pos_dt.tran.x += 0.01f;
26 exaxis.ePos[0] += 0.01f;
27 }
28}
4.40. Inizio movimento spline
1/**
2* @brief Inizio movimento spline
3* @return Codice errore
4*/
5int SplineStart();
4.41. Movimento spline PTP
1/**
2* @brief Movimento spline spazio articolare
3* @param [in] joint_pos Posizione articolare target, unità deg
4* @param [in] desc_pos Posa cartesiana target
5* @param [in] tool Numero sistema coordinate utensile, range [0~14]
6* @param [in] user Numero sistema coordinate pezzo, range [0~14]
7* @param [in] vel Percentuale velocità, range [0~100]
8* @param [in] acc Percentuale accelerazione, range [0~100], attualmente non disponibile
9* @param [in] ovl Fattore di scala velocità, range [0~100]
10* @return Codice errore
11*/
12int SplinePTP(JointPos joint_pos, DescPose desc_pos, int tool, int user, float vel, float acc, float ovl);
4.42. Movimento spline spazio articolare (calcolo cinematico diretto automatico)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Movimento spline spazio articolare (calcolo cinematico diretto automatico)
3* @param [in] joint_pos Posizione articolare target, unità deg
4* @param [in] tool Numero sistema coordinate utensile, range [0~14]
5* @param [in] user Numero sistema coordinate pezzo, range [0~14]
6* @param [in] vel Percentuale velocità, range [0~100]
7* @param [in] acc Percentuale accelerazione, range [0~100], attualmente non disponibile
8* @param [in] ovl Fattore di scala velocità, range [0~100]
9* @return Codice errore
10*/
11int SplinePTP(JointPos joint_pos, int tool, int user, double vel, double acc, double ovl)
4.43. Fine movimento spline
1/**
2* @brief Fine movimento spline
3* @return Codice errore
4*/
5int SplineEnd();
4.44. Esempio di codice movimento spline
1private void btnSplineMove_Click(object sender, EventArgs e)
2{
3 JointPos j1 = new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256);
4 JointPos j2 = new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255);
5 JointPos j3 = new JointPos(-61.954, -84.409, 108.153, -116.316, -91.283, 74.260);
6 JointPos j4 = new JointPos(-89.575, -80.276, 102.713, -116.302, -91.284, 74.267);
7 DescPose desc_pos1 = new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833);
8 DescPose desc_pos2 = new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869);
9 DescPose desc_pos3 = new DescPose(-327.622, 402.230, 320.402, -178.067, 2.127, -46.207);
10 DescPose desc_pos4 = new DescPose(-104.066, 544.321, 327.023, -177.715, 3.371, -73.818);
11 DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
12 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
13
14 int tool = 0;
15 int user = 0;
16 float vel = 100.0f;
17 float acc = 100.0f;
18 float ovl = 100.0f;
19 float blendT = -1.0f;
20 byte flag = 0;
21
22 robot.SetSpeed(20);
23
24 int err = -1;
25 err = robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
26 Console.WriteLine($"movej errcode: {err}");
27
28 robot.SplineStart();
29 robot.SplinePTP(j1, desc_pos1, tool, user, vel, acc, ovl);
30 robot.SplinePTP(j2, desc_pos2, tool, user, vel, acc, ovl);
31 robot.SplinePTP(j3, desc_pos3, tool, user, vel, acc, ovl);
32 robot.SplinePTP(j4, desc_pos4, tool, user, vel, acc, ovl);
33 robot.SplineEnd();
34}
4.45. Inizio nuovo movimento spline
Cambiato nella versione C#SDK-v1.0.6.
1/**
2* @brief Inizio nuovo movimento spline
3* @param [in] type 0-transizione arco circolare, 1-punti dati come punti percorso
4* @param [in] averageTime Tempo medio transizione globale(ms)(10 ~ ), default 2000
5* @return Codice errore
6*/
7int NewSplineStart(int type, int averageTime=2000);
4.46. Punto istruzione nuovo spline
1/**
2* @brief Aggiunta punto istruzione movimento spline
3* @param [in] joint_pos Posizione articolare target, unità deg
4* @param [in] desc_pos Posa cartesiana target
5* @param [in] tool Numero sistema coordinate utensile, range [0~14]
6* @param [in] user Numero sistema coordinate pezzo, range [0~14]
7* @param [in] vel Percentuale velocità, range [0~100]
8* @param [in] acc Percentuale accelerazione, range [0~100], attualmente non disponibile
9* @param [in] ovl Fattore di scala velocità, range [0~100]
10* @param [in] blendR [-1.0]-movimento fino a posizione (bloccante), [0~1000.0]-raggio smoothing (non bloccante), unità mm
11* @param [in] lastFlag Se è l'ultimo punto, 0-no, 1-sì
12* @return Codice errore
13*/
14int NewSplinePoint(JointPos joint_pos, DescPose desc_pos, int tool, int user, float vel, float acc, float ovl, float blendR, int lastFlag);
4.47. Punto istruzione nuovo spline (calcolo cinematico inverso automatico)
Nuovo nella versione C#SDK-V1.1.7: Web-3.8.5
1/**
2* @brief Punto istruzione nuovo spline (calcolo cinematico inverso automatico)
3* @param [in] desc_pos Posa cartesiana target
4* @param [in] tool Numero sistema coordinate utensile, range [0~14]
5* @param [in] user Numero sistema coordinate pezzo, range [0~14]
6* @param [in] vel Percentuale velocità, range [0~100]
7* @param [in] acc Percentuale accelerazione, range [0~100], attualmente non disponibile
8* @param [in] ovl Fattore di scala velocità, range [0~100]
9* @param [in] blendR [-1.0]-movimento fino a posizione (bloccante), [0~1000.0]-raggio smoothing (non bloccante), unità mm
10* @param [in] lastFlag Se è l'ultimo punto, 0-no, 1-sì
11* @param [in] config Configurazione spazio articolare per soluzione cinematica inversa, [-1]-calcolo riferimento posizione articolare corrente, [0~7]-soluzione basata configurazione spazio articolare specifica
12* @return Codice errore
13*/
14int NewSplinePoint(DescPose desc_pos, int tool, int user, double vel, double acc, double ovl, double blendR, int lastFlag,int config)
4.48. Fine nuovo movimento spline
1/**
2* @brief Inizio nuovo movimento spline
3* @return Codice errore
4*/
5int NewSplineEnd();
4.49. Esempio di codice nuovo movimento spline
1private void btnNewSpline_Click(object sender, EventArgs e)
2{
3 JointPos j1 = new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256);
4 JointPos j2 = new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255);
5 JointPos j3 = new JointPos(-61.954, -84.409, 108.153, -116.316, -91.283, 74.260);
6 JointPos j4 = new JointPos(-89.575, -80.276, 102.713, -116.302, -91.284, 74.267);
7 JointPos j5 = new JointPos(-95.228, -54.621, 73.691, -112.245, -91.280, 74.268);
8 DescPose desc_pos1 = new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833);
9 DescPose desc_pos2 = new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869);
10 DescPose desc_pos3 = new DescPose(-327.622, 402.230, 320.402, -178.067, 2.127, -46.207);
11 DescPose desc_pos4 = new DescPose(-104.066, 544.321, 327.023, -177.715, 3.371, -73.818);
12 DescPose desc_pos5 = new DescPose(-33.421, 732.572, 275.103, -177.907, 2.709, -79.482);
13 DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
14 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
15
16 int tool = 0;
17 int user = 0;
18 float vel = 100.0f;
19 float acc = 100.0f;
20 float ovl = 100.0f;
21 float blendT = -1.0f;
22 byte flag = 0;
23
24 robot.SetSpeed(20);
25
26 int err = -1;
27 err = robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
28 Console.WriteLine($"movej errcode: {err}");
29
30 robot.NewSplineStart(1, 2000);
31 robot.NewSplinePoint(j1, desc_pos1, tool, user, vel, acc, ovl, -1, 0);
32 robot.NewSplinePoint(j2, desc_pos2, tool, user, vel, acc, ovl, -1, 0);
33 robot.NewSplinePoint(j3, desc_pos3, tool, user, vel, acc, ovl, -1, 0);
34 robot.NewSplinePoint(j4, desc_pos4, tool, user, vel, acc, ovl, -1, 0);
35 robot.NewSplinePoint(j5, desc_pos5, tool, user, vel, acc, ovl, -1, 0);
36 robot.NewSplineEnd();
37}
4.50. Terminazione movimento
1/**
2* @brief Terminazione movimento
3* @return Codice errore
4*/
5int StopMotion();
4.51. Pausa movimento
1/**
2 * @brief Pausa movimento
3 * @return Codice errore
4*/
5int PauseMotion();
4.52. Ripresa movimento
1/**
2* @brief Ripresa movimento
3* @return Codice errore
4*/
5int ResumeMotion();
4.53. Esempio di codice pausa, ripresa, arresto movimento
1private void btnMotionPause_Click(object sender, EventArgs e)
2{
3 int rtn;
4 JointPos j1 = new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256);
5 JointPos j5 = new JointPos(-95.228, -54.621, 73.691, -112.245, -91.280, 74.268);
6 DescPose desc_pos1 = new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833);
7 DescPose desc_pos5 = new DescPose(-33.421, 732.572, 275.103, -177.907, 2.709, -79.482);
8 DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
9 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
10
11 int tool = 0;
12 int user = 0;
13 float vel = 100.0f;
14 float acc = 100.0f;
15 float ovl = 100.0f;
16 float blendT = -1.0f;
17 byte flag = 0;
18
19 robot.SetSpeed(20);
20
21 rtn = robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
22 rtn = robot.MoveJ(j5, desc_pos5, tool, user, vel, acc, ovl, epos, 1, flag, offset_pos);
23 Thread.Sleep(1000);
24 robot.PauseMotion();
25
26 Thread.Sleep(1000);
27 robot.ResumeMotion();
28
29 Thread.Sleep(1000);
30 robot.StopMotion();
31
32 Thread.Sleep(1000);
33
34}
4.54. Inizio compensazione globale punti
1/**
2* @brief Inizio compensazione globale punti
3* @param [in] flag 0-compensazione in sistema base/pezzo, 2-compensazione in sistema utensile
4* @param [in] offset_pos Quantità compensazione posa
5* @return Codice errore
6*/
7int PointsOffsetEnable(int flag, DescPose offset_pos);
4.55. Fine compensazione globale punti
1/**
2* @brief Fine compensazione globale punti
3* @return Codice errore
4*/
5int PointsOffsetDisable();
4.56. Esempio di codice compensazione punti
1private void btnPointOffect_Click(object sender, EventArgs e)
2{
3 JointPos j1, j2;
4 DescPose desc_pos1, desc_pos2, offset_pos, offset_pos1;
5 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
6
7 j1 = new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256);
8 desc_pos1 = new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833);
9
10 j2 = new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255);
11
12 desc_pos2 = new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869);
13
14 offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
15 offset_pos1 = new DescPose(50.0, 50.0, 50.0, 5.0, 5.0, 5.0);
16
17 int tool = 0;
18 int user = 0;
19 float vel = 100.0f;
20 float acc = 100.0f;
21 float ovl = 100.0f;
22 float blendT = -1.0f;
23 byte flag = 0;
24 int type = 0;
25
26 robot.SetSpeed(20);
27
28 robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
29 robot.MoveJ(j2, desc_pos2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
30 Thread.Sleep(1000);
31 robot.PointsOffsetEnable(type, offset_pos1);
32 Thread.Sleep(1000);
33 robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
34 robot.MoveJ(j2, desc_pos2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
35 Thread.Sleep(1000);
36 robot.PointsOffsetDisable();
37}
4.57. Inizio volo-ripresa AO quadro comando
Nuovo nella versione C#SDK-v1.0.7.
1/**
2* @brief Inizio volo-ripresa AO quadro comando
3* @param [in] AONum Numero AO quadro comando
4* @param [in] maxTCPSpeed Valore massimo velocità TCP[1-5000mm/s], default 1000
5* @param [in] maxAOPercent Percentuale AO corrispondente massima velocità TCP, default 100%
6* @param [in] zeroZoneCmp Valore compensazione zona morta percentuale AO, intero, default 20%, range [0-100]
7* @return Codice errore
8*/
9int MoveAOStart(int AONum, int maxTCPSpeed, int maxAOPercent, int zeroZoneCmp);
4.58. Arresto volo-ripresa AO quadro comando
Nuovo nella versione C#SDK-v1.0.7.
1/**
2* @brief Arresto volo-ripresa AO quadro comando
3* @return Codice errore
4*/
5int MoveAOStop();
4.59. Inizio volo-ripresa AO estremità
Nuovo nella versione C#SDK-v1.0.7.
1/**
2* @brief Inizio volo-ripresa AO estremità
3* @param [in] AONum Numero AO estremità
4* @param [in] maxTCPSpeed Valore massimo velocità TCP[1-5000mm/s], default 1000
5* @param [in] maxAOPercent Percentuale AO corrispondente massima velocità TCP, default 100%
6* @param [in] zeroZoneCmp Valore compensazione zona morta percentuale AO, intero, default 20%, range [0-100]
7* @return Codice errore
8*/
9int MoveToolAOStart(int AONum, int maxTCPSpeed, int maxAOPercent, int zeroZoneCmp);
4.60. Arresto volo-ripresa AO estremità
Nuovo nella versione C#SDK-v1.0.7.
1/**
2* @brief Arresto volo-ripresa AO estremità
3* @return Codice errore
4*/
5int MoveToolAOStop();
4.61. Esempio di codice volo-ripresa AO
1private void btnMoveAO_Click(object sender, EventArgs e)
2{
3 JointPos j1 = new JointPos(-11.904, -99.669, 117.473, -108.616, -91.726, 74.256);
4 JointPos j2 = new JointPos(-45.615, -106.172, 124.296, -107.151, -91.282, 74.255);
5 DescPose desc_pos1 = new DescPose(-419.524, -13.000, 351.569, -178.118, 0.314, 3.833);
6 DescPose desc_pos2 = new DescPose(-321.222, 185.189, 335.520, -179.030, -1.284, -29.869);
7 DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
8 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
9
10 int tool = 0;
11 int user = 0;
12 float vel = 100.0f;
13 float acc = 100.0f;
14 float ovl = 100.0f;
15 float blendT = 0.0f;
16 float blendR = 0.0f;
17 byte flag = 0;
18 byte search = 0;
19
20 robot.SetSpeed(5);
21
22 robot.MoveAOStart(0,100,100,20);
23 robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
24 robot.MoveJ(j2, desc_pos2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
25 robot.MoveAOStop();
26
27 robot.MoveToolAOStart(0, 100, 100, 20);
28 robot.MoveJ(j1, desc_pos1, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
29 robot.MoveJ(j2, desc_pos2, tool, user, vel, acc, ovl, epos, blendT, flag, offset_pos);
30 robot.MoveToolAOStop();
31}
4.62. Inizio filtraggio FIR movimento Ptp
Nuovo nella versione C#SDK-V1.1.3: Web-3.8.2
1/**
2* @brief Inizio filtraggio FIR movimento Ptp
3* @param [in] maxAcc Valore estremo massima accelerazione(deg/s2)
4* @param [in] maxJek Valore estremo jerk articolare uniforme(deg/s3)
5* @return Codice errore
6*/
7int PtpFIRPlanningStart(double maxAcc, double maxJek=1000);
4.63. Disattivazione filtraggio FIR movimento Ptp
1/**
2* @brief Disattivazione filtraggio FIR movimento Ptp
3* @return Codice errore
4*/
5int PtpFIRPlanningEnd();
4.64. Inizio filtraggio FIR movimento LIN, ARC
1/**
2* @brief Inizio filtraggio FIR movimento LIN, ARC
3* @param [in] maxAccLin Valore estremo accelerazione lineare(mm/s2)
4* @param [in] maxAccDeg Valore estremo accelerazione angolare(deg/s2)
5* @param [in] maxJerkLin Valore estremo jerk lineare(mm/s3)
6* @param [in] maxJerkDeg Valore estremo jerk angolare(deg/s3)
7* @return Codice errore
8*/
9int LinArcFIRPlanningStart(double maxAccLin, double maxAccDeg, double maxJerkLin, double maxJerkDeg);
4.65. Disattivazione filtraggio FIR movimento LIN, ARC
1/**
2* @brief Disattivazione filtraggio FIR movimento LIN, ARC
3* @return Codice errore
4*/
5int LinArcFIRPlanningEnd();
4.66. Esempio di codice filtraggio FIR
Nuovo nella versione C#SDK-V1.1.3: Web-3.8.2
1private void button69_Click(object sender, EventArgs e)
2{
3 int rtn;
4 JointPos startjointPos = new JointPos(-11.904f, -99.669f, 117.473f, -108.616f, -91.726f, 74.256f);
5 JointPos midjointPos = new JointPos(-45.615f, -106.172f, 124.296f, -107.151f, -91.282f, 74.255f);
6 JointPos endjointPos = new JointPos(-29.777f, -84.536f, 109.275f, -114.075f, -86.655f, 74.257f);
7
8 DescPose startdescPose = new DescPose(-419.524f, -13.000f, 351.569f, -178.118f, 0.314f, 3.833f);
9 DescPose middescPose = new DescPose(-321.222f, 185.189f, 335.520f, -179.030f, -1.284f, -29.869f);
10 DescPose enddescPose = new DescPose(-487.434f, 154.362f, 308.576f, 176.600f, 0.268f, -14.061f);
11
12 ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
13 DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
14
15 rtn = robot.PtpFIRPlanningStart(1000,1000);
16 Console.WriteLine("PtpFIRPlanningStart rtn is " + rtn);
17 robot.MoveJ( startjointPos, startdescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
18 robot.MoveJ( endjointPos, enddescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
19 robot.PtpFIRPlanningEnd();
20 Console.WriteLine("PtpFIRPlanningEnd rtn is " + rtn);
21
22 robot.LinArcFIRPlanningStart(1000, 1000, 1000, 1000);
23 Console.WriteLine("LinArcFIRPlanningStart rtn is " + rtn);
24 robot.MoveL( startjointPos, startdescPose, 0, 0, 100, 100, 100, -1, exaxisPos, 0, 0, offdese, 1, 1);
25 robot.MoveC( midjointPos, middescPose, 0, 0, 100, 100, exaxisPos, 0, offdese, endjointPos, enddescPose, 0, 0, 100, 100, exaxisPos, 0, offdese, 100, -1);
26 robot.LinArcFIRPlanningEnd();
27 Console.WriteLine("LinArcFIRPlanningEnd rtn is " + rtn);
28}
4.67. Attivazione levigamento accelerazione
1/**
2* @brief Attivazione levigamento accelerazione
3* @param [in] saveFlag Salvataggio dopo spegnimento
4* @return Codice errore
5*/
6int AccSmoothStart(bool saveFlag);
4.68. Disattivazione levigamento accelerazione
1/**
2* @brief Disattivazione levigamento accelerazione
3* @param [in] saveFlag Salvataggio dopo spegnimento
4* @return Codice errore
5*/
6int AccSmoothEnd(bool saveFlag);
4.69. Esempio di codice
1private void button1_Click(object sender, EventArgs e)
2{
3
4 int rtn;
5 JointPos startjointPos = new JointPos(-11.904f, -99.669f, 117.473f, -108.616f, -91.726f, 74.256f);
6 JointPos endjointPos = new JointPos(-45.615f, -106.172f, 124.296f, -107.151f, -91.282f, 74.255f);
7
8 DescPose startdescPose = new DescPose(-419.524f, -13.000f, 351.569f, -178.118f, 0.314f, 3.833f);
9 DescPose enddescPose = new DescPose(-321.222f, 185.189f, 335.520f, -179.030f, -1.284f, -29.869f);
10
11 ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
12 DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
13 rtn = robot.AccSmoothStart(false);
14 Console.WriteLine("AccSmoothStart rtn is " + rtn);
15 robot.MoveJ( startjointPos, startdescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
16 robot.MoveJ( endjointPos, enddescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
17 rtn = robot.AccSmoothEnd(false);
18 Console.WriteLine("AccSmoothEnd rtn is " + rtn);
19}
4.70. Attivazione velocità orientamento specificata
1/**
2* @brief Attivazione velocità orientamento specificata
3* @param [in] ratio Percentuale velocità orientamento[0-300]
4* @return Codice errore
5*/
6int AngularSpeedStart(int ratio);
4.71. Disattivazione velocità orientamento specificata
1/**
2* @brief Disattivazione velocità orientamento specificata
3* @return Codice errore
4*/
5int AngularSpeedEnd();
4.72. Esempio di codice velocità orientamento specificata robot
1private void button71_Click(object sender, EventArgs e)
2{
3 int rtn;
4 JointPos startjointPos = new JointPos(-11.904f, -99.669f, 117.473f, -108.616f, -91.726f, 74.256f);
5 JointPos endjointPos = new JointPos(-45.615f, -106.172f, 124.296f, -107.151f, -91.282f, 74.255f);
6
7 DescPose startdescPose = new DescPose(-419.524f, -13.000f, 351.569f, -178.118f, 0.314f, 3.833f);
8 DescPose enddescPose = new DescPose(-321.222f, 185.189f, 335.520f, -179.030f, -1.284f, -29.869f);
9
10 ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
11 DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
12 rtn = robot.AngularSpeedStart(50);
13 Console.WriteLine("AngularSpeedStart rtn is " + rtn);
14 robot.MoveJ( startjointPos, startdescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
15 robot.MoveJ( endjointPos, enddescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
16 rtn = robot.AngularSpeedEnd();
17 Console.WriteLine("AngularSpeedEnd rtn is " + rtn);
18}
4.73. Inizio protezione postura singolare
Nuovo nella versione C#SDK-v1.0.9.
1/**
2* @brief Inizio protezione postura singolare
3* @param [in] protectMode Modalità protezione singolarità, 0: modalità articolare; 1-modalità cartesiana
4* @param [in] minShoulderPos Intervallo regolazione singolarità spalla(mm), default 100
5* @param [in] minElbowPos Intervallo regolazione singolarità gomito(mm), default 50
6* @param [in] minWristPos Intervallo regolazione singolarità polso(°), default 10
7* @return Codice errore
8*/
9int SingularAvoidStart(int protectMode, double minShoulderPos, double minElbowPos, double minWristPos);
4.74. Arresto protezione postura singolare
Nuovo nella versione C#SDK-v1.0.9.
1/**
2* @brief Arresto protezione postura singolare
3* @return Codice errore
4*/
5int SingularAvoidEnd();
4.75. Esempio di codice
Nuovo nella versione C#SDK-v1.0.9.
1private void btnTestSingularAvoidEArc_Click(object sender, EventArgs e)
2{
3 int rtn;
4 JointPos startjointPos = new JointPos(-11.904f, -99.669f, 117.473f, -108.616f, -91.726f, 74.256f);
5 JointPos endjointPos = new JointPos(-45.615f, -106.172f, 124.296f, -107.151f, -91.282f, 74.255f);
6
7 DescPose startdescPose = new DescPose(-419.524f, -13.000f, 351.569f, -178.118f, 0.314f, 3.833f);
8 DescPose enddescPose = new DescPose(-321.222f, 185.189f, 335.520f, -179.030f, -1.284f, -29.869f);
9
10 ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
11 DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
12
13 rtn = robot.SingularAvoidStart(2, 10, 5, 5);
14 Console.WriteLine("SingularAvoidStart rtn is " + rtn);
15 robot.MoveJ( startjointPos, startdescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
16 robot.MoveJ( endjointPos, enddescPose, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
17 rtn = robot.SingularAvoidEnd();
18 Console.WriteLine("SingularAvoidEnd rtn is " + rtn);
19}
4.76. Trigger arresto sicurezza
1/**
2* @brief Segnale trigger arresto sicurezza
3* @return Codice errore
4*/
5int GetSafetyCode();
4.77. Svuotamento coda istruzioni movimento
Nuovo nella versione C#SDK-V1.1.9: Web-3.8.7
1/**
2* @brief Svuotamento coda istruzioni movimento
3* @return Codice errore
4*/
5public int MotionQueueClear();
4.78. Movimento a punto di partenza linea intersecante
1/**
2* @brief Movimento a punto di partenza linea intersecante
3* @param [in] mainPoint Pose cartesiane 6 punti insegnamento tubo principale
4* @param [in] mainExaxisPos Posizioni asse esteso 6 punti insegnamento tubo principale
5* @param [in] piecePoint Pose cartesiane 6 punti insegnamento tubo ausiliario
6* @param [in] pieceExaxisPos Posizioni asse esteso 6 punti insegnamento tubo di giunzione
7* @param [in] extAxisFlag Abilitazione asse esteso; 0-disabilitato; 1-abilitato
8* @param [in] exaxisPos Posizione asse esteso punto di partenza
9* @param [in] tool Numero sistema coordinate utensile
10* @param [in] wobj Numero sistema coordinate pezzo
11* @param [in] vel Percentuale velocità
12* @param [in] acc Percentuale accelerazione
13* @param [in] ovl Fattore di scala velocità
14* @param [in] oacc Fattore di scala accelerazione
15* @param [in] moveType Tipo movimento; 0-PTP;1-LIN
16* @param [in] moveDirection Direzione movimento; 0-orario; 1-antiorario
17* @param [in] offset Quantità offset
18* @return Codice errore
19*/
20public int MoveToIntersectLineStart(DescPose[] mainPoint, ExaxisPos[] mainExaxisPos, DescPose[] piecePoint, ExaxisPos[] pieceExaxisPos, int extAxisFlag, ExaxisPos exaxisPos, int tool, int wobj, double vel, double acc, double ovl, double oacc, int moveType, int moveDirection, DescPose offset);
4.79. Movimento linea intersecante
1/**
2* @brief Movimento linea intersecante
3* @param [in] mainPoint Pose cartesiane 6 punti insegnamento tubo principale
4* @param [in] mainExaxisPos Posizioni asse esteso 6 punti insegnamento tubo principale
5* @param [in] piecePoint Pose cartesiane 6 punti insegnamento tubo ausiliario
6* @param [in] pieceExaxisPos Posizioni asse esteso 6 punti insegnamento tubo di giunzione
7* @param [in] extAxisFlag Abilitazione asse esteso;0-disabilitato;1-abilitato
8* @param [in] exaxisPos Posizione asse esteso punto di partenza
9* @param [in] tool Numero sistema coordinate utensile
10* @param [in] wobj Numero sistema coordinate pezzo
11* @param [in] vel Percentuale velocità
12* @param [in] acc Percentuale accelerazione
13* @param [in] ovl Fattore di scala velocità
14* @param [in] oacc Fattore di scala accelerazione
15* @param [in] moveDirection Direzione movimento; 0-orario;1-antiorario
16* @param [in] offset Quantità offset
17* @return Codice errore
18*/
19public int MoveIntersectLine(DescPose[] mainPoint, ExaxisPos[] mainExaxisPos, DescPose[] piecePoint, ExaxisPos[] pieceExaxisPos, int extAxisFlag, ExaxisPos[] exaxisPos, int tool, int wobj, double vel, double acc, double ovl, double oacc, int moveDirection, DescPose offset);
4.80. Esempio di codice movimento linea intersecante robot
1void TestIntersectLineMove()
2{
3 ROBOT_STATE_PKG pkg = {};
4 FRRobot robot;
5 robot.LoggerInit();
6 robot.SetLoggerLevel(3);
7 int rtn = robot.RPC("192.168.58.2");
8 if (rtn != 0)
9 {
10 return ;
11 }
12 robot.SetReConnectParam(true, 30000, 500);
13 DescPose mainPoint[6] = {};
14 DescPose piecePoint[6] = {};
15 ExaxisPos mainExaxisPos[6] = {};
16 ExaxisPos pieceExaxisPos[6] = {};
17 int extAxisFlag = 1;
18 ExaxisPos exaxisPos[4] = {};
19 DescPose offset = { 0.0, 2.0 ,30.0, -2.0, 0.0, 0.0 };
20 mainPoint[0] = {490.004, -383.194, 402.735, -9.332, -1.528, 69.594};
21 mainPoint[1] = {444.950, -407.117, 389.011, -5.546, -2.196, 65.279};
22 mainPoint[2] = {445.168, -463.605, 355.759, -1.544, -10.886, 57.104};
23 mainPoint[3] = {507.529, -485.385, 343.013, -0.786, -4.834, 61.799};
24 mainPoint[4] = {554.390, -442.647, 367.701, -4.761, -10.181, 64.925};
25 mainPoint[5] = {532.552, -394.003, 396.467, -13.732, -13.592, 67.411};
26 mainExaxisPos[0] = { -29.996, 0.000, 0.000, 0.000 };
27 mainExaxisPos[1] = { -29.996, 0.000, 0.000, 0.000 };
28 mainExaxisPos[2] = { -29.996, 0.000, 0.000, 0.000 };
29 mainExaxisPos[3] = { -29.996, 0.000, 0.000, 0.000 };
30 mainExaxisPos[4] = { -29.996, 0.000, 0.000, 0.000 };
31 mainExaxisPos[5] = { -29.996, 0.000, 0.000, 0.000 };
32 piecePoint[0] = { 505.571, -192.408, 316.759, 38.098, 37.051, 139.447 };
33 piecePoint[1] = {533.837, -201.558, 332.340, 34.644, 42.339, 137.748};
34 piecePoint[2] = {530.386, -225.085, 373.808, 35.431, 45.111, 137.560};
35 piecePoint[3] = {485.646, -229.195, 383.778, 33.870, 45.173, 137.064};
36 piecePoint[4] = {460.551, -212.161, 354.256, 28.856, 45.602, 135.930};
37 piecePoint[5] = {474.217, -197.124, 324.611, 42.469, 41.133, 148.167};
38 pieceExaxisPos[0] = { -29.996, -0.000, 0.000, 0.000 };
39 pieceExaxisPos[1] = { -29.996, -0.000, 0.000, 0.000 };
40 pieceExaxisPos[2] = { -29.996, -0.000, 0.000, 0.000 };
41 pieceExaxisPos[3] = { -29.996, -0.000, 0.000, 0.000 };
42 pieceExaxisPos[4] = { -29.996, -0.000, 0.000, 0.000 };
43 pieceExaxisPos[5] = { -29.996, -0.000, 0.000, 0.000 };
44 exaxisPos[0] = {-29.996, -0.000, 0.000, 0.000};
45 exaxisPos[1] = {-44.994, 90.000, 0.000, 0.000};
46 exaxisPos[2] = {-59.992, 0.002, 0.000, 0.000};
47 exaxisPos[3] = {-44.994, -89.997, 0.000, 0.000};
48 int tool = 2;
49 int wobj = 0;
50 double vel = 100.0;
51 double acc = 100.0;
52 double ovl = 12.0;
53 double oacc = 12.0;
54 int moveType = 1;
55 int moveDirection = 1;
56 rtn = robot.MoveToIntersectLineStart(mainPoint, mainExaxisPos, piecePoint, pieceExaxisPos, extAxisFlag, exaxisPos[0], tool, wobj, vel, acc, ovl, oacc, moveType, moveDirection, offset);
57 printf("MoveToIntersectLineStart rtn is %d\n", rtn);
58 rtn = robot.MoveIntersectLine(mainPoint, mainExaxisPos, piecePoint, pieceExaxisPos, extAxisFlag, exaxisPos, tool, wobj, vel, acc, 5.0, 5.0, moveDirection, offset);
59 printf("MoveIntersectLine rtn is %d\n", rtn);
60 robot.CloseRPC();
61 return ;
62}
4.81. Movimento Aereo Stazionario
1/**
2* @brief Movimento Aereo Stazionario
3* @return Codice di errore
4*/
5public int MoveStationary()
4.82. Esempio Codice Movimento Aereo Stazionario
1public void LaserSensorRecordandReplay()
2{
3 int rtn = robot.LaserSensorRecordandReplay(0, 10, 1, 0, 0.1, 1, 1, 10, 100);
4 Console.WriteLine($"LaserSensorRecordandReplay rtn is {rtn}");
5 rtn = robot.MoveStationary();
6 Console.WriteLine($"MoveStationary rtn is {rtn}");
7 rtn = robot.LaserSensorRecord1(0, 10);
8 Console.WriteLine($"LaserSensorRecord1 rtn is {rtn}");
9}
4.83. Avvio Oscillazione a Punto Fisso
1/**
2* @brief Avvia l'oscillazione a punto fisso
3* @param [in] weaveNum Numero di oscillazione [0-7]
4* @param [in] mode 0-Sistema di coordinate utensile; 1-Punto di riferimento
5* @param [in] refPoint Coordinate cartesiane del punto di riferimento [x,y,z,a,b,c]
6* @param [in] weaveTime Tempo di oscillazione [s]
7* @return Codice di errore
8*/
9public int OriginPointWeaveStart(int weaveNum, int mode, DescPose refPoint, double weaveTime);
4.84. Fine Oscillazione a Punto Fisso
1/**
2* @brief Termina l'oscillazione a punto fisso
3* @return Codice di errore
4*/
5public int OriginPointWeaveEnd();
4.85. Esempio di Codice SDK per Oscillazione a Punto Fisso
1void TestOriginPointWeave()
2{
3 // Crea oggetto posizione giunto
4 JointPos j = new JointPos(39.886, -98.580, -124.032, -47.393, 90.000, 40.842);
5 ExaxisPos epos = new ExaxisPos(0, 0, 0, 0);
6 DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
7
8 // Coordinate punto di riferimento
9 DescPose refPoint = new DescPose(400.021, 300.022, 299.996, 179.997, -0.003, -90.956);
10
11 //// Primo movimento
12 robot.MoveJ(j, 1, 0, 100, 100, 100, epos, -1, 0, offset_pos);
13
14 // Avvia oscillazione a punto fisso (modalità 0)
15 robot.OriginPointWeaveStart(0, 0, refPoint, 3);
16 robot.MoveStationary(); // Esegui movimento stazionario (supponendo che questo metodo esista)
17 robot.OriginPointWeaveEnd();
18
19 Thread.Sleep(2000); // Attendi 2 secondi
20
21 // Secondo movimento
22 robot.MoveJ(j, 1, 0, 100, 100, 100, epos, -1, 0, offset_pos);
23
24 // Avvia oscillazione a punto fisso (modalità 1)
25 robot.OriginPointWeaveStart(0, 1, refPoint, 3);
26 robot.MoveStationary();
27 robot.OriginPointWeaveEnd();
28}
4.86. Esempio di Codice SDK per Oscillazione a Punto Fisso (con Laser e Asse di Estensione)
1void TestOriginPointWeave2()
2{
3 // Crea oggetto posizione giunto
4 JointPos j = new JointPos(39.886, -98.580, -124.032, -47.393, 90.000, 40.842);
5 ExaxisPos epos1 = new ExaxisPos(0, 0, 0, 0);
6 DescPose offset_pos = new DescPose(0, 0, 0, 0, 0, 0);
7 ExaxisPos epos2 = new ExaxisPos(5, 0.000, 0.000, 0.000);
8
9 // Coordinate punto di riferimento
10 DescPose refPoint = new DescPose(400.021, 300.022, 299.996, 179.997, -0.003, -90.956);
11
12 int rtn = 0;
13 robot.LaserTrackingSensorConfig("192.168.58.20", 5020);
14 robot.LaserTrackingSensorSamplePeriod(20);
15 robot.LoadPosSensorDriver(101);
16
17 // Carica driver UDP
18 robot.ExtDevLoadUDPDriver();
19
20 // Imposta tempo di completamento del posizionamento per assi di estensione
21 rtn = robot.SetExAxisCmdDoneTime(5000.0);
22 Console.WriteLine("SetExAxisCmdDoneTime rtn is " + rtn);
23
24 // Abilita assi di estensione 1 e 2
25 rtn = robot.ExtAxisServoOn(1, 1);
26 Console.WriteLine("ExtAxisServoOn axis id 1 rtn is " + rtn);
27 rtn = robot.ExtAxisServoOn(2, 1);
28 Console.WriteLine("ExtAxisServoOn axis id 2 rtn is " + rtn);
29 Thread.Sleep(2000);
30
31 // Imposta homing per asse di estensione
32 robot.ExtAxisSetHoming(1, 0, 10, 2);
33 robot.LaserTrackingLaserOnOff(1);
34
35
36 //// 1---Senza asse di estensione
37 robot.LaserTrackingTrackOnOff(1, 4);
38 robot.Sleep(200);
39 // Avvia oscillazione a punto fisso
40 robot.OriginPointWeaveStart(0, 0, refPoint, 10);
41 robot.MoveStationary(); // Esegui movimento stazionario
42 robot.OriginPointWeaveEnd();
43 robot.LaserTrackingTrackOnOff(0, 4);
44
45 Thread.Sleep(2000); // Attendi 2 secondi
46
47 //// 2---Con asse di estensione
48 robot.ExtAxisMove(epos1, 100, -1);
49 robot.LaserTrackingTrackOnOff(1, 4);
50 // Avvia oscillazione a punto fisso
51 robot.OriginPointWeaveStart(0, 0, refPoint, 20);
52 robot.ExtAxisMove(epos2, 100, -1);
53 robot.OriginPointWeaveEnd();
54 robot.LaserTrackingTrackOnOff(0, 4);
55}
4.87. Movimento in Modalità Servo a Velocità nello Spazio dei Giunti
1/**
2* @brief Movimento in modalità servo a velocità nello spazio dei giunti
3* @param [in] joint_pos 6 velocità dei giunti target, unità deg/s
4* @param [in] axisPos 4 velocità degli assi esterni, unità deg/s
5* @param [in] acc Percentuale di accelerazione, intervallo [0~100], temporaneamente non aperta, default 0
6* @param [in] vel Percentuale di velocità, intervallo [0~100], temporaneamente non aperta, default 0
7* @param [in] cmdT Periodo di invio comando, unità s, intervallo consigliato [0.001~0.0016]
8* @param [in] filterT Tempo di filtro, unità s, temporaneamente non aperto, default 0
9* @param [in] gain Amplificatore proporzionale per la posizione target, temporaneamente non aperto, default 0
10* @param [in] id ID comando ServoJ, default 0
11* @param[in] comType Tipo di invio comando; 0-xmlrpc; 1-UDP (corrisponde alla porta 20007 del robot)
12* @return Codice di errore
13*/
14public int ServoJV(double[] joint_vel, double[] exis_vel, float acc, float vel, float cmdT, float filterT, float gain, int id = 0, int comType = 0)
4.88. Esempio di Codice per Movimento in Modalità Servo a Velocità nello Spazio dei Giunti
1public int ServoJVtest()
2{
3 double[] joint_vel = new double[6] { 10, 0, 0, 0, 0, 0 };
4 double[] exis_vel = new double[4] { 0, 0, 0, 0 };
5 float acc = 0.0f;
6 float vel = 0.0f;
7 float cmdT = 0.01f;
8 float filterT = 0.0f;
9 float gain = 0.0f;
10 int cnt = 0;
11 while (cnt < 200)
12 {
13 int error = robot.ServoJV(joint_vel, exis_vel, acc, vel, cmdT, filterT, gain);
14 Console.WriteLine($"ServoJV rtn is {error}");
15 cnt++;
16 }
17 return 0;
18}
4.89. Avvio Controllo MIT dei Giunti
1/**
2* @brief Avvio del controllo MIT dei giunti
3* @param [in] comType Tipo di invio comando; 0-xmlrpc; 1-UDP (corrisponde alla porta 20007 del robot)
4* @return Codice di errore
5*/
6public int ServoMITStart(int comType = 0)
4.90. Fine Controllo MIT dei Giunti
1/**
2* @brief Fine del controllo MIT dei giunti
3* @param [in] comType Tipo di invio comando; 0-xmlrpc; 1-UDP (corrisponde alla porta 20007 del robot)
4* @return Codice di errore
5*/
6public int ServoMITEnd(int comType = 0)
4.91. Controllo MIT dei Giunti
1/**
2* @brief Controllo MIT dei giunti
3* @param [in] posGain Guadagno posizione giunti j1~j6
4* @param [in] desPos Posizione desiderata giunti j1~j6, unità: deg
5* @param [in] velGain Guadagno velocità giunti j1~j6
6* @param [in] desVel Velocità desiderata giunti j1~j6, unità: deg/s
7* @param [in] torque_ff Coppia di feedforward j1~j6, unità: Nm
8* @param [in] interval Periodo del comando, unità s, intervallo [0.001~0.008]
9* @param [in] comType Tipo di invio comando; 0-xmlrpc; 1-UDP (corrisponde alla porta 20007 del robot)
10* @return Codice di errore
11*/
12public int ServoMIT(double[] posGain, double[] desPos, double[] velGain, double[] desVel, double[] torque_ff, double interval, int comType = 0)
4.92. Esempio di Codice per Movimento con Controllo MIT dei Giunti
1public int ServoMITtest()
2{
3 // Iscriviti al callback
4 robot.OnUdpFrameReceived += (comType, frameCount, frameCmdID, contentLen, content) =>
5 {
6 Console.WriteLine($"[Risposta UDP] comType={comType}, count={frameCount}, cmdID={frameCmdID}, content={content}");
7 };
8 while (true)
9 {
10 robot.ResetAllError();
11 Thread.Sleep(500);
12
13 double[] posGain = new double[6] { 0, 0, 0, 0, 0, 0 };
14 double[] desPos = new double[6] { 0, 0, 0, 0, 0, 0 };
15 double[] velGain = new double[6] { 0, 0, 0, 0, 0, 0 };
16 double[] desVel = new double[6] { 0, 0, 0, 0, 0, 0 };
17 double[] torques = new double[6] { 0, 0, 0, 0, 0, 0 };
18 robot.GetJointTorques(1, torques);
19 Console.WriteLine($"111111");
20 //robot.ServoMITEnd(0);
21 robot.ServoMITStart(0);
22 Console.WriteLine($"ServoMITStart");
23 ROBOT_STATE_PKG pkg = new ROBOT_STATE_PKG();
24 robot.DragTeachSwitch(1);
25 Console.WriteLine($"DragTeachSwitch");
26 double intev = 0.008;
27 double[] jPowerLimit = new double[6] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
28 double[] jVelLimit = new double[6] { 50, 50, 50, 50, 50, 50 };
29 int error = 0;
30 while (true)
31 {
32
33 torques[5] = 0.03;
34 Console.WriteLine($"ServoMIT call ");
35 error = robot.ServoMIT(posGain, desPos, velGain, desVel, torques, intev, 0);
36
37 Console.WriteLine($"ServoMIT111111 rtn is {error}");
38 Thread.Sleep(1);
39
40 robot.GetRobotRealTimeState(ref pkg);
41 //Console.WriteLine($"maincode {pkg.main_code}, subcode {pkg.sub_code}");
42 Console.WriteLine($"pkg.jt_cur_pos[5]:{pkg.jt_cur_pos[5]}");
43 if (pkg.jt_cur_pos[5] > 30)
44 {
45 break;
46 }
47 }
48
49 while (true)
50 {
51
52 torques[5] = -0.03;
53 error = robot.ServoMIT(posGain, desPos, velGain, desVel, torques, intev, 0);
54
55 Console.WriteLine($"ServoJT222222 rtn is {error}");
56 Thread.Sleep(1);
57
58 robot.GetRobotRealTimeState(ref pkg);
59 //Console.WriteLine($"maincode {pkg.main_code}, subcode {pkg.sub_code}");
60 Console.WriteLine($"pkg.jt_cur_pos[5]:{pkg.jt_cur_pos[5]}");
61 if (pkg.jt_cur_pos[5] < 0)
62 {
63 break;
64 }
65 }
66
67 robot.DragTeachSwitch(0);
68 error = robot.ServoMITEnd(0);
69 }
70 return 0;
71}