summaryrefslogtreecommitdiff
path: root/src/emc/kinematics/genhexkins.h
blob: dce1a59e04b624b9a60693878750830074b161c1 (plain)
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
/********************************************************************
* Description: genhexkins.h
*   Kinematics for a generalised hexapod machine
*
*   Derived from a work by R. Brian Register
*
* Author: 
* License: GPL Version 2
* System: Linux
*    
* Copyright (c) 2004 All rights reserved.
*
* Last change:
*******************************************************************

  This is the header file to accompany genhexkins.c.  This header file is used
  to configure genhexkins.c to solve the kinematics for a particular Stewart
  Platform configuration.

  Defined are the parameters necessary to configure the functions to solve
  several different Stewart Platform configurations.  To choose a particular
  configuration #define the configuration you are interested in and
  comment out any others.

  */

#include "posemath.h"		/* PmCartesian */

/* genhexSetParams lets you set the Cartesian coords of the base and platform,
   overriding the defaults set in the subsequent #defines */
extern int genhexSetParams(const PmCartesian base[], const PmCartesian platform[]);
extern int genhexGetParams(PmCartesian base[], PmCartesian platform[]);
extern int genhexKinematicsForwardIterations(void);

#define MINI_TETRA

#define NUM_STRUTS 6

#ifdef INGERSOLL_HEXAPOD

/* Define position of base strut ends in base (world) coordinates for */
/* Ingersoll Hexapod */
#define BASE_0_X  1.7580
#define BASE_1_X  1.6021
#define BASE_2_X -1.7580
#define BASE_3_X -1.6021
#define BASE_4_X  0.0
#define BASE_5_X  0.0

#define BASE_0_Y  2.8
#define BASE_1_Y  3.07
#define BASE_2_Y  2.8
#define BASE_3_Y  3.07
#define BASE_4_Y  2.8
#define BASE_5_Y  3.07

#define BASE_0_Z -1.015
#define BASE_1_Z -0.925
#define BASE_2_Z -1.015
#define BASE_3_Z -0.925
#define BASE_4_Z  2.03
#define BASE_5_Z  1.85

/* Define position of platform strut end in platform coordinate system */
/* for Ingersoll Hexapod  */
#define PLATFORM_0_X  0.225
#define PLATFORM_1_X  0.1125
#define PLATFORM_2_X -0.1125
#define PLATFORM_3_X -0.225
#define PLATFORM_4_X -0.1125
#define PLATFORM_5_X  0.1125

#define PLATFORM_0_Y  0.0
#define PLATFORM_1_Y  0.1949
#define PLATFORM_2_Y  0.1949
#define PLATFORM_3_Y  0.0
#define PLATFORM_4_Y -0.1949
#define PLATFORM_5_Y -0.1949

#define PLATFORM_0_Z -0.228
#define PLATFORM_1_Z -0.228
#define PLATFORM_2_Z -0.228
#define PLATFORM_3_Z -0.228
#define PLATFORM_4_Z -0.228
#define PLATFORM_5_Z -0.228

#endif

#ifdef UF_HEXAPOD

/* Define position of base strut ends in base (world) coordinates for */
/* UF Hexapod */
#define BASE_0_X -16.00
#define BASE_1_X -10.00
#define BASE_2_X  16.00
#define BASE_3_X  13.00
#define BASE_4_X   0.00
#define BASE_5_X  -3.00

#define BASE_0_Y  -9.24
#define BASE_1_Y  -9.24
#define BASE_2_Y  -9.24
#define BASE_3_Y  -4.04
#define BASE_4_Y  18.48
#define BASE_5_Y  13.28

#define BASE_0_Z  18.00
#define BASE_1_Z  18.00
#define BASE_2_Z  18.00
#define BASE_3_Z  18.00
#define BASE_4_Z  18.00
#define BASE_5_Z  18.00

/* Define position of platform strut end in platform coordinate system */
/* for UF Hexapod  */
#define PLATFORM_0_X  -9.00
#define PLATFORM_1_X   0.00
#define PLATFORM_2_X   3.00
#define PLATFORM_3_X  12.00
#define PLATFORM_4_X   6.00
#define PLATFORM_5_X -12.00

#define PLATFORM_0_Y   1.73
#define PLATFORM_1_Y -13.86
#define PLATFORM_2_Y  -8.66
#define PLATFORM_3_Y   6.93
#define PLATFORM_4_Y   6.93
#define PLATFORM_5_Y   6.93

#define PLATFORM_0_Z   0.00
#define PLATFORM_1_Z   0.00
#define PLATFORM_2_Z   0.00
#define PLATFORM_3_Z   0.00
#define PLATFORM_4_Z   0.00
#define PLATFORM_5_Z   0.00

#endif

#ifdef MINI_TETRA

/* Define position of base strut ends in base (world) coordinates for */
/* mini tetra */
#define BASE_0_X -22.950
#define BASE_0_Y 13.250

#define BASE_1_X 22.950
#define BASE_1_Y 13.250

#define BASE_2_X 22.950
#define BASE_2_Y 13.250

#define BASE_3_X 0
#define BASE_3_Y -26.5

#define BASE_4_X 0
#define BASE_4_Y -26.5

#define BASE_5_X -22.950
#define BASE_5_Y 13.250

#define BASE_0_Z  0
#define BASE_1_Z  0
#define BASE_2_Z  0
#define BASE_3_Z  0
#define BASE_4_Z  0
#define BASE_5_Z  0

/* Define position of platform strut end in platform coordinate system */
/* for mini tetra */
#define PLATFORM_0_X -1
#define PLATFORM_0_Y 11.5

