Accident analysis results show that 15–17% of all motorcycle accidents occur when negotiating a curve, [2]. The Curve Warning was thus designed to detect incorrect, insufficient or missing rider action in these situations and to warn him unobtrusively but effectively by suggesting a more appropriate action for correct longitudinal control of the vehicle. A typical scenario is shown in Fig. 1: the PTW vehicle travels on a road with curves and possible danger (hot spots, pedestrian crossings, etc). In this situation, the CW aims to help the rider to positively and safely negotiate the road ahead.
The CW function calculates, at a frequency of 5–10 cycles per second, a reference “optimalsafe” manoeuvre by predicting speed and roll patterns, processing digital maps, inertial measurement and GPS information. Compared with existing systems, the CW function presented is not based on a set of heuristic rules, nor does it refer to the legal or to any assumed speed constraint. The CW function is an example of advanced holistic techniques for optimal nonlinear control [9] which accounts for many aspects of motorcycle dynamics and scenario characteristics.
The reference manoeuvre is calculated, at a frequency of 5–10 cycles per second, with a dynamic optimization approach [10], which includes:

an appropriate mathematical model of the PTW vehicle dynamics;

the current dynamic state of the PTW;

a model of the road geometry and attributes;

the pattern of rider acceleration and target state at the end of the preview horizon.
The function recognizes inadequate rider manoeuvres from the correction of the motorcycle longitudinal dynamics with respect to the forecast manoeuvre. Based on this a Curve Warning Index that rates the risk level for negotiating the road ahead is calculated which is used to properly warn the rider with a predefined set of HMI devices.
2.1 Mathematical formulation
Calculation of the safeoptimal preview manoeuvre stems from the solution of an optimal control problem that reads as follows: for a given state space model of the vehicle
where x are the state variables and u are the vehicle controls, find the preview control history u (e.g. brakes, throttle and steering) that minimises a given cost function J (e.g. a combination of riding comfort, distance travelled, etc.) for a given preview time T:
subject to imposed initial conditions on all state variables
on final condition of selected state variables
and inequality constraints (i.e. physical limits):
The solution of such a problem not only gives the control history u(t) but also the whole preview motion x(t) of the vehicle (i.e. trajectory, velocity, roll angle, etc.). The optimal motion predicts how to guide the vehicle smoothly from the current state x_{0} to a final steady state motion. The preview motion x(t) also minimises the goal function and keeps, as much as possible, the vehicle state within the safety margin defined by the cost function and inequality constraints.
A specific dynamic optimization algorithm has been developed to solve numerically the resulting non linear system of equations in real time. More details on the adopted approach and numerical algorithm can be found in [10].
2.1.1 Dynamic model of the PTW vehicle
Since the calculation of the safeoptimal preview manoeuvre is time demanding but the Curve Warning system must work in real time, an essential, optimized model of the PTW vehicle was developed as described here.
The riding task is quite complex, however in a simple description the longitudinal and lateral dynamics of the vehicle may be considered uncoupled. The rider controls the longitudinal dynamics using throttle and brakes: the most relevant output is the vehicle speed. He controls the lateral dynamics using the handlebar (and secondarily by torso movements): the most relevant output is the vehicle heading. Based on these considerations, the simplest model that captures the essential motorcycle dynamics is a rigid body controlled in terms of speed and yaw rate and free to roll. In particular, if one imagines this model as a rolling wheel of proper size and inertia, the proposed basic model includes gyroscopic effects and tire shape features that are important in motorcycle dynamics, as is well known (Fig. 2).
The statespace model of the rolling wheel is the following:
where the longitudinal speed u_{
x
} and the yaw rate are the model input and the roll angle φ and roll rate are the state variables. Inspection of the first Eq. 1 reveals that the roll rate depends on gravity and centripetal acceleration (1st row), the gyroscopic effect (2nd row), and tire cross section (3rd row).
As discussed above, the basic PTW model can be controlled by the longitudinal speed and the yaw rate; but for smoother motion and better description of riding style, where both reflect human control attitudes [11–13], it is convenient to control the vehicle through jerk (i.e. time derivative of acceleration) instead of speed. Therefore, four additional state variables and equations are introduced as follows:
The road geometry can be synthetically and effectively described using the curvilinear coordinates approach. As shown in Fig. 1, the road centreline may be completely defined by assigning the road curvature κ as a function of the road length s, and the position and orientation of the vehicle can be defined using its position s along the route, the distance n from the road center and orientation α relative to the road direction. This description leads to the following state space model (Fig. 3):
Summarizing, the state space model (1) is composed of Eqs. 6, 7 and 8 for a total of nine state variables and two inputs
2.1.2 Cost functions, constraints and boundary conditions
From the rider’s point of view a safeoptimal preview manoeuvre has to satisfy several requirements with a fair margin to cope with possible inaccuracies of the knowledge of their exact values, and must:

a.
be consistent with dynamics;

b.
satisfy tire adherence limits;

c.
stay within the road lane;

d.
have steady state motion as the target state at the final preview horizon, guaranteeing motorcycle stability and large manoeuvrability margins if some future, unexpected action is needed (e.g. stop the vehicle, abruptly change direction);

