Difference between revisions of "Car testdrive (lane change manoeuvre)"

From mintOC
Jump to: navigation, search
(C)
Line 7: Line 7:
 
}}
 
}}
  
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]].  
+
The testdrive control problem is a time optimal double lane change maneouvre with gear shift. It has been introduced as a benchmark problem for mixed-integer optimal control by <bibref>Gerdts2005</bibref>.  
 
+
== Motivation ==
+
  
 
== Mathematical formulation ==
 
== Mathematical formulation ==
  
We consider a single-track model, derived under the simplifying assumption that rolling and pitching of the car body can be neglected. Consequentially, only a single front and rear wheel is modeled, located in the virtual center of the original two wheels. Motion of the car body is considered on the horizontal plane only.
+
The mathematical equations form a small-scale [[:Category:ODE model|ODE model]].
 +
 
 +
The vehicle dynamics are based on a single-track model, derived under the simplifying assumption that rolling and pitching of the car body can be neglected. Consequentially, only a single front and rear wheel is modeled, located in the virtual center of the original two wheels. Motion of the car body is considered on the horizontal plane only.
  
 
Four controls represent the driver's choice on steering and velocity. We denote with <math>w_\delta</math> the steering wheel's angular velocity. The force <math>F_\text{B}</math> controls the total braking force, while the accelerator pedal position <math>\phi</math> is translated into an accelerating force. Finally, the selected gear <math>\mu</math> influences the effective engine torque's transmission.
 
Four controls represent the driver's choice on steering and velocity. We denote with <math>w_\delta</math> the steering wheel's angular velocity. The force <math>F_\text{B}</math> controls the total braking force, while the accelerator pedal position <math>\phi</math> is translated into an accelerating force. Finally, the selected gear <math>\mu</math> influences the effective engine torque's transmission.
 +
 +
  
 
== Resulting MIOCP ==
 
== Resulting MIOCP ==
Line 35: Line 37:
 
These fixed values are used within the model.
 
These fixed values are used within the model.
  
