robot.tens
Go to the documentation of this file.
1 
2 [CONSTANTS]
3 
4  % We re-use the parametrization of the TwoPrism and we replace
5  % the vertical cables by springs
6 
7  % Parametrization of a two-prism tower taken from
8  % C. Sultan, M. Corles and R. E. Skelton
9  % The pre-estressability rpoblem of tensegrity structures: some
10  % analytical results, International journal of solids and structures
11  % vol 38, 20011
12  %
13  % We model a SVDB struture (section 4) which essentially has the same
14  % solutions as a SVD structure (section 3)
15  % We compute the constants that give a stable configuration and then
16  % leave some ranges around the equilibrium point to allow form motion.
17  % In this way we are sure to have valid ranges for the variables.
18 
19  % The two driving parameters
20  alpha := 60*pi/180
21  delta := 30*pi/180
22 
23  % Structural parameters (taken from the matlab file)
24  b := 0.27 % Size of base/platform
25  l := 0.4 % Length of struts
26  P := PARAMETER(PRETENSION) % Pretension (taken from parameter file)
27  rs := 0.0025 % Radius to represent struts
28  rc := 0.00075 % Radius to represent cables
29  rp := 0.0025 % Radius to represent springs
30  ra := rs*6 % Radius of the anchor elements
31 
32  % small value (used to compare alpha with pi/3 = 60 deg)
33  zero:=1e-10
34 
35  % h is a zero-centered parametrization of the structure height
36  u := sin(delta)*cos(alpha+pi/6) % auxiliary
37  h := (abs(alpha-pi/3)<zero ? l*cos(delta)/2 :
38  cos(delta)*(l*u+sqrt(b^2/3-3*l^2*u^2)-b/sqrt(3))/(2*u))
39 
40  % Length of the different strings
41  D := sqrt(h^2+b^2/3+l^2-2*l*b*sin(delta)*sin(alpha)/sqrt(3)-2*l*h*cos(delta))
42  V := sqrt(b^2+l^2-2*l*b*sin(delta)*sin(alpha+pi/6))
43  S := sqrt(h^2+b^2/3+l^2*sin(delta)^2-2*l*b*sin(delta)*cos(alpha-pi/6)/sqrt(3))
44 
45  % print D
46 
47  % Tension of the different strings
48  T_d_0 := 1
49 
50  T_v_0 := (abs(alpha-pi/3)<zero ? T_d_0*V*(3*l*sin(delta)/(2*b)-1)/D :
51  T_d_0*V*((l*cos(delta)/h-1)*sin(alpha-pi/6)-cos(alpha))/(D*sqrt(3)*cos(alpha+pi/6)))
52  T_s_0 := (abs(alpha-pi/3)<zero ? T_d_0 :
53  T_d_0*S*(l*cos(delta)/h-1)/D)
54 
55  T_b_0 := (abs(alpha-pi/3)<zero ? T_d_0*(2*b^2-9*l*b*sin(delta)+9*l^2*sin(delta)^2)/(6*D*b) :
56  T_d_0*(3*l^2*sin(delta)*cos(delta)
57  +6*b*h*cos(alpha-pi/3)
58  -6*l*h*sin(delta)
59  -2*sqrt(3)*b*l*cos(delta)*sin(alpha))/(6*D*sqrt(3)*h*cos(alpha+pi/6)))
60 
61  % Compression of the struts (fixed an error from the paper!)
62  C_0 := (abs(alpha-pi/3)<zero ? T_d_0*(3*l^2*sin(delta)/(2*b)-l/2)/D :
63  T_d_0*(2*sqrt(3)*h*b*sin(delta)
64  -sqrt(3)*l*b*sin(2*delta)/2
65  +6*h^2*cos(delta)*sin(alpha-pi/3)
66  -6*l*h*(cos(delta)^2*sin(alpha-pi/3)+sin(alpha+pi/6)/sqrt(3))
67  +2*sqrt(3)*l^2*cos(delta)*cos(alpha)
68  +6*l^2*cos(delta)^3*sin(alpha-pi/3))/(6*D*h*sin(pi/3-alpha)))
69 
70  % Normalize the tension/compression (to remove the pre-tension)
71  n := sqrt(6*(T_d_0^2+T_v_0^2+T_s_0^2++T_b_0^2+C_0^2))
72  T_d := P*T_d_0/n
73  T_v := P*T_v_0/n
74  T_s := P*T_s_0/n
75  T_b := P*T_b_0/n
76  C := P*C_0/n
77 
78  % print T_d
79  % print T_v
80  % print T_s
81  % print T_b
82  % print C
83 
84  % Physical quantities used to define the stiffness of the strings
85  E := 14e10 % N/m^2 Young's modulus
86  s := 2.5e9 % N/m^2 maximum tendon stress
87  g := 4 % safety margin
88 
89  % The stiffness as defined int the paper
90  K_d_0 := (E*P*g/s)*T_d
91  K_v_0 := (E*P*g/s)*T_v
92  K_s_0 := (E*P*g/s)*T_s
93 
94  % The rest lengths for the different cables
95  R_d := K_d_0*D/(T_d+K_d_0)
96  R_v := K_v_0*V/(T_v+K_v_0)
97  R_s := K_s_0*S/(T_s+K_s_0)
98 
99  % print R_d
100  % print R_v
101  % print R_s
102 
103  % The stiffness as in appears in our models
104  K_d := K_d_0 / R_d
105  K_v := K_v_0 / R_v
106  K_s := K_s_0 / R_s
107 
108  % print K_d
109  % print K_v
110  % print K_s
111 
112  % range of compression forces supported by the struts
113  % For struts the rest lengt is set to 0 and the stiffnes
114  % is set to vary so that with a constant length, we can
115  % have different forces.
116  % If both the rest length and the stiffness are free we
117  % have an extra (useless) degree of freedom.
118  min_fs := -2*C % compression is negative!
119  max_fs := 0
120 
121  % data for the cables on the base/platform: range of supported tensions
122  % These cables have constant length. We additionally fix the stiffness
123  % so that varying the rest length we can have different forces.
124  % If both the rest length and the stiffness are free we
125  % have an extra (useless) degree of freedom.
126  min_f_b := 0
127  max_f_b := 2*T_b
128 
129  % data for diagonal cables
130  min_lc_d := 0.1*D
131  max_lc_d := 2*D
132  min_r_d := 0
133  max_r_d := 2*R_d
134 
135  % data for vertical springs
136  min_lc_v := 0.1*V
137  max_lc_v := 2*V
138  % Adjust the rest length and the stiffnes to convert from
139  % cables to springs (lower stiffness and rest length)
140  % Moreover, spring rest length is constant
141  beta := 0.5
142  R_p := beta*V
143  K_p := T_v/(V-R_p)
144 
145 
146  % data for saddle cables
147  min_lc_s := 0.1*S
148  max_lc_s := 2*S
149  min_r_s := 0
150  max_r_s := 2*R_s
151 
152 
153 [STRUCTURE]
154 
155  strut s1 : n1 n2
156  length l
157  force [min_fs,max_fs]
158  radius rs
159 
160  strut s2 : n3 n4
161  length l
162  force [min_fs,max_fs]
163  radius rs
164 
165  strut s3 : n5 n6
166  length l
167  force [min_fs,max_fs]
168  radius rs
169 
170  strut s4 : n7 n8
171  length l
172  force [min_fs,max_fs]
173  radius rs
174 
175  strut s5 : n9 n10
176  length l
177  force [min_fs,max_fs]
178  radius rs
179 
180  strut s6 : n11 n12
181  length l
182  force [min_fs,max_fs]
183  radius rs
184 
185 
186  % Cables in the same order as in the matlab file
187 
188  cable c1 : n1 n11 % diagonal
189  length [min_lc_d,max_lc_d]
190  stiffness K_d
191  rest [min_r_d,max_r_d]
192  radius rc
193 
194  spring c2 : n1 n6 % vertical
195  length [min_lc_v,max_lc_v]
196  stiffness K_p
197  rest R_p
198  radius rp
199 
200  cable c3 : n3 n7 % diagonal
201  length [min_lc_d,max_lc_d]
202  stiffness K_d
203  rest [min_r_d,max_r_d]
204  radius rc
205 
206  spring c4 : n3 n2 % vertical
207  length [min_lc_v,max_lc_v]
208  stiffness K_p
209  rest R_p
210  radius rp
211 
212  cable c5 : n5 n9 % diagonal
213  length [min_lc_d,max_lc_d]
214  stiffness K_d
215  rest [min_r_d,max_r_d]
216  radius rc
217 
218  spring c6 : n5 n4 % vertical
219  length [min_lc_v,max_lc_v]
220  stiffness K_p
221  rest R_p
222  radius rp
223 
224  cable c7 : n7 n4 % saddle
225  length [min_lc_s,max_lc_s]
226  stiffness K_s
227  rest [min_r_s,max_r_s]
228  radius rc
229 
230  cable c8 : n7 n2 % saddle
231  length [min_lc_s,max_lc_s]
232  stiffness K_s
233  rest [min_r_s,max_r_s]
234  radius rc
235 
236  cable c9 : n9 n6 % saddle
237  length [min_lc_s,max_lc_s]
238  stiffness K_s
239  rest [min_r_s,max_r_s]
240  radius rc
241 
242  cable c10 : n9 n4 % saddle
243  length [min_lc_s,max_lc_s]
244  stiffness K_s
245  rest [min_r_s,max_r_s]
246  radius rc
247 
248  cable c11 : n11 n2 % saddle
249  length [min_lc_s,max_lc_s]
250  stiffness K_s
251  rest [min_r_s,max_r_s]
252  radius rc
253 
254  cable c12 : n11 n6 % saddle
255  length [min_lc_s,max_lc_s]
256  stiffness K_s
257  rest [min_r_s,max_r_s]
258  radius rc
259 
260  spring c13: n11 n8 % vertical
261  length [min_lc_v,max_lc_v]
262  stiffness K_p
263  rest R_p
264  radius rp
265 
266  cable c14 : n2 n8 % diagonal
267  length [min_lc_d,max_lc_d]
268  stiffness K_d
269  rest [min_r_d,max_r_d]
270  radius rc
271 
272  spring c15: n7 n10 % vertical
273  length [min_lc_v,max_lc_v]
274  stiffness K_p
275  rest R_p
276  radius rp
277 
278  cable c16 : n4 n10 % diagonal
279  length [min_lc_d,max_lc_d]
280  stiffness K_d
281  rest [min_r_d,max_r_d]
282  radius rc
283 
284  spring c17: n9 n12 % vertical
285  length [min_lc_v,max_lc_v]
286  stiffness K_p
287  rest R_p
288  radius rp
289 
290  cable c18 : n6 n12 % diagonal
291  length [min_lc_d,max_lc_d]
292  stiffness K_d
293  rest [min_r_d,max_r_d]
294  radius rc
295 
296  cable c19 : n1 n3 % base/platform
297  length b
298  force [min_f_b,max_f_b]
299  radius rc
300  hidden
301 
302  cable c20 : n1 n5 % base/platform
303  length b
304  force [min_f_b,max_f_b]
305  radius rc
306  hidden
307 
308  cable c21 : n3 n5 % base/platform
309  length b
310  force [min_f_b,max_f_b]
311  radius rc
312  hidden
313 
314  cable c22 : n8 n10 % base/platform
315  length b
316  force [min_f_b,max_f_b]
317  radius rc
318  hidden
319 
320  cable c23 : n8 n12 % base/platform
321  length b
322  force [min_f_b,max_f_b]
323  radius rc
324  hidden
325 
326  cable c24 : n10 n12 % base/platform
327  length b
328  force [min_f_b,max_f_b]
329  radius rc
330  hidden
331 
332 [ADDONS]
333  % The platform
334  platform : prism (-2*ra,ra,2*ra) (b*cos(pi/3),-b*sin(pi/3)-2*ra,2*ra) (b+2*ra,ra,2*ra) 0.005 red decoration
335 
336  % The anchor points between the tensegrity and the platform
337  cylinder ra (0,0,ra) (0,0,2*ra) blue decoration
338  sphere ra (0,0,ra) blue decoration
339 
340  cylinder ra (b*cos(pi/3),-b*sin(pi/3),ra) (b*cos(pi/3),-b*sin(pi/3),2*ra) blue decoration
341  sphere ra (b*cos(pi/3),-b*sin(pi/3),ra) blue decoration
342 
343  cylinder ra (b,0,2*ra) (b,0,ra) blue decoration
344  sphere ra (b,0,ra) blue decoration
345 
346  % The stick on the top of the platform
347  cylinder 2*rs (b/2,-b*sin(pi/3)/3,2*ra) (b/2,-b*sin(pi/3)/3,2*ra+0.25) red
348  sphere 2*rs (b/2,-b*sin(pi/3)/3,2*ra+0.25) red
349 
350  (0,0,0) n8
351  (b,0,0) n10
352  (b*cos(pi/3),-b*sin(pi/3),0) n12
353 
354 [COUPLE]
355 
356  % couple base/platform
357  force : c19,c20,c21,c22,c23,c24
358 
359 [FIXED POINTS]
360 
361  % n1 is implicitly fixed
362 
363  n3(z)=0
364 
365  n5(y)=0
366  n5(z)=0
367 
368 [OBSTACLES]
369 
370  plane: box (-0.2,-0.2,-2*ra-0.01)+(b+0.4,b*sin(pi/3)+0.4,0.005) green
371 
372  base: prism (-2*ra,-ra,-2*ra-0.005)
373  (b+2*ra,-ra,-2*ra-0.005)
374  (b*cos(pi/3),b*sin(pi/3)+2*ra,-2*ra-0.005)
375  0.005 red
376 
377  anchor1: cylinder ra (0,0,-2*ra) (0,0,-ra) blue decoration
378  anchor1ball: sphere ra (0,0,-ra) blue decoration
379 
380  anchor2: cylinder ra (b,0,-2*ra) (b,0,-ra) blue decoration
381  anchor2ball: sphere ra (b,0,-ra) blue decoration
382 
383  anchor3: cylinder ra (b*cos(pi/3),b*sin(pi/3),-2*ra) (b*cos(pi/3),b*sin(pi/3),-ra) blue decoration
384  anchor3ball: sphere ra (b*cos(pi/3),b*sin(pi/3),-ra) blue decoration
385 
386  hole1: body "bodies/box_with_hole1.off" yellow % decoration
387  % hole2: body "bodies/box_with_hole2.off" black decoration
388 
389 [COLLISIONS]
390 
391  check: all
392  do not check: connected
393 
462 
CBLAS_INLINE void Normalize(unsigned int s, double *v)
Normalizes a vector.