#define PLATFORM_1_X 1
#define PLATFORM_1_Y 11.5

#define PLATFORM_2_X 10.459
#define PLATFORM_2_Y -4.884

#define PLATFORM_3_X 9.459
#define PLATFORM_3_Y -6.616

#define PLATFORM_4_X -9.459
#define PLATFORM_4_Y -6.616

#define PLATFORM_5_X -10.459
#define PLATFORM_5_Y -4.884

#define PLATFORM_0_Z  0
#define PLATFORM_1_Z  0
#define PLATFORM_2_Z  0
#define PLATFORM_3_Z  0
#define PLATFORM_4_Z  0
#define PLATFORM_5_Z  0

#endif

#ifdef OCTA_TETRA

/* Define position of base strut ends in base (world) coordinates for
   minitetra with octahedral outside frame. Let A be side length of
   base triangle. Here A = 39 inches. */
#define BASE_0_X -19.5          /* -A/2 */
#define BASE_0_Y 11.258         /* A cos 30 * 1/3 */

#define BASE_1_X 19.5           /* A/2 */
#define BASE_1_Y 11.258         /* A cos 30 * 1/3 */

#define BASE_2_X 19.5           /* same as BASE_1_X */
#define BASE_2_Y 11.258         /* same as BASE_1_Y */

#define BASE_3_X 0              /* 0 */
#define BASE_3_Y -22.517        /* -A cos 30 * 2/3 */

#define BASE_4_X 0              /* same as BASE_3_X */
#define BASE_4_Y -22.517        /* same as BASE_3_Y */

#define BASE_5_X -19.5          /* same as BASE_0_X */
#define BASE_5_Y 11.258         /* same as BASE_0_Y */

#define BASE_0_Z  0             /* all 0 */
#define BASE_1_Z  0
#define BASE_2_Z  0
#define BASE_3_Z  0
#define BASE_4_Z  0
#define BASE_5_Z  0

/* Define position of platform strut end in platform coordinate system
   for minitetra with octahedral outside frame */
#define PLATFORM_0_X -1
#define PLATFORM_0_Y 11.5

#define PLATFORM_1_X 1
#define PLATFORM_1_Y 11.5

#define PLATFORM_2_X 10.459
#define PLATFORM_2_Y -4.884

#define PLATFORM_3_X 9.459
#define PLATFORM_3_Y -6.616

#define PLATFORM_4_X -9.459
#define PLATFORM_4_Y -6.616

#define PLATFORM_5_X -10.459
#define PLATFORM_5_Y -4.884

#define PLATFORM_0_Z  0
#define PLATFORM_1_Z  0
#define PLATFORM_2_Z  0
#define PLATFORM_3_Z  0
#define PLATFORM_4_Z  0
#define PLATFORM_5_Z  0

#endif

#ifdef GEN_TETRA

/*
  GEN_TETRA uses 4 parameters for the side and corner lengths of the
  base and platform. Set these and recompile, and you don't have to
  figure out all the vertex coordinates yourself.
*/

#define BASE_LENGTH 40.0
#define BASE_CORNER 1.75
#define PLATFORM_LENGTH 18.9
#define PLATFORM_CORNER 0.5
#define Q 0.2886751346          /* 1/3 cos 30 */

#define BASE_0_X (0.5 * BASE_CORNER)
#define BASE_0_Y (Q * (2.0 * BASE_LENGTH + BASE_CORNER))

#define BASE_1_X (0.5 * (BASE_LENGTH + BASE_CORNER))
#define BASE_1_Y (Q * (BASE_CORNER - BASE_LENGTH))

#define BASE_2_X (0.5 * BASE_LENGTH)
#define BASE_2_Y (-Q * (BASE_LENGTH + 2.0 * BASE_CORNER))

#define BASE_3_X -BASE_2_X
#define BASE_3_Y BASE_2_Y

#define BASE_4_X -BASE_1_X
#define BASE_4_Y BASE_1_Y

#define BASE_5_X -BASE_0_X
#define BASE_5_Y BASE_0_Y

#define BASE_0_Z 0              /* all 0 */
#define BASE_1_Z 0
#define BASE_2_Z 0
#define BASE_3_Z 0
#define BASE_4_Z 0
#define BASE_5_Z 0

/* Define position of platform strut end in platform coordinate system
   for minitetra with octahedral outside frame */
#define PLATFORM_0_X (0.5 * PLATFORM_LENGTH)
#define PLATFORM_0_Y (Q * (PLATFORM_LENGTH + 2.0 * PLATFORM_CORNER))

#define PLATFORM_1_X (0.5 * (PLATFORM_LENGTH + PLATFORM_CORNER))
#define PLATFORM_1_Y (Q * (PLATFORM_LENGTH - PLATFORM_CORNER))

#define PLATFORM_2_X (0.5 * PLATFORM_CORNER)
#define PLATFORM_2_Y (-Q * (2.0 * PLATFORM_LENGTH + PLATFORM_CORNER))

#define PLATFORM_3_X -PLATFORM_2_X
#define PLATFORM_3_Y PLATFORM_2_Y

#define PLATFORM_4_X -PLATFORM_1_X
#define PLATFORM_4_Y PLATFORM_1_Y

#define PLATFORM_5_X -PLATFORM_0_X
#define PLATFORM_5_Y PLATFORM_0_Y

#define PLATFORM_0_Z 0
#define PLATFORM_1_Z 0
#define PLATFORM_2_Z 0
#define PLATFORM_3_Z 0
#define PLATFORM_4_Z 0
#define PLATFORM_5_Z 0

#endif