<math>
+
{| border="1" align="center" cellpadding="5" cellspacing="0"
\begin{array}{llcl}
+
|- bgcolor=#c7c7c7
\text{Parameter} & \text{Value} & \text{Unit} & \text{Description} \\
+
! Symbol !! Value !! Unit !! Description
\hline
+
|-
m           & 1.239\cdot 10^3     & \text{kg}                    & \text{Mass of the car}  \\
+
| align=center | <math>m</math> || align=right | 1.239e+3 || kg || Mass of the car
g           & 9.81               & \frac{\text{m}}{\text{s}^2}  & \text{Gravity constant} \\
+
|-
l_\text{f}   & 1.19016             & \text{m}                    & \text{Front wheel distance to center of gravity} \\
+
| align=center | <math>g</math> || align=right | 9.81 || m/s^2 || Gravity constant
l_\text{r}   & 1.37484             & \text{m}                    & \text{Rear wheel distance to center of gravity} \\
+
|-
e_\text{SP} & 0.5                 & \text{m}                    & \text{Drag mount point distance to center of gravity} \\
+
| align=center | <math>l_\text{f}</math> || align=right | 1.19016 || m || Front wheel distance to center of gravity
R           & 0.302               & \text{m}                    & \text{Wheel radius} \\
+
|-
I_\text{zz} & 1.752\cdot 10^3     & \text{kg m}^2               & \text{Moment of inertia} \\
+
| align=center | <math>l_\text{r}</math> || align=right | 1.37484 || m || Rear wheel distance to center of gravity
c_\text{w}   & 0.3                 & -                            & \text{Air drag coefficient} \\
+
|-
\rho         & 1.249512           & \frac{\text{kg}}{\text{m}^3} & \text{Air density} \\
+
| align=center | <math>e_\text{SP}</math> || align=right | 0.5 || m || Drag mount point distance to center of gravity
A           & 1.4378946874       & \text{m}^2                   & \text{Effective flow surface} \\
+
|-
i^1_\text{g} & 3.09               & -                            & \text{Transmission ratio of first gear} \\
+
| align=center | <math>R</math> || align=right | 0.302 || m || Wheel radius
i^2_\text{g} & 2.002               & -                            & \text{Transmission ratio of second gear} \\
+
|-
i^3_\text{g} & 1.33               & -                            & \text{Transmission ratio of third gear} \\
+
| align=center | <math>I_\text{zz}</math> || align=right | 1.752e+3 || kg m^2 || Moment of inertia
i^4_\text{g} & 1.0                 & -                            & \text{Transmission ratio of fourth gear} \\
+
|-
i^5_\text{g} & 0.805               & -                             & \text{Transmission ratio of fifth gear} \\
+
| align=center | <math>c_\text{w}</math> || align=right | 0.3 || m || Air drag coefficient
i_\text{t}   & 3.91               & -                             & \text{Engine torque transmission ratio} \\
+
|-
B_\text{f}   & 1.096\cdot 10^1     & -                            & \text{Pacejka coefficients (stiffness)} \\
+
| align=center | <math>\rho</math> || align=right | 1.249512 || kg/m^3 || Air density
B_\text{r}   & 1.267\cdot 10^1     & -                             & \\
+
|-
C_\text{f}   & 1.3                 & -                            & \text{Pacejka coefficients (shape)} \\
+
| align=center | <math>A</math> || align=right | 1.4378946874 || m^2 || Effective flow surface
C_\text{r}   & 1.3                 & --                            & \\
+
|-
D_\text{f}   & 4.5604\cdot 10^3   & --                            & \text{Pacejka coefficients (peak)} \\
+
| align=center | <math>i_\text{g}</math> || align=right | 3.09, 2.002, 1.33, 1.0, 0.805 || - || Transmission ratios for the five gears
D_\text{r}   & 3.94781\cdot 10^3   & --                            & \\
+
|-
E_\text{f}   & -0.5               & --                            & \text{Pacejka coefficients (curvature)} \\
+
| align=center | <math>i_\text{t}</math> || align=right | 3.91 || - || Engine transmission ratio
E_\text{r}   & -0.5               & --                            & \\
+
|-
\end{array}
+
| align=center | <math>B_\text{f}</math> || align=right | 1.096e+1 || m || Pacejka coefficients (stiffness)
</math>
+
|-
 +
| align=center | <math>B_\text{r}</math> || align=right | 1.267e+1 || m ||
 +
|-
 +
| align=center | <math>C_\text{f}</math> || align=right | 1.3 || m || Pacejka coefficients (shape)
 +
|-
 +
| align=center | <math>C_\text{r}</math> || align=right | 1.3 || m ||
 +
|-
 +
| align=center | <math>D_\text{f}</math> || align=right | 4.5604e+3 || m || Pacejka coefficients (peak)
 +
|-
 +
| align=center | <math>D_\text{r}</math> || align=right | 3.94781e+3 || m ||
 +
|-
 +
| align=center | <math>E_\text{f}</math> || align=right | -0.5 || m || Pacejka coefficients (curvature)
 +
|-
 +
| align=center | <math>E_\text{r}</math> || align=right | -0.5 || m ||
 +
|}
  
 
== Test course ==
 
== Test course ==

Revision as of 13:35, 25 November 2008

Car testdrive (lane change manoeuvre)
State dimension: 1
Differential states: 7
Continuous control functions: 3
Discrete control functions: 1
Interior point inequalities: 7


The testdrive control problem is a time optimal double lane change maneouvre with gear shift. It has been introduced as a benchmark problem for mixed-integer optimal control by <bibref>Gerdts2005</bibref>.

Mathematical formulation

The mathematical equations form a small-scale ODE model.

The vehicle dynamics are based on a single-track model, derived under the simplifying assumption that rolling and pitching of the car body can be neglected. Consequentially, only a single front and rear wheel is modeled, located in the virtual center of the original two wheels. Motion of the car body is considered on the horizontal plane only.

Four controls represent the driver's choice on steering and velocity. We denote with w_\delta the steering wheel's angular velocity. The force F_\text{B} controls the total braking force, while the accelerator pedal position \phi is translated into an accelerating force. Finally, the selected gear \mu influences the effective engine torque's transmission.


Resulting MIOCP

For t \in [t_0, t_f] almost everywhere the mixed-integer optimal control problem is given by


