1 // =============================================================================
2 // PROJECT CHRONO - http://projectchrono.org
3 //
4 // Copyright (c) 2014 projectchrono.org
5 // All rights reserved.
6 //
7 // Use of this source code is governed by a BSD-style license that can be found
8 // in the LICENSE file at the top level of the distribution and at
9 // http://projectchrono.org/license-chrono.txt.
10 //
11 // =============================================================================
12 
13 #ifndef CHPAC2002_DATA_H
14 #define CHPAC2002_DATA_H
15 
16 #include <string>
17 
18 namespace chrono {
19 namespace vehicle {
20 
21 // important slip quantities
22 struct slips {
23     double kappa;       // INPUT desired slip rate
24     double alpha;       // INPUT turn slip angle
25     double alpha_star;  // INPUT tan(alpha)
26     double gamma;       // INPUT camber angle
27 
28     double V_cx;            // tire c-sys  x-vel.
29     double V_cy;            // tire c-sys y-vel
30     double V_sx;            // tire c-sys x-dir slip velocity
31     double V_sy;            // y-dir slip vel
32     double psi_dot;         // turn slip angular velocity
33     double cosPrime_alpha;  // ratio,  V.x / V_mag;
34 
35     // slip displacements
36     double u;  // contact patch slip displacement
37     double v_alpha;
38     double v_gamma;
39     double v_phi;
40 
41     // integrated slip velocity terms over time step increment, using ODE-45
42     double Idu_dt;
43     double Idv_alpha_dt;
44     double Idv_gamma_dt;
45     double Idv_phi_dt;
46 
47     //  slips used in all calculations (can be INPUTs or transient slips)
48     double alphaP;
49     double kappaP;
50     double gammaP;
51     double phiT;
52     double phiP;
53 };
54 
55 // input data file structs
56 struct model {
57     std::string property_file_format;  // pac tire model type
58     int use_mode;                      // used in Adams/Car
59     double vxlow;                      // minimum horizontal velocity
60     double longvl;                     // tire horizontal velocity at measurements
61     std::string tyreside;              // left or right
62 };
63 
64 struct dimension {
65     double unloaded_radius;  // R0
66     double width;            // nominal section width
67     double aspect_ratio;     // section height / width
68     double rim_radius;
69     double rim_width;
70 };
71 
72 struct shape {
73     std::vector<double> radial;
74     std::vector<double> width;
75 };
76 
77 struct vertical {
78     double vertical_stiffness;  // vertical stiffness
79     double vertical_damping;    // vertical damping
80     double breff;               // low load stiffness e.r.r. ???
81     double dreff;               // peak value e.r.r.
82     double freff;               // high load stiffness e.r.r.
83     double fnomin;              // nominal wheel load
84 };
85 
86 struct long_slip_range {
87     double kpumin;  // min valid slip
88     double kpumax;  // max valid slip
89 };
90 
91 struct slip_angle_range {
92     double alpmin;  // min. valid slip angle
93     double alpmax;  // max valid slip angle
94 };
95 
96 struct inclination_angle_range {
97     double cammin;  // min valid camber angle (rads)
98     double cammax;  // max
99 };
100 
101 struct vertical_force_range {
102     double fzmin;  // min. allowable wheel load
103     double fzmax;  // max
104 };
105 
106 struct scaling_coefficients {
107     double lfzo;   // scale factor, rated load
108     double lcx;    // " ", Fx shape
109     double lmux;   // " ", Fx peak friction coef.
110     double lex;    // Fx curvature
111     double lkx;    // Fx slip stiffness
112     double lhx;    // Fx horizontal shift
113     double lvx;    // Fx vertical shift
114     double lgax;   // Fx camber factor
115     double lcy;    // Fy shape factor
116     double lmuy;   // Fy peak friction
117     double ley;    // Fy curvature
118     double lky;    // Fy cornering stiffness
119     double lhy;    // Fy horizontal shift
120     double lvy;    // Fy vertical shift
121     double lgay;   // Fy camber factor
122     double ltr;    // Peak pneumatic trail
123     double lres;   // residual torque offset
124     double lgaz;   // Mz camber factor
125     double lxal;   // alpha influence on Fx
126     double lyka;   // alpha influence on Fy
127     double lvyka;  // kappa induced Fy
128     double ls;     // moment arm, Fx
129     double lsgkp;  // relaxation length, Fx
130     double lsgal;  // relaxation length, Fy
131     double lgyr;   // gyroscopic torque
132     double lmx;    // overturning couple
133     double lvmx;   // vertical shift, Mx
134     double lmy;    // rolling resistance torque
135 };
136 
137 struct longitudinal_coefficients {
138     double pcx1;  // shape factor C,fx
139     double pdx1;  // long. friction Mux at Fz,nom
140     double pdx2;  // variation of friction Mux w/ load
141     double pdx3;  // " w/ camber
142     double pex1;  // Long. curvature E,fx at Fz,nom
143     double pex2;  // variation of curvature E,fx w/ load
144     double pex3;  // " w/ load^2
145     double pex4;  // Curvature E,fx while driving
146     double pkx1;  // long. slip stiff K,fx/Fz @ Fz,nom
147     double pkx2;  // variation " w/ load
148     double pkx3;  // exponent " w/ load
149     double phx1;  // horizontal shift S,hx @ Fz,nom
150     double phx2;  // variation of S,hx w/ load
151     double pvx1;  // vertical shift S,vx/Fz @ Fz,nom
152     double pvx2;  // variation of shift S,vx/Fz w/ load
153     double rbx1;  // slope factor for combined slip Fx reduction
154     double rbx2;  // variation of slope Fx reduction w/ kappa
155     double rcx1;  // shape factor for combined slip Fx reduction
156     double rex1;  // curvature factor, combined Fx
157     double rex2;  // ", w/ load
158     double rhx1;  // shift factor for combined slip Fx reduction
159     double ptx1;  // relaxation length sigkap0/Fz @ Fz,nom
160     double ptx2;  // variation of " w/ load
161     double ptx3;  // variation of " w/ exponent of load
162 };
163 
164 struct overturning_coefficients {
165     double qsx1;  // lateral force induced overturning moment
166     double qsx2;  // camber induced overturning couple
167     double qsx3;  // Fy induced overturning couple
168 };
169 
170 struct lateral_coefficients {
171     double pcy1;  // shape factor C,Fy
172     double pdy1;  // lateral friction Muy
173     double pdy2;  // variation of friction Muy w/ load
174     double pdy3;  // " w/ camber^2
175     double pey1;  // lateral curvature E,fy @ Fz,nom
176     double pey2;  // variation of curvature E,fy w/ load
177     double pey3;  // zero order camber dep. on curvature E,fy
178     double pey4;  // variation of curvature E,fy w/ camber
179     double pky1;  // max. val of stiffness K,fy/Fz,nom
180     double pky2;  // load @ which K,fy reaches maximum value
181     double pky3;  // variation of K,fy/Fz,nom w/ camber
182     double phy1;  // horizontal shift S,hy @ Fz,nom
183     double phy2;  // variation of shift S,hy w/ load
184     double phy3;  // " w/ camber
185     double pvy1;  // vertical shift in X,vy/Fz @ Fz,nom
186     double pvy2;  // variation of shift S,vy/Fz w/ load
187     double pvy3;  // " w/ camber
188     double pvy4;  // " w/ camber And load
189     double rby1;  // slope for combined Fy reduction
190     double rby2;  // variation of slope Fy reduction w/ alpha
191     double rby3;  // shift term, alpha in Fy slope reduction
192     double rcy1;  // shape factor for combined Fy reduction
193     double rey1;  // curvature factor, combined Fy
194     double rey2;  // " w/ load
195     double rhy1;  // shift for combined Fy reduction
196     double rhy2;  // " w/ load
197     double rvy1;  // kappa induced side force X,vyk/Muy*Fz @ Fz,nom
198     double rvy2;  // variation of " w/ load
199     double rvy3;  // " w/ camber
200     double rvy4;  // " w/ alpha
201     double rvy5;  // " w/ kappa
202     double rvy6;  // " w/ arctan(kappa)
203     double pty1;  // peak val of relaxation length SigAlpha,0/R,0
204     double pty2;  // val of Fz/Fz,nom where SigAlpha,0 is extreme
205 };
206 
207 struct rolling_coefficients {
208     double qsy1;  // rolling resistance, torque
209     double qsy2;  // rolling resistance dep. on Fx
210     double qsy3;  // " dep. on speed
211     double qsy4;  // " dep. on speed^4
212 };
213 
214 struct aligning_coefficients {
215     double qbz1;   // trail slope B,pt @ Fz,nom
216     double qbz2;   // variation of slope B,pt w/ load
217     double qbz3;   // " w/ load^2
218     double qbz4;   // " w/ camber
219     double qbz5;   // " w/ ||camber||
220     double qbz9;   // slope Br of residual torque M,zr
221     double qbz10;  // "
222     double qcz1;   // shape C,pt for pneumatic trail
223     double qdz1;   // peak trail D,pt'' = D,pt*(Fz/Fz,nom*R,0)
224     double qdz2;   // variation of peak D,pt'' w/ load
225     double qdz3;   // " w/ camber
226     double qdz4;   // " w/ camber^2
227     double qdz6;   // peak residual torque D,mr'' = D,mr/(Fz*R,0)
228     double qdz7;   // variation of peak factor D,mr'' w/ load
229     double qdz8;   // " w/ camber
230     double qdz9;   // " w/ camber and load
231     double qez1;   // trail curvature E,pt @ Fz,nom
232     double qez2;   // variation of curvature E,pt w/ load
233     double qez3;   // " w/ load^2
234     double qez4;   // " w/ sign(Alpha-t)
235     double qez5;   // variation of E,pt w/ camber and sign(Alpha-t)
236     double qhz1;   // trial horizontal shift S,ht @ Fz,nom
237     double qhz2;   // variation of shift S,ht w/ load
238     double qhz3;   // " w/ camber
239     double qhz4;   // " w/ camber and load
240     double ssz1;   // nom. val of s/R,0, effect of Fx on Mz
241     double ssz2;   // variation of distance x/R,0 w/ Fy/Fz,nom
242     double ssz3;   // " w/ camber
243     double ssz4;   // " w/ load and camber
244     double qtz1;   // gyration torque constant
245     double mbelt;  // belt mass
246 };
247 
248 // collect all the subsections into the master struct
249 struct Pac2002_data {
250     struct model model;
251     struct dimension dimension;
252     struct shape shape;
253     struct vertical vertical;
254     struct long_slip_range long_slip_range;
255     struct slip_angle_range slip_angle_range;
256     struct inclination_angle_range inclination_angle_range;
257     struct vertical_force_range vertical_force_range;
258     struct scaling_coefficients scaling;
259     struct longitudinal_coefficients longitudinal;
260     struct overturning_coefficients overturning;
261     struct lateral_coefficients lateral;
262     struct rolling_coefficients rolling;
263     struct aligning_coefficients aligning;
264 };
265 
266 // -----------
267 // debugging
268 
269 struct pureLongCoefs {
270     double S_Hx;
271     double kappa_x;
272     double mu_x;
273     double K_x;
274     double B_x;
275     double C_x;
276     double D_x;
277     double E_x;
278     double F_x;
279     double S_Vx;
280 };
281 
282 struct pureLatCoefs {
283     double S_Hy;
284     double alpha_y;
285     double mu_y;
286     double K_y;
287     double S_Vy;
288     double B_y;
289     double C_y;
290     double D_y;
291     double E_y;
292 };
293 
294 struct zetaCoefs {
295     double z0;
296     double z1;
297     double z2;
298     double z3;
299     double z4;
300     double z5;
301     double z6;
302     double z7;
303     double z8;
304 };
305 
306 struct pureTorqueCoefs {
307     double S_Hf;
308     double alpha_r;
309     double S_Ht;
310     double alpha_t;
311     double cosPAlpha;
312     double K_y;
313 
314     double B_r;
315     double C_r;
316     double D_r;
317 
318     double B_t;
319     double C_t;
320     double D_t0;
321     double D_t;
322     double E_t;
323     double t;
324 
325     double MP_z;
326     double M_zr;
327 };
328 
329 struct combinedLongCoefs {
330     double S_HxAlpha;
331     double alpha_S;
332     double B_xAlpha;
333     double C_xAlpha;
334     double E_xAlpha;
335     double G_xAlpha0;
336     double G_xAlpha;
337 };
338 
339 struct combinedLatCoefs {
340     double S_HyKappa;
341     double kappa_S;
342     double B_yKappa;
343     double C_yKappa;
344     double E_yKappa;
345     double D_VyKappa;
346     double S_VyKappa;
347     double G_yKappa0;
348     double G_yKappa;
349 };
350 
351 struct combinedTorqueCoefs {
352     double cosPAlpha;
353     double FP_y;
354     double s;
355     double alpha_t_eq;
356     double alpha_r_eq;
357     double M_zr;
358     double t;
359     double M_z_x;  // Mz due to Fx
360     double M_z_y;  // Mz due to Fy
361                    // double MP_z; // = -t * FP_y
362 };
363 
364 struct relaxationL {
365     double C_Falpha;
366     double sigma_alpha;
367     double C_Fkappa;
368     double sigma_kappa;
369     double C_Fgamma;
370     double C_Fphi;
371 };
372 
373 struct bessel {
374     double u_Bessel;
375     double u_sigma;
376     double v_Bessel;
377     double v_sigma;
378 };
379 
380 }  // end namespace vehicle
381 }  // end namespace chrono
382 
383 #endif
384