# Control Design and Assessment for a Reversing Tractor-Trailer System Using a Cascade Controller
## 3 Control Design
### Path-Tracking Controller  
The main objective of the path tracking controller is to (i) minimize the distance between the trailer's axle (point \(M\) in Figure 3) and a virtual target on the path (ii) minimize the angle between the trailer's heading angle and the tangent \(T(a)\) of the path to be tracked. To achieve such objectives, the vehicle model will be developed in Frenet-Serret Frame {F}, as performed in [14; 26], by using the Frenet-Serret formulas. The system equation describing the motion of point \(M\) in (7) and (8) on the tractor and trailer will be rewritten relative to the moving point in {F}, unlike the fixed target developed in [10; 12]. At first, kinematics of the moving point \(P(a)\) with respect to the path will be explained. One is encouraged to revise the derived equations in [6] and the topics related to differential geometry. Figure 3 shows a path \(C\) with point \(P(a)\) as a target to be tracked by point \(M\), \(T(a)\) is the tangent of the curve at point \(P(a)\), \(\theta_{s}\) is the angle of the path tangent with respect to the x-axis of the cartesian coordinate, \(N(a)\) is the normal of the curve at point \(P(a)\) and \(V\) is the velocity of point \(M\). Figure 2: General layout of the proposed controller. The rate at which point \(P(a)\) (target point to be tracked) progresses along the path \(C\) is presented in Equation (11), where \(\dot{a}\) denotes the rate of change of curvilinear abscissa of curve \(c(a)\) and \(k_{1}\) is a tunable gain. \(\theta_{\mathrm{e}}(\mathrm{t})\) is the difference between the heading of point \(M\) and the tangent of point \(P(a)\) and is also considered as the heading error which is given in Equation (12). \[\dot{a}=k_{1}s_{FM}+\gamma cos(\theta_{s}-\theta_{1})-\dot{\theta}_{1}l\;sin( \theta_{s}-\theta_{1})-\dot{\theta}_{2}L_{2}sin(\theta_{s}-\theta_{2}) \tag{11}\]  
\[\theta_{e}=\theta_{2c}-\theta_{s} \tag{12}\]  
Now the objective is to find the location of point \(M\) relative to point \(P(a)\) in \(\{\mathrm{F}\}\) and denote the location as \((s_{FM},y_{FM})\) where \(y_{FM}(t)\) is the ordinate distance and is obtained by using frame transformations on point M. The following set of equations represent the velocity of point \(M\) solved in frame \(\{\mathrm{F}\}\). By integrating these set of equations, \(y_{FM}(t)\) is obtained and used in the tracking problem. \(\dot{s}_{FM}\) and \(y_{FM}\) are the velocity of point \(M\) calculated in the frame \(\{\mathrm{F}\}\), transformed using a direction cosine matrix in Equations (13) and (14), respectively. \(\dot{X}_{m}\) and \(\dot{Y}_{m}\) are the velocity of \(M\) in cartesian frame. \[\dot{s}_{FM}=(\dot{X}_{m}cos(\theta_{s})+\dot{Y}_{m}sin(\theta_{s}))-\dot{a}( 1-c(a)y_{FM}) \tag{13}\]  
\[\dot{y}_{FM}=(-\dot{X}_{m}sin(\theta_{s})+\dot{Y}_{m}cos(\theta_{s}))-\dot{a}c (a)\;s_{FM} \tag{14}\]  
To include the kinematics of the tractor and trailer system (tractor and trailer heading angles and the velocity of the system), further modifications can be made in Equations (13) and (14) by using trigonometric identities and combining Equations (1), (2), (7) and (8). The results of such modifications are presented in (15) and (16). \[\dot{s}_{FM}=vcos(\theta_{s}-\theta_{1})-\dot{\theta}_{1}l\;sin(\theta_{s}- \theta_{1}-\dot{\theta}_{2}L_{2}sin(\theta_{s}-\theta_{2})-\dot{a}(1-c(a)y_{ FM}) \tag{15}\]  
\[\dot{y}_{FM}=vsin(\theta_{s}-\theta_{1})+\dot{\theta}_{1}l\;cos(\theta_{s}- \theta_{1})+\dot{\theta}_{2}L_{2}cos(\theta_{s}-\theta_{2})-\dot{a}c(a)\;s_{ FM} \tag{16}\]  
Unlike [14; 15], the reference point is not the center of mass; it is a point on the trailer's axile. It is the path tracking controller's objective to lead the center of trailer's axile to the path by issuing required trailer's heading rate as a command.