\begin{array}{llcl}
 \displaystyle \min_{x(\cdot), u(\cdot), \mu(\cdot)} & t_\text{f}   \\[1.5ex]
 \mbox{s.t.} & \dot{x}(t) & = & f(t, x(t), u(t), \mu(t)), \\
 & x(t_0) &=& x_0, \\
 & r(t,x(t),u(t)) &\geq& 0, \\
 & \mu(t) &\in&  \{1, 2, 3, 4, 5\}.
\end{array}

Parameters

These fixed values are used within the model.

Symbol Value Unit Description
m 1.239e+3 kg Mass of the car
g 9.81 m/s^2 Gravity constant
l_\text{f} 1.19016 m Front wheel distance to center of gravity
l_\text{r} 1.37484 m Rear wheel distance to center of gravity
e_\text{SP} 0.5 m Drag mount point distance to center of gravity
R 0.302 m Wheel radius
I_\text{zz} 1.752e+3 kg m^2 Moment of inertia
c_\text{w} 0.3 m Air drag coefficient
\rho 1.249512 kg/m^3 Air density
A 1.4378946874 m^2 Effective flow surface
i_\text{g} 3.09, 2.002, 1.33, 1.0, 0.805 - Transmission ratios for the five gears
i_\text{t} 3.91 - Engine transmission ratio
B_\text{f} 1.096e+1 m Pacejka coefficients (stiffness)
B_\text{r} 1.267e+1 m
C_\text{f} 1.3 m Pacejka coefficients (shape)
C_\text{r} 1.3 m
D_\text{f} 4.5604e+3 m Pacejka coefficients (peak)
D_\text{r} 3.94781e+3 m
E_\text{f} -0.5 m Pacejka coefficients (curvature)
E_\text{r} -0.5 m

Test course

The double-lane change manoeuvre presented in <bibref>Gerdts2005</bibref> is realized by constraining the car's position onto a prescribed track at any time t\in[t_0,t_\text{f}]. Starting in the left position with an initial prescribed velocity, the driver is asked to manage a change of lanes modeled by an offset of 3.5 meters in the track. Afterwards he is asked to return to the starting lane. This manoeuvre can be regarded as an overtaking move or as an evasive action taken to avoid hitting an obstacle suddenly appearing on the starting lane.

From a mathematical point of view, the test track is described by setting up piecewise cubic spline functions P_\text{l}(x) and P_\text{r}(x) modeling the top and bottom track boundary, given a horizontal position x.