e.
if above requirements are satisfied, promote riding comfort and speed.
All these specifications were translated into a mathematical formulation as follows.
Requirement a) was already translated into the state space PTW model (1) along with the imposition of initial conditions (3) according to the real vehicle state.
Requirement b) for evaluation of tire forces was translated into an equivalent constraint of type [7] on vehicle longitudinal and lateral acceleration that must remain inside an ellipse of diameters , i.e.
Requirement c) translates to a pair of simple inequalities:
where b_{
R
} and b_{
L
} are the lane width respectively on the right and on the left with respect to the road centre that may change with s.
Requirement d) translates into final conditions (4) on the following selected state variables:
which corresponds to steady state motion with null roll rate and longitudinal acceleration, with the vehicle at the centre of the lane, whereas the final values of roll angle and yaw rate are automatically computed consistent with final forward velocity and road curvature.
A first difficulty in including comfort requirements is to define an objective index which quantifies what comfort is for a rider. As a starting point, experimental evidence shows that in normal driving, lateral and longitudinal acceleration values fall within a diamond shape [4, 14], as shown in Fig. 4. The envelope of this pattern was assumed to be the “rider capability envelope” as it encloses the set of states that the rider considers comfortable; moreover this envelope can be easily parameterized to comply with different classes of riders and riding styles. Additionally, many studies show that the rider’s command rate of change is limited and occurs at constant jerk [11].
Finally, comfort requirements e) have been introduced into the cost function as follows
where W_{
a
} is the acceleration envelope function and W_{
j
} is jerk envelopment function, as shown in Fig. 5. The additional term was introduced to promote speed, whenever other requirements are satisfied.
Finally, it is worth noting that comfortable accelerations are fractions of maximum accelerations related to tyre adherence, and therefore are always within safety limits.
2.1.3 Safeoptimal preview manoeuvre calculation
Further steps are necessary to perform dynamic optimization of the preview manoeuvre, as explained in detail in reference [10]. Essentially, the time domain mathematical model is converted into a space domain model with the curvilinear abscissa s as the new independent variable and the inequality constraints (5) are converted into penalties to be added to the cost function (12). Both these operations drastically improve the computational efficiency of the optimization algorithm. Finally, Lagrange’s approach is used to derive the coequations of the nonlinear optimization problem; the resulting Boundary Value Problem is solved with a specific numerical solver working in real time.
2.2 Exemplary use of operation
To better understand the CW concept let us describe how it works under ideal conditions, i.e. when the motorcycle is approaching a curve ahead as illustrated in Fig. 1. Based on real road geometry and the current vehicle state the CW function computes a preview of the evolution of vehicle dynamics (i.e. velocity, lateral and longitudinal acceleration, roll angle etc.) at the maximum speed compatible with the fixed safety and comfort requirements. Figure 6 shows respectively a) the speed and b) the acceleration profiles calculated from their given initial values. Figure 6a shows that the preview speed initially increases (due to the initial acceleration), then decreases and reaches its minimum in the middle of the curve and finally it increases again at the curve exit.
The calculated preview manoeuvre is just one among the possible paths round the curve ahead and in particular it represents the fastest manoeuvre that complies with the given specifications for safety and comfort. Therefore, if the rider is actually riding faster, or accelerating more than the preview manoeuvre, he/she is potentially in danger and the CW provides a warning. The potential dangerous behaviour is identified on the basis of preview jerk (i.e. the time derivative of the acceleration, Fig. 6c: as the jerk becomes more negative, the urgency of reducing acceleration (or decelerating even more) increases, therefore two jerk thresholds have been selected for cautionary and imminent warning. As the essence of the preview concept, the first instants of the manoeuvre are strongly influenced by what is next; therefore it is sufficient to examine first values of jerk to suggest what the rider should do now to be in a safer condition later. So, a major benefit of this approach for risk evaluation is that it can provide early warning, e.g. 2–3 s before entering the curve, leaving the rider time to react and correct his behavior.
We note that the warning strategy based on jerk evaluation does not only recognize a possible danger situation, but also evaluates the mismatch between rider action and system plans, to produce a warning only when there is potential danger and when the rider has not yet seen it. Indeed, in a reference scenario where the rider is at a certain speed and there is a curve ahead, if the vehicle acceleration is null (or even positive), most likely the rider should be warned; on the contrary if the vehicle is decelerating most likely the rider need not be warned because he is aware of the situation and does not need or want a redundant message. The CW is capable of distinguishing between these situations: in the first case a negative, possibly high, jerk arises in the preview manoeuvre and a warning is delivered, on the contrary in the second situation the preview manoeuvre will be much smoother, with no such negative jerk and hence no warning.
As the rider’s behaviour differs from preview manoeuvres, these must be continuously updated to real speed and acceleration, as also to changing road scenario conditions (e.g. road geometry). Consequently as the vehicle approaches the curve, a sequence of manoeuvres is computed as fast as possible (where “fast” is limited by available hardware). Figure 7 shows a rider at constant speed, too high for the next curve. When the curve is at 180 m, no danger is foreseen because there is still time to reduce speed, but as the distance decreases to 60 m, the system warns the rider. Since there are still 2.5 s before the curve, he/she is still in time to decelerate.