Available online at www.sciencedirect.com
ScienceDirect IFAC PapersOnLine 50-1 (2017) 994–999
Cyclist’s Riding Style Assessment via Inertial Measurement Alberto Lucchetti ∗ , Matteo Corno ∗ , Sergio M. Savaresi ∗ ∗
Politecnico di Milano, Dipartimento di Elettronica, Informazione e Bioingegneria, via G. Ponzio 34/5, 20133 Milano (Italy). Email to:
[email protected]
Abstract: Bicycles are seen as a viable solution to a number of transportation problems: the use of bicycles alleviate congestion, reduce pollution and generally improve public health. In many congested cities, bicycles are the quickest means of transportation. The widespread use of bicycles, along with the exponential growth of electrically power assisted bicycles, could pose some safety issues related to reckless cycling. This paper presents an inertial measurement based approach to quantify and classify different riding styles. The bicycle velocity, longitudinal acceleration and angular rates are monitored to identify dangerous riding from three different perspective: longitudinal, vertical and lateral dynamics. In this way, it is possible to assign a number assessing the quality of each trip. The approach is developed using data collected from ad-hoc experiments and real-world data.
© 2017, IFAC (International Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved. Keywords: Human-factors, human-powered vehicles, single-track vehicles. 1. INTRODUCTION Bicycles are considered a viable solutions to a number of transportation issues. Thanks to their small footprint, they are ideal to reduce the traffic congestion in large metropolitan areas Organization et al. (2002), De Nazelle et al. (2011). In addition, they do not emit greenhouse gases. The introduction of electrically power assisted bicycles Corno et al. (2016a, 2015a, 2016b, 2015b) is promoting bicycles also among users that could or would not consider muscular bicycles as commuters vehicles (elderly, but also professionals). Unfortunately, bicycles offer little to no protection in case of accidents. Bicyclists, along with motorcycle riders, are among the most vulnerable road users. Most of the serious or deadly injuries are due to crashes with motorized vehicles. In 2013, in the US, there were 743 cyclists killed and an estimated 48,000 injured in motor vehicle traffic crashes Administration et al. (2013). Because of their vulnerability, cyclists ought to pay extra attention and ride in a very safe way. The issue of cycling style assessment is of particular pressing importance for fleet management, for which reckless cycling could represent a liability. Bicycle-based delivery services are becoming very popular in big metropolitan areas. They often remunerate cyclists based on the number of deliveries. This mechanism may incentivize unsafe behaviors; a possible solution could be the introduction of penalties for reckless behavior. This idea calls for a quantitative way of assessing performances. The number of deliveries is easily quantified; it is more difficult to do so for the cycling style. This paper proposes an inertial-based method to quantitatively assess the cyclist style, with particular focus onto penalizing dangerous or risky behaviors.
The problem of driving style assessment has been explored for four-wheeled vehicles. Systems for detecting dangerous behavior Liu et al. (2015), Lef`evre et al. (2012), driving under drug/alcohol effect Shinde et al. (2016), Dai et al. (2010) or more general driving classification Van Ly et al. (2013) have already been studied. Similar systems have also been presented for powered two wheelers (see for example Selmanaj et al. (2016) and Condro et al. (2012)). In the bicycle context, to the best of our knowledge, only observational studies are available: the influence of age and gender on reckless cycling is studied in Finch (1996), Vandenbulcke et al. (2009), Van den Bossche et al. (2007); Møller and Hels (2008) or intersection Landis et al. (2003) study the impacts on accidents of roundabouts and intersections. Some recent studies investigate risky situations during riding bicycle Vandenbulcke et al. (2014), Detzer et al. (2014). In all these studies, the authors did not focus on the need of a quantitative way of assessing the cycling style using objective data. The reduction of sensors cost, and the availability of an onboard power source, guaranteed by electrically power assisted bicycles, enables the adaptation of systems designed for cars to bicycles. This work proposes to use inertial sensors to classify and quantify dangerous maneuvers. Inertial sensors measure the state of the vehicle, but do not provide any information on the environment. This leads to a method capable of classifying dangerous maneuvers due to the cyclist’s behavior without being able to contextualize them (i.e. the cause of a dangerous maneuver is not investigated); nevertheless it provides a useful quantitative indication. We focus on three different sources of danger; they are associated with the longitudinal, lateral and vertical dynamics of the bicycle. We discuss their implication and provide penalty functions to quantify them. Finally,
2405-8963 © 2017, IFAC (International Federation of Automatic Control) Hosting by Elsevier Ltd. All rights reserved. Peer review under responsibility of International Federation of Automatic Control. 10.1016/j.ifacol.2017.08.205
Alberto Lucchetti et al. / IFAC PapersOnLine 50-1 (2017) 994–999
Speed
995
Strong Deceleration
ax ay az
Irregular Road
ωz
High Speed Cornering
Safety Index +
Fig. 2. Dangerous behaviour detection.
Fig. 1. The test vehicle and the rear hub. the developed procedure is validated on real-world cycling data. The article is organized as follows. In Section 2 we present the problem and experimental setup. Section 3 describes the detection and penalization of longitudinal hazardous behaviors. Section 4 presents and illustrates the vertical dangerous situations and Section 5 describes lateral maneuvers. Final results are presented in Section 6. 2. PROBLEM AND EXPERIMENTAL SETUP The bicycle described in Corno et al. (2016a, 2015a) is employed as a platform to develop the algorithm (see Figure 1). The bicycle is equipped with an all-in-one hub containing the motor, batteries electronics and sensors (wheel and pedal speed, and a 6 Degrees of Freedom Inertial Measurement Unit). The choice of using a solution with the inertial measurement unit in the hub affects the tuning of some of the thresholds, but the method is general and can be applied to other sensor architectures. The method is based on the identification of three main sources of danger associated with the cyclist’s behavior: • Longitudinal direction. The rationale is to penalize sudden changes of velocity. A strong acceleration is not considered critical because it is a (mainly) human-powered vehicle and the acceleration is limited by the rider’s strength. On the other hand, sudden decelerations are considered more dangerous either because they could lead to accidents or because they are indicative of a distraction (of the cyclists or of another road user). This is made more critical as bicycles are not equipped with a tail lamp. • Lateral direction. A tight corner at high speed limits the capability of the rider to respond to sudden events and may make it difficult for other road users to predict the rider’s intention. The system will thus penalize sudden tight corners. • Vertical direction. In general, it is not advisable to ride a bicycle on uneven or rough terrain at high speed. In those conditions, the rider may not be able to effectively evade an obstacle without loosing control of the vehicle.
Fig. 3. Longitudinal risky behavior penalization block. The method detects and quantifies these conditions based on wheel speed, the accelerations and the angular rates along the three axes. It is based on three independent processing blocks as shown in Figure 2. The structure of each block is similar: first the most relevant variables for that index are chosen; then an activation threshold is chosen, so that if the value of the variables is below the threshold the module is not active; finally a mechanism to provide a continuous weight, once the block is active, is designed. The final safety index can then be computed by summing the three partial indexes. In what follows the three blocks are described and tuned using ad-hoc experiments. 3. LONGITUDINAL DYNAMICS The idea of the longitudinal dynamics block is to penalize excessive decelerations only when those are performed at high speed; a sudden stop at walking speed is inherently less dangerous than a sudden stop from 25 km/h. The idea is implemented as described by the block diagram shown in Figure 3. Note that the longitudinal deceleration is computed through the rear wheel speed. This has two main advantages 1) it avoids biases caused by misalignments of the inertial measurement unit 2) it penalizes high wheel slip. An excessive tyre slip is extremely dangerous in singletrack vehicles Corno et al. (2015c). Because of the tyre slip dynamics, unstable slip is always preceded by high wheel deceleration. The tuning of the penalizing factor is based on a series of experiments carried out by different riders who were asked to perform and subjectively classify a number of braking maneuvers. Furthermore, they were explicitly asked to lock the wheel in some instances. The tests were performed on a closed track. The results are summarized in Figure 4. From the plot, one can see that by introducing a coupled acceleration-velocity function, it is possible to separate the safe from the unsafe maneuvers. Three different classification functions are investigated:
996
Alberto Lucchetti et al. / IFAC PapersOnLine 50-1 (2017) 994–999
40 Blocked Wheel Unsafe Braking Safe Braking
Speed [ km / h ]
30
20
(a) Pav´ e
(b) Sidewalk
(c) Street
10
Fig. 6. Different road sorface 0 -10
-9
-8
-7
-6
-5
-4
-3
-2
-1
Power of az Hp filt at 5 Hz
6
0
2
Acc [ m / s ]
pavé sidewalk street
Fig. 4. Acceleration and speed data of brake maneuvers. Green for safe braking, blue for unsafe and red for locked wheel.
Power of a z
5 4 3 2
40
30
Speed [ km / h ]
1
Blocked Wheel Unsafe Braking Safe Braking Linear Elliptical Quadratic
20
0 0
10
15
20
25
Speed [ km / h ]
Fig. 7. Different road surface power on different constant speed. A linear interpolation was applied to the three different surface.
10
0 -10
5
-9
-8
-7
-6
-5
-4
-3
-2
-1
0
2
Acc [ m / s ]
Fig. 5. Block diagram of strong deceleration penalty. (1) Affine function: y = mx + q. 2 2 (2) Elliptical function: xa2 + yb2 = d. (3) Quadratic function: ax2 + by 2 + cx + dy + e = 0. The tuned activation functions are represented in Figure 5. A few considerations are due: the simple linear function does not perfectly characterize maneuvers. In fact, it does not well penalize decelerations at very high speed. The elliptical and quadratic functions provide simular results. The former better fits the training data at high speed, while the latter works better at low speed. In the following, the elliptical function will be employed. Once the module is active, the continuous penalization function is computed as: 2 2 (1) Jdeceleration (t) = ax (t) /a2 + v (t) /b2 Note that the function also effectively penalize high speed cycling, as one would intuitively expect. Cycling in an urban environment at a speed higher than 35 km/h is not advisable. 4. VERTICAL DYNAMICS Traveling on uneven surfaces affects safety of single-track vehicles in two ways: 1) uneven roads lead to an overall lower grip of the tires (see Delvecchio et al. (2011)) and thus longer stopping distances and degraded maneuverability. 2) The vibrations are directly transferred to the handlebar affecting the comfort and reaction time of the cyclist. The vertical dynamics block aims at identifying the type of road the bicycle is traveling on. The penalty should also be weighted by the velocity: cycling on uneven surfaces at low speed is perfectly safe.
Fig. 8. Vertical dangerous situation penalization block diagram. The most direct available measurement on the road condition is provided by the vertical acceleration (see also Giubilato and Petrone (2012)). The proposed index is computed starting from the high pass filtered vertical acceleration and computing the power of the resulting signal: T 1 a2z (t) · dt (2) Paz = · T 0 where T is a time window to be tuned. This cost function is first computed at steady state on data obtained pedaling at different constant speeds on different road surfaces (see Figure 6). Figure 7 plots Paz for different roads and speeds. Note that in these tests, being at steady state, the effect of T is negligible. As it can be seen, both the type of road and cycling speed impact the computed index. By modifying (2), introducing a moving average, it is possible to provide a real time index that describes the combined effect of velocity and road irregularities; in this context, we found that a window of 1 second is long enough to provide a smooth index without introducing excessive lag. t 1 a2z (τ ) · dτ (3) irregularity (t) = · T t−T Once the instantaneous evaluation of the road irregularities is available, the penalty computation algorithm of Figure 8 can be implemented. As in the previous section, three different separation functions are considered: (1) Linear function: y = k.
Alberto Lucchetti et al. / IFAC PapersOnLine 50-1 (2017) 994–999
997
9 pavé sidewalk street linear bilinear iperbolic
8
45.4852
6 5 4
45.485 45.4848
3
45.4846
2
45.4844
1 0 0
5
Safe Unsafe
45.4854
Latitude [ ° ]
Road Irregularity
7
10
15
20
25
30
45.4842 9.262
9.2625
9.263
9.2635
9.264
9.2645
9.265
9.2655
Longitude [ ° ]
Speed [ km / h ]
(a) Route Speed [ km / h ]
Fig. 9. Separation function on experimental data. (2) Affine function: y = mv + q. (3) Hyperbolic function: y = atv+b cv+d .
5. YAW DYNAMICS
20 10 0 0
100
200
0
100
200
As in the previous sections, different tests were carried out to better quantify safe and unsafe riding from the cornering dynamics standpoint. A number of cyclists were tasked to perform corners (in a closed track - see Figure 10) classifying them as either safe (they felt perfectly comfortable in riding) or unsafe (they had to really focus on the maneuver).
400
500
600
300
400
500
600
[°/s] z filt
0
-100
Time [ s ]
(b) Data
Fig. 10. The route 10(a) and a detail of the yaw rate date 10(b) collected during the cornering experiment. Differently from the previous case, because of the dynamical nature of these maneuvers, a steady state analysis is not suitable. The classification is thus solved via a parametric optimization problem. The yaw rate threshold (k) is defined according to the following minimization problem. f (ωi , k) g (ωi , k)
min α i∈S k
The classification of safe and unsafe corners is based on the type of corner (how tight it is ) and the speed at which it is performed. The yaw rate well characterizes these features: a tight corner performed at low speed will yield a lower yaw rate than a wide bend performed at high speed. In fact, at steady state the yaw rate is related to both bicycle velocity and curvature radius: v (5) ωz = . R Note that in the above discussion, we referred to the inertial (or world) yaw rate, however the onboard IMU measures the body fixed yaw rate; they are related by (6) ωz,world = ωz,body sin (ϕ) . Bicycle riding is characterized by relatively small roll angles and thus the world yaw rate can be approximated by the body yaw rate (see also Corno et al. (2014)).
300
100
ω
The parameters of the activation functions are found based on two considerations: 1) All road surfaces should be considered safe (and thus not penalized) when ridden at a speed below 10 km/h. 2) Riding above 35 km/h should always be penalized. Figure 9 plots the resulting functions (along with the instantaneous irregularity index shows as function of velocity). It is clear that the linear activation function does not well characterize the safe region. The affine function does not scale well at high velocity; it would allow one to ride at high speed on an uneven road without penalties. The hyperbolic function more harshly penalizes riding on uneven roads at high speed, while at the same time it is more forgiving at low speed. For these reasons, the hyberbolic function defined in figure is employed as an activation threshold; once in the unsafe region, the actual penalizing factor is computed as: av(t) + b . (4) Jirregular road (t) = cv + d
Safe Unsafe
30
dim (S)
+ (1 − α)
i∈U
dim (U )
(7)
where α ∈ [0, 1] is a tuning weight, S is the set of the safe cornering and U of the unsafe one. The functions f (ωi , k) and g (ωi , k) are defined as follow: 1 | ωi |≥ k f (ωi , k) = (8a) 0 | ωi |≤ k 0 | ωi |≥ k . (8b) g (ωi , k) = 1 | ωi |≤ k Two values of α are chosen as representative of two different extreme cases: α = 0.77 is the lowest value of α for which all the unsafe curves are correctly identified as such, but also some safe corners are classified as safe; α = 0.99 is the lowest value of the parameter for which all the safe curves are classified as safe, but some unsafe corners are missed. The impossibility of finding a single α that separates the safe and the unsafe corner calls for a three yaw rate zones approach (see Figure 11). If the yaw rate is in the green area (below the threshold identified by α = 0.77), no penalty is given; the yellow region defines an uncertain zone where we start penalizing corners; the curves in the red region are definitely unsafe and should be harshly and sharply penalized. The block scheme of
998
Alberto Lucchetti et al. / IFAC PapersOnLine 50-1 (2017) 994–999
Fig. 11. Green = safe zone. Red = unsafe zone. Yellow = uncertainty zone
(a) Expert
Fig. 12. Lateral critical maneuver penalization block diagram. 45.488 45.486 45.484 45.482
Latitude [ ° ]
45.48 45.478 45.476
(b) Novice
45.474 45.472 45.47 45.468 9.195
9.2
9.205
9.21
9.215
9.22
9.225
9.23
9.235
9.24
9.245
Longitude [ ° ]
Fig. 13. Trip for evaluating the proposed algorithm. the lateral critical maneuvers penalization is presented in Figure 12. Given the above rationale, the most natural way of scaling the yaw rate, when above the first threshold, is through an exponential function: Jcornering (t) = a · eb·(|ωz |−k1 ) where k is the optimal value of the minimization problem (7) with α = 0.77 and a and b are tuning parameters. 6. VALIDATION The validation of the algorithm is carried out using data collected from 20 12-km runs in Milan (see Figure 13). The 20 cyclists were first classified in two groups for a total of 12 riders who are used to urban bicycle riding and 8 novice riders. The cyclists were tasked with cycling around the prescribed track without any further information on the goal of the test. Figure 14 plots the three dimensional representation of the three indexes for all tests. The two cyclists groups are shown in two different plots. From figure a few remarks are due:
Fig. 14. The expert 10(a) and novice 10(b) trend of indexes. (1) in the case of the expert cyclists, all the indexes, taken singularly reach a higher value than the ones of the novice riders. (2) the expert cyclists tend to engage more than one dynamics at a time. For example, they tend to decelerate more harshly even on uneven terrain and tend to decelerate while cornering. In the case of novice cyclists, the three indexes are never activated at the same time. Some statistical features of the results are summarized in Table 1. In general, expert users have a maximum value of penalization greater than the novice users, while mean value are similar, but the greatest differences is the number of time instant when the index is active. As expected, expert users are more inclined to do hazardous maneuvers. 7. CONCLUDING REMARKS In this work, we propose an algorithm to assess the cyclist’s riding style via Inertial Measurements. The algorithm focuses on three main dynamics: vertical (uneven road), longitudinal (sudden and harsh deceleration) and lateral (tight corners at high speed). The proposed algorithm is simple to implement and uses sensors normally available
Alberto Lucchetti et al. / IFAC PapersOnLine 50-1 (2017) 994–999
t Jlong > 0 [s] mean Jlong max Jlong t (Jvert > 0) [s] mean (Jvert ) max (Jvert ) t (Jlat > 0) [s] mean (Jlat ) max (Jlat )
Expert
Novice
89.03
13.37
18.16 3657.42 3176.39 0.82 10.15 145.26 0.11 4.36
1.99 17.70 2103.04 0.99 8.74 80.52 0.13 3.95
Table 1. Statistical results. on electrically assisted bicycles. The algorithm can be easily adapted (by changing filters and thresholds) to the case of a handle-bar mounted smartphone. The proposed algorithm is tested on real world data collected by different cyclistis. The proposed algorithm provides a way to quantitatively compare different trips and different riders. This, for example, can be used to rank different riders. REFERENCES Administration, N.H.T.S. et al. (2013). Bicyclists and other cyclists traffic safety fact sheet. DOT HS, 812151. Condro, N., Li, M., and Chang, R. (2012). Motosafe: Active safe system for digital forensics ofmotorcycle rider with android. International Journal of Information and Electronics Engineering, 2(4), 612. Corno, M., Berretta, D., and Savaresi, S. (2015a). Human machine interfacing issues in senza, a series hybrid electric bicycle. In American Control Conference (ACC), 2015, 1149–1154. doi:10.1109/ACC.2015.7170888. Corno, M., Berretta, D., Spagnol, P., and Savaresi, S.M. (2016a). Design, control, and validation of a chargesustaining parallel hybrid bicycle. IEEE Transactions on Control Systems Technology, 24(3), 817–829. doi: 10.1109/TCST.2015.2473821. Corno, M., Giani P., Tanelli, M., and Savaresi (2015b). Human-in-the-loop bicycle control via active heart rate regulation. IEEE Transactions on Control Systems Technology, 23(3), 1029–10140. Corno, M., Panzani, G., and Savaresi, S.M. (2015c). Single-track vehicle dynamics control: State of the art and perspective. IEEE/ASME TRANSACTIONS ON MECHATRONICS, 20(4), 1521–1532. Corno, M., Roselli, F., and Savaresi, S.M. (2016b). Bilateral control of senza–a series hybrid electric bicycle. IEEE Transactions on Control Systems Technology, PP(99), 1–11. doi:10.1109/TCST.2016.2587243. Corno, M., Spagnol, P., and Savaresi, S.M. (2014). Road slope estimation in bicycles without torque measurements. Proceedings of the 19th IFAC Word Congress, 6295–6300. Dai, J., Teng, J., Bai, X., Shen, Z., and Xuan, D. (2010). Mobile phone based drunk driving detection. In Pervasive Computing Technologies for Healthcare (PervasiveHealth), 1–8. IEEE. De Nazelle, A., Nieuwenhuijsen, M.J., Ant´ o, J.M., Brauer, M., Briggs, D., Braun-Fahrlander, C., Cavill, N., Cooper, A.R., Desqueyroux, H., Fruin, S., et al. (2011). Improving health through policies that promote active travel: a review of evidence to support integrated health
999
impact assessment. Environment international, 37(4), 766–777. Delvecchio, D., Spelta, C., and Savaresi, S. (2011). Estimation of the tire vertical deflection in a motorcycle suspension via kalman-filtering techniques. In Control Applications (CCA), 2011 IEEE International Conference on, 532–537. IEEE. Detzer, S., Junghans, M., Kozempel, K., and Saul, H. (2014). Analysis of traffic safety for cyclists: the automatic detection of critical traffic situations for cyclists. WIT Transactions on the Built Environment, (138). Finch, C.F. (1996). Teenagers’ attitudes towards bicycle helmets three years after the introduction of mandatory wearing. Injury Prevention, 2(2), 126–130. Giubilato, F. and Petrone, N. (2012). A method for evaluating the vibrational response of racing bicycles wheels under road roughness excitation. Procedia Engineering, 34, 409–414. Landis, B., Vattikuti, V., Ottenberg, R., Petritsch, T., Guttenplan, M., and Crider, L. (2003). Intersection level of service for the bicycle through movement. Transportation Research Record, (1828), 101–106. Lef`evre, S., Laugier, C., and Iba˜ nez-Guzm´an, J. (2012). Evaluating risk at road intersections by detecting conflicting intentions. In Intelligent Robots and Systems, 4841–4846. IEEE. Liu, P., Kurt, A., Redmill, K., and Ozguner, U. (2015). Classification of highway lane change behavior to detect dangerous cut-in maneuvers. Møller, M. and Hels, T. (2008). Cyclists perception of risk in roundabouts. Accident Analysis & Prevention, 40(3), 1055–1062. Organization, W.H. et al. (2002). A physically active life through everyday transport with a special focus on children and older people and examples and approaches from europe. Selmanaj, D., Corno, M., and Savaresi, S.M. (2016). Hazard detection for motorcycles via accelerometers: A selforganizing map approach. IEEE Transactions on Cybernetics, PP(99), 1–12. doi:10.1109/TCYB.2016.2573321. Shinde, S.B., Sinha, S., Kumar, S., and Vanjire, S.S. (2016). Rash driving detection system. Imperial Journal of Interdisciplinary Research, 2(3), 118–121. Van den Bossche, F., Wets, G., and Brijs, T. (2007). Analysis of road risk by age and gender category: time series approach. Transportation Research Record, (2019), 7–14. Van Ly, M., Martin, S., and Trivedi, M.M. (2013). Driver classification and driving style recognition using inertial sensors. In Intelligent Vehicles Symposium, 1040–1045. IEEE. Vandenbulcke, G., Thomas, I., and Panis, L.I. (2014). Predicting cycling accident risk in brussels: a spatial case-control approach. Accident Analysis & Prevention, 62, 341–357. Vandenbulcke, G., Thomas, I., de Geus, B., Degraeuwe, B., Torfs, R., Meeusen, R., and Panis, L.I. (2009). Mapping bicycle use and the risk of accidents for commuters who cycle to work in belgium. Transport Policy, 16(2), 77–87.