\begin{align}
P_\text{l}(x) &:=& \left\{ 
	\begin{array}{llrcl}
		0                        & \text{if } &        & x & \leq 44, \\
		4\; h_2\; (x-44)^3       & \text{if } & 44 <   & x & \leq 44.5, \\
		4\; h_2\; (x-45)^3 + h_2 & \text{if } & 44.5 < & x & \leq 45, \\
		h_2                      & \text{if } & 45 <   & x & \leq 70, \\
		4\; h_2\; (70-x)^3 + h_2 & \text{if } & 70 <   & x & \leq 70.5, \\
		4\; h_2\; (71-x)^3       & \text{if } & 70.5 < & x & \leq 71, \\
		0                        & \text{if } & 71 <   & x. &  \\
	\end{array} \right.  \\
P_\text{u}(x) &:=& \left\{ 
	\begin{array}{llrcl}
		h_1                            & \text{if } &        & x & \leq 15, \\
		4\; (h_3-h_1)\; (x-15)^3 + h_1 & \text{if } & 15 <   & x & \leq 15.5, \\
		4\; (h_3-h_1)\; (x-16)^3 + h_3 & \text{if } & 15.5 < & x & \leq 16, \\
		h_3                            & \text{if } & 16 <   & x & \leq 94, \\
		4\; (h_3-h_4)\; (94-x)^3 + h_3 & \text{if } & 94 <   & x & \leq 94.5, \\
		4\; (h_3-h_4)\; (95-x)^3 + h_4 & \text{if } & 94.5 < & x & \leq 95, \\
		h_4                            & \text{if } & 95 <   & x. &  \\
	\end{array} \right.  
\end{align}

where B=1.5\;\text{m} is the car's width and


	h_1 := 1.1\; B + 0.25, \quad
	h_2 := 3.5, \quad
	h_3 := 1.2\; B + 3.75,\quad
	h_4 := 1.3\; B + 0.25.

Test course for the double lane change manoeuvre

Reference Solutions

Reference solutions for the case of a fixed time-grid are given in <bibref>Gerdts2005</bibref>. Solutions for a non-fixed time grid are given in <bibref>Gerdts2006</bibref>.

Source Code

C

The differential equations in C code:

// Controls
double C_steer = u[0];
double C_brake = u[1];
double C_acc   = u[2];
 
// Differential states
double X_v     = xd[2];
double X_beta  = xd[3];
double X_psi   = xd[4];
double X_wz    = xd[5];
double X_delta = xd[6];
 
// Intermediate values
double alpha_f, alpha_r, v_km_h, v_km_h2;
double F_Ax, F_Ay, F_Bf, F_Br, F_Rf, F_Rr, F_sf, F_sr, F_lr, F_lf;
double f_R, f_1, w_mot, f_2, f_3, M_mot, M_wheel;
double X_v_cos_X_beta, X_v_sin_X_beta;
 
X_v_cos_X_beta = X_v * cos ( X_beta );
X_v_sin_X_beta = X_v * sin ( X_beta );
alpha_f        = X_delta - atan( ( P_l_f * X_wz - X_v_sin_X_beta ) / X_v_cos_X_beta );
alpha_r        =           atan( ( P_l_r * X_wz + X_v_sin_X_beta ) / X_v_cos_X_beta );
 
F_sf    = P_D_f * sin( P_C_f * atan( P_B_f*alpha_f - P_E_f*(P_B_f*alpha_f - atan(P_B_f*alpha_f)) ) );
F_sr    = P_D_r * sin( P_C_r * atan( P_B_r*alpha_r - P_E_r*(P_B_r*alpha_r - atan(P_B_r*alpha_r)) ) );
 
F_Ax    = 0.5 * P_c_w * P_rho * P_A * X_v*X_v;
F_Ay    = 0.0;
F_Bf    = 2.0/3.0 * C_brake;
F_Br    = 1.0/3.0 * C_brake;
 
v_km_h  = X_v / 100.0 * 3.6;
v_km_h2 = v_km_h * v_km_h;
f_R     = P_f_R0 + P_f_R1 * v_km_h + P_f_R4 * v_km_h2 * v_km_h2;
F_Rf    = f_R * P_F_zf;
F_Rr    = f_R * P_F_zr;
 
f_1     = 1.0 - exp( -3.0 * C_acc );
w_mot   = X_v * P_ig * P_i_t / P_R;
f_2     = -37.8 + (1.54 - 0.0019 * w_mot_i) * w_mot;
f_3     = -34.9 - 0.04775 * w_mot;
M_mot   = f_1 * f_2_i + ( 1.0 - f_1 ) * f_3_i;
M_wheel = P_ig * P_i_t * M_mot_i;
 
F_lr    = M_wheel / P_R - F_Br - F_Rr;
F_lf    = - F_Bf - F_Rf;
 
// 0 Horizontal position x
rhs[0] = X_v * cos( X_psi - X_beta );
// 1 Vertical position y
rhs[1] = X_v * sin( X_psi - X_beta );
// 2 Velocity v
rhs[2] = 1.0 / P_m * (
	  (F_lr - F_Ax) * cos(X_beta) + F_lf * cos(X_delta + X_beta)
	- (F_sr - F_Ay) * sin(X_beta) - F_sf * sin(X_delta + X_beta) );
// 3 Side slip angle beta
rhs[3] = X_wz - 1.0 / (P_m * X_v) * (
	  (F_lr - F_Ax) * sin(X_beta) + F_lf * sin(X_delta + X_beta)
	+ (F_sr - F_Ay) * cos(X_beta) + F_sf * cos(X_delta + X_beta) );
// 4 Yaw angle psi
rhs[4] = X_wz;
// 5 Velocity of yaw angle w_z
rhs[5] = 1.0 / P_I_zz * (
	  F_sf * P_l_f * cos(X_delta) - F_sr * P_l_r
	+ F_lf * P_l_f * sin(X_delta) - F_Ay * P_e_SP );
// 6 Steering angle delta
rhs[6] = C_steer;

Variants

See testdrive overview page.

References

<bibreferences/>