-
Notifications
You must be signed in to change notification settings - Fork 0
/
documentation bas niveau.txt
204 lines (138 loc) · 14.9 KB
/
documentation bas niveau.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
***************************************************************************
***************************************************************************
** Liste des commandes et spécification du protocole de la liaison série **
***************************************************************************
***************************************************************************
Remarque : la droite et la gauche sont à considérer du point de vue du robot, c'est à dire en regardant dans la méme direction que l'avant du robot.
**************************************
Etat du robot au démarrage de la carte
**************************************
x = 0 (mm)
y = 0 (mm)
orientation = 0 (radians)
Asservissement en translation et en rotation ACTIVE
Position d'asservissement : (0;0;0)
PWM max en translation = 100
PWM max en rotation = 100
Les constantes d'asservissement sont celles les plus adaptées aux PWM max (cf liste des constantes d'asservissement)
Les AX12 des actionneurs sont tous asservis à la position qu'ils avaient à leur allumage.
*************************************
Liste des constantes d'asservissement
*************************************
Translation
[à compléter]
Rotation
[à compléter]
**********************************
Spécifications de la liaison série
**********************************
Baudrate : 115 200 bauds
Parité : aucune
Bits d'arrét : 1 bit
Bits de données : 8 bits
Taille du buffer de réception : 64 octets
*************************
Protocole de communication
*************************
Il s'agit d'une architecture client-serveur avec accusé de réception.
Le haut niveau (raspberry Pi ou PC) est le client, le bas niveau (stm32f4) est le serveur.
1. Commande envoyée par le haut niveau
La commande est une chaine de caractéres de taille inférieur à 64 caractéres (ceci inclu le caractére de fin de chaine) terminée par un retour à la ligne.
2. Le bas niveau accuse la réception de la commande
L'accusé de réception est le caractére '_' suivi d'un retour à la ligne.
3.
a. Si la commande est une demande d'informations
Le bas niveau envoie l'information demandée dans un format dépendant de la commande et spécifié dans la liste des commandes ci-dessous.
b. Si la commande correspond à un ordre nécessitant l'indication d'une valeur numérique
Le bas niveau attend la réception d'une ligne supplémentaire, correspondant à un chiffre dont le format dépend de la commande.
Une fois cette seconde ligne reçue, le bas niveau accuse la réception avec un '_'.
c. Sinon
Le bas niveau ne répond rien de plus.
*************************
** Liste des commandes **
*************************
********************************************
Obtenir des informations sur l'état du robot
********************************************
requéte traduction de la réponse typage
?xyo [ligne1] composante x de la position en mm float
[ligne2] composante y de la position en mm float
[ligne3] orientation du robot en radians float
f [ligne1] le robot est-il en train de se déplacer ? boolean
[ligne2] l'état précédement indiqué est-il anormal ? boolean
j le jumper est-il SORTI ? boolean
us_av [ligne1] distance mesurée par le capteur avant gauche (mm) integer
[ligne2] distance mesurée par le capteur avant droit (mm) integer
us_ar [ligne1] distance mesurée par le capteur arriére gauche(mm) integer
[ligne2] distance mesurée par le capteur arriére droit (mm) integer
***********************
Commandes de locomotion
***********************
d Ordonne une translation.
La ligne suivante doit étre un ENTIER correspondant à la distance de déplacement voulue en mm.
t Ordonne une rotation absolue.
La ligne suivante doit étre un FLOTANT correspondant à l'orientation ABSOLUE voulue pour le robot, en radians.
tor Turn Only Right Rotation absolue. Permet de ne tourner qu'à droite, pour ne pas perdre le sable.
tol Turn Only Left Rotation absolue. Permet de ne tourner qu'à gauche, pour ne pas perdre le sable.
t3 Ordonne une rotation relative.
La ligne suivante doit étre un FLOTANT correspondant à l'angle de rotation voulu, en radians.
stop Ordonne un asservissement sur place.
ct0 Désactive l'asservissement en translation. Effet : pwmTranslation = 0 quelle que soit la consigne en translation.
ct1 Active l'asservissement en translation.
cr0 Désactive l'asservissement en rotation. Effet : pwmRotation = 0 quelle que soit la consigne en rotation.
cr1 Active l'asservissement en rotation.
cv0 Désactive l'asserv en vitesse
cv1 Active l'asserv en vitesse
Commandes de réglage de la position
Ces commandes n'ont aucun effet sur l'asservissement en position/vitesse.
Leur seul effet est de modifier les valeurs retournées par '?xyo' (et de les faire coïncider si possible avec les valeurs réelles !)
La ligne suivante devra étre un flotant correspondant à la valeur désirée.
cx Réglage de x (mm)
cy Réglage de y (mm)
co Réglage de l'angle (radians)
Commande de réglage de la vitesse en translation/rotation
ctv changer la vitesse de translation mm/s
crv changer la vitesse de rotation rad/s
*********************************************
Protocole d'arrét du robot durant un mouvement
*********************************************
Durant l'exécution d'une commande du type 'd' 't' 't3' si le robot doit étre arrété au plus vite, il est nécessaire d'exécuter l'opération suivante :
1. Désactiver l'asservissement (a pour effet concret de forcer tous les PWM à 0)
ct0
cr0
2. Attendre l'arrét effectif du robot
attendre que la commande f réponde que le mouvement est terminé (elle indiquera également un blocage mécanique si la position visée n'est pas atteinte)
3. Réasservir le robot sur sa position d'arrét
stop (la position courante devient la position d'asservissement)
ct1
cr1 (réactivation de l'asservissement pour pouvoir repartir ensuite si besoin)
*************************
Commandes des actionneurs
*************************
TODO : ajout des AX12 (et autres actionneurs eventuels)
Propositions pour le pelleteusatron(ug):
code signification_initiales description (défaut = position initiale)
bpr bras pelleteuse relevée bras en position haute (pelle quasiment plaquée contre le robot) (défaut)
bpd bras pelleteuse deployée bras en position basse (pelle touche quasiment le sol)
bpm bras pelleteuse moitié bras en position intermédiaire(no shit) pour permettre la rotation safe de la pelle
pd pelle début position de la pelle avant prise de balles (requis avant un bpd ou pendant un bpi) (défaut)
pm pelle moitié position de la pelle qui maintient les boules prises.
pt pelle tient position de la boule qui permet de déplacer les boules relevées
pf pelle final position de la pelle qui livre les boules.
amdd attrappe module début droit(défaut)
amfd attrappe module fin droit
amdg attrappe module début gauche(défaut)
amfg attrappe module fin gauche
cmdd cale module début droit(haut, défaut)
cmfd cale module fin droit(bas, pousse le module)
cmdg gauche
cmfg gauche
lmd largue module début (défaut)
lmf largue module fin(pousse)
**************************************************
Protocole d'initialisation des actionneurs du robot
**************************************************
Avant le début du match :
TODO : choisir où initialiser quoi, comment.
Que celui qui a remarqué cette ligne vienne me faire signe svp. Rémi.
signe