key: cord-0220772-ec4jgthy authors: Sweeney, Shaun; Lhachemi, Hugo; Mannion, Andrew; Russo, Giovanni; Shorten, Robert title: Pitchfork-bifurication-based competitive and collaborative control of an E-bike system date: 2021-09-23 journal: nan DOI: nan sha: 1a020b66c4d360aef5fd84464b959791be115f06 doc_id: 220772 cord_uid: ec4jgthy This paper is concerned with the design of a human-in-the-loop system for deployment on a smart pedelec (e-bike). From the control-theoretic perspective, the goal is not only to use the power assistance of the e-bike to reject disturbances along the route but also to manage the possibly competitive interactions between a human and the motor intervention. Managing the competitive/cooperative nature of the interactions is crucial for applications in which we wish to control physical aspects of the cycling behavior (e.g. heart rate and breathing rate). The basis of the control is a pitchfork bifurcation system, modeling the interactions, augmented using ideas from gain-scheduling. In vivo experiments have been conducted, showing the effectiveness of the proposed control strategy. Over the last few years, electric bikes have become an increasingly popular mode of transportation across many jurisdictions (Crisostomi et al., 2017) . Key reasons for this trend include the fact these e-bikes are environmentally friendly, enable the design of shared transportation services (Crisostomi et al., 2020) , thus alleviating the stress on more conventional transportation modes caused by the enormous challenges currently faced by urban areas (Seto An early version of the results presented here were reported, without proofs and experimental evidences of competitive/cooperative scenarios, at the 2019 IEEE 58th Conference on Decision and Control (Mannion et al., 2019) . Sweeney and Lhachemi are joint first authors. Russo and Shorten are joint last authors. Email addresses: s.sweeney21@imperial.ac.uk (Shaun Sweeney), hugo.lhachemi@centralesupelec.fr (Hugo Lhachemi), andrew.mannion@ucdconnect.ie (Andrew Mannion), giovarusso@unisa.it (Giovanni Russo), r.shorten@imperial.ac.uk (Robert Shorten). et al., 2012) . Indeed, the benefits of convincing citizens to transition from cars to e-bikes, include reduced noise and particle emissions from road vehicles, as well as reduced road and parking congestion. Moreover, the electric motor on the e-bikes can assist cyclists in completing their journeys, thus helping to overcome the traditional barriers to active transportation of age, topology and wind. Indeed, an impact of the Covid-19 pandemic is that the e-bike revolution is likely to further accelerate as consumers shy away from modes of public transportation due to virus-angst. A further advantage of e-bikes over competitors such as e-scooters is not only the active component of the travel, but also that they respect the separation between pedestrian and road users; simply put, cycling is not ever tolerated on footpaths, whereas social conventions appear to tolerate the use of high power scooters in pedestrian zones. E-bikes are very attractive, not only due to the electrical assist that can be used to make cycling easier for the cyclist, but also because the presence of a battery offers a host of opportunities to develop services that can be used for benefit of cyclists. and even other road users. Examples of such services include collaborative sensing applications to make cycling safer for cyclists, applications to promote circularity in the use of the e-bike, triage applications to assist emergency services, and applications to protect other vulnerable road users (such as pedestrians). From a control perspective, the electric motor offers a really exciting actuation possibility. Not only can be this be used to reject disturbances (wind, hills), but also to provide new services to the cyclist. These range from basic routing services to avoid e.g. polluted areas and minimize travel time Y. Lassoued et al., 2017) , but the battery can be used to provide more advanced actuation services such as nudges designed to manage how the e-bike power-assist can modify the cyclist behavior during his/her trip. These latter applications classes are challenging for a number of reasons. Consider, for example, the problem of designing a control algorithm able to regulate the ventilation rate of the cyclist in areas of elevated pollution . To achieve this, the algorithm will need to judiciously orchestrate electric assistance. However, since this reduces the load on the cyclist, their natural instinct may be to increase cycling effort, thereby possibly increasing his/her ventilation rate and hence missing the control goal. Thus, in order to avoid this situation, the control must be designed to account for situations where the cyclist can compete with the motor. Hence, a key control-theoretical challenge is that the actuation provided by the e-bike not only needs to handle disturbances associated to e.g. the topology of the route but it also needs to handle the interaction with the cyclist, which can be both competitive and cooperative. Motivated by this, we present here a human-in-the-loop control system for e-bikes that is able to manage the interactions between a human and a motor intervention, for applications in which we wish to control physical aspects of the cycling behavior. In particular, our objective is to develop a gain-scheduling cyberphysical control system (Leith and Leithead, 2000; Rugh and Shamma, 2000) that manages such an interaction between the cyclist and the electrical motor. We now briefly survey some related works. Existing literature on e-bikes is mainly devoted to their energy management. Interestingly, as noted in (Guanetti et al., 2017) most hybrid electric bicycles on the market determine the level of assistance without explicitly accounting for energy efficiency and/or human behavior. Recent works such as (Wan et al., 2014; Fayazi et al., 2013) , presented an offline approach to compute optimal pacing by taking into account muscolar fatigue. We also recall here (Spagnol et al., 2013b (Spagnol et al., ,a, 2012 which are focused on the design of an online energy management strategy for full hybrid electric bicycles (also experimentally validated). More recently, a control based, energy management system for series hybrid electric bicycles is presented in (Guanetti et al., 2017) , although without consideration of the competitive interaction between cyclist and the electrical motor system. In a broader context, the development of e-bike services are presented in a number of publications; see (Smaldone et al., 2011; Kiefer and Behrendt, 2015) , as well as the the work carried out as part of the Copenhagen-Wheel project at MIT, and the recent paper from IBM Research (Andres et al., 2018) . Other services that can be enabled by e-bikes leverage the fact that these can be used for crowdsourcing (Russo, 2021) applications (for example pollution and/or routes monitoring), and to provide other services to municipalities, pedestrians, and road users, in exchange for monetary reward (for example, mobile wifi hubs); see (Cogill et al., 2014) . Further, in many of contemporary e-bikes, the battery can be large -up to 500 Whrs. Thus, when aggregated together, groups of batteries can provide energy buffering services to both infrastructure and citizens alike (Ferraro et al., 2018) . Our work is also related to the rich body of work on the design of cyber-physical systems, that is the subject of much interest in the control engineering community. For context, we refer the interested reader to the the recently published paper on human-in-theloop control systems (Inoue and Gupta, 2019) and the excellent recent review paper (Musić and Hirche, 2017) . We note briefly that while conceptually the work presented here is related to this latter body of work, the competitive/cooperative nature of the control is a somewhat unique feature of the problem class considered in this paper. Perhaps, as such, our work is most related to the stabilisation of interacting unstable systems discussed by Narendra (Narendra and Harshangi, 2015) and the agent coexistence problems discussed in the networking community (Budzisz et al., 2011) ; our solution owes much inspiration to these latter two works. We also note that the work presented in this paper builds on our work presented in . In this work an e-bike design is presented, as well as a holistic control strategy (without proofs) managing the interaction between the cyclist and the e-bike motor. In this paper we present a human-in-the-loop control system for an e-bike that is able to manage the competitive/cooperative nature of the interactions between a cyclist and the e-bike. To the best of our knowledge, this is the first control system for e-bikes that explicitly takes into account the possibly non-cooperative nature of humans when provided with power assistance from the e-bike. We present a control system based on the use of gain-scheduling and prove a number of closed-loop properties. While the work presented in this paper builds on , in the latter work we only presented a principled control design, without giving any guarantees on its closed-loop performance. In the context of the above literature, our contributions can be summarized as follows: • we present a novel control algorithm to manage the interactions between the cyclist and the e-bike. The key idea behind the algorithm, which is also a technical contribution of this paper, is based on the use a full non-linear gain scheduling (Leith and Leithead, 2000; Rugh and Shamma, 2000) design based on a pitchfork bifurcation. As we shall see, this leads to the design a control system that can handle a full envelope of operating conditions; • we prove certain properties of the closed-loop system. In particular, we give a rigorous assessment of the robustness and tracking performance (in a sense specified in Section 3); • we investigate the effectiveness of the closed-loop system via in-vivo experiments. Namely, with the experiments, we test the design on a real e-bike in a controlled set-up. We use the infrastructure from , which is described here for completeness. The e-bike that we use is a modified BTwin Original 700 purchased from Decathlon (see Figure 1 ). While the original e-bike was equipped with a Samsung Li-ion 36V battery and a Bafang controller, we modified it in several ways: • in order to facilitate the actual design and implementation of the control algorithm, we replaced the original motor controller with the Grinfineon C4820-GR. This appeared to be a more advanced controller hardware, suitable for our purposes; • several measurement sensors were added to the e-bike. These additional sensors were aimed at measuring pedal torque/speed using a THUN X-CELL RT sensor 1 ), battery voltage, motor current, wheel speed, motor temperature. We also included in the design brake and hand throttle sensors. We also developed the hardware and software infrustructure to process the data from sensors. In particular, all the sensors were read by either an Arduino (brake and hand throttle sensors) or by an off-the-shelf computer system. In the experiments, we used the Cycle Analyst 2 to retrieve the data from the sensors. In both cases, data would be communicated to a smartphone app (that we also designed) using a bespoke especially designed Arduino-controlled Bluetooth module. Control inputs were sent to the e-bike controller using the same Bluetooth based communication system. Moreover, in order to guarantee reproducibility of our experimental set-up, we decided to perform tests in a controlled environment that would allow to reproduce all the operating conditions described in Section 4. In this section, we describe the control strategy adopted in this work. First, we present a simple model of the e-bike power-generation process. Second, we discuss the necessity of a human-in-the-loop-based design of the control strategy for fostering a cooperative behavior of the cyclist. Third, the basic idea used to realise such a control design is presented. Finally, the fully functional gain-scheduling control design procedure is introduced and theoretical analysis of the design presented. In the sequel, R + and R * + denote the sets of non-negative real and positive real numbers, respectively. For any given connected set S ⊂ R n and any interval I ⊂ R, C 0 (S; I) denotes the set of functions g : S → I that are continuous. Similarly, C 1 (S; R) denotes the set of functions g : S → R that are continuously differentiable. As in we make the two following assumptions. First, we can neglect any dynamics associated with the e-bike's electric motor (motor in short). Second, we consider a fixed mechanical gear setting. The first instantaneous input power to be considered is from the motor to the bike P M in (t). The control input to the motor is denoted by Y (t) and is related to the motor current I M (t) via I M (t) = µY (t) where µ > 0 is a constant. Introducing V M the motor voltage, the power delivered by the motor is given by P M in (t) = V M I M (t). The second instantaneous input power to be considered is from the human to the bike P H in (t). It is expressed as P H in (t) = τ p (t)ω p (t) where τ p (t) represents the torque provided by the cyclist at the pedal and ω p (t) is the angular velocity at pedals. Introducing E m ∈ (0, 1) and E c ∈ (0, 1) the efficiency of the motor and the crankset, respectively, the output motor power and output human power are given by P M out (t) = E m P M in (t) and P H out (t) = E c P H in (t), respectively. Thus, the total power available to move the rear wheel can be approximated as P w (t) = P M out (t) + P H out (t). The control objective is to regulate the fraction of effort delivered by the human. For example, such a control strategy is important to control the transpiration or the ventilation rate of the cyclist. To achieve such a control objective, we introduce the proportion m ∈ [0, 1] of power provided by the cyclist: . (1) A value of m(t) close to 0 indicates that the system is essentially in electric mode while a value of m(t) close to 1 means that most of the power is delivered by the human. For a given desired value m * ∈ [0, 1], the control objective is that m achieves the setpoint tracking of m * . Note that the configuration m = 0 with P H out = 0 and P M out > 0 corresponds to a full electrical mode and is undesirable as it would transform the e-bike into a motorbike, which is illegal in some jurisdictions. Therefore, we assume the existence of a constant η ∈ (0, 1) such that m * (t) ∈ [η, 1] for all t ≥ 0. In practice, the direct use of the quantities P M out (t) and P H out (t) is not adequate because of biases, uncertainties in the system operation, and the stochasticity of the cyclist behavior over short period of time (such as sudden speed variations over short distances). Consequently, the direct control of m defined by (1) can be counterproductive as it might lead to a very erratic control effort Y . This would result in a very erratic power delivery of the motor P M out , inducing safety issues and a lack of comfort for the cyclist. Consequently, we introduce the following filtered version of the proportion m ∈ [0, 1] of power provided by the cyclist: where P H out and P M out are the corresponding filtered and averaged versions of P H out and P M out (see (Sweeney, 2017) for details). In this setting, the control objective remains that m should track a given reference value m * . For notational simplicity, P H out and P M out are simply denoted by P H out and P M out in the sequel. Denoting by ∆T the sampling time and introducing the regulation error e k = m * (k∆T ) − m(k∆T ), it was proposed and implemented in the following discrete time (with zero order holder) integral controller: where Y k = Y (k∆T ) and γ > 0 is a proportional gain. The validity of this approach was assessed in by means of experiments. However, it does not fully account for the human-in-the-loop aspect of the problem, i.e., the complex interactions between the cyclist and the motor. Specifically, a decrease of the value of the reference m * should reduce the workload of the cyclist by decreasing accordingly the value of m. However, due to this reduction of the workload on the cyclist, their instinct may be to increase cycling effort, which is the opposite of the original objective. Consequently, the control strategy must consider the possibility of such an uncooperative behavior of the cyclist by progressively switching-off the motor. As suggested in , one approach for tackling this problem consists in the following control strategy:Ṗ which is the normal form of a supercritical pitchfork bifurcation (Kuznetsov, 2013) . The function f is designed based on engineering considerations such that f (0) = 0 and f (x) > 0 for any x > 0. The motivation behind the use of (4) is to regulate the interaction between the cyclist and the motor. • When P H out = 0, we have f (P H out ) = 0. Hence the only equilibrium point of (4) is P M out = 0, which in turn is globally asymptotically stable. That is P M out → 0 when t → +∞, whatever the initial condition P M out (0) ≥ 0 is. • Whenever 3 P H out (t) = P H out ,e > 0, the origin of (4) becomes unstable and the new stable equilibrium P M out ,e = f (P H out ,e ) appears. In this case, P M out converges to P M out ,e as t → +∞, whatever the initial condition P M out (0) > 0 is. In this context, the shape of the function f is tuned such that the motor assists the cyclist. Specifically, m tracks m * as long as P H out is below a given threshold P T > 0, while the motor is gradually switched off when P H out > P T . The graph of such a typical function f is depicted in Fig. 2 . The control law adopted in this paper takes the following form:Ṗ with α m * (P H out ) > 0, f m * (0) = 0, and f m * (P H out ) > 0 for all P H out > 0. Functions (P H out , m * ) → f m * (P H out ) and (P H out , m * ) → α m * (P H out ), that are selected in C 0 (R + × [η, 1]; R + ), must be tuned in function of m * ∈ [η, 1]. The former aims at capturing the desired trade-off between cooperative and competitive behaviors of the cyclist, while the latter is for the tuning of the speed of convergence of the control strategy. The function (P H out , m * ) → f m * (P H out ) is tuned such that, for any constant reference input m * and any equilibrium value P H out ,e ≤ P T (m * ), we have at the equilibrium that m * = m e = P H out ,e P M out ,e + P H out ,e = P H out ,e f m * (P H out ,e ) + P H out ,e . In this work, this is achieved by defining for P H out ≤ P T (m * ): and for P H out > P T (m * ): where γ > 0 is the exponential decay rate for the competitive scenario. P T (m * ) > 0 denotes the threshold associated with the current value of the reference signal m * ∈ [η, 1]. In other words, for a given value of m * , P T (m * ) > 0 stands for the maximum value of the effort provided by the cyclist that is considered as a cooperative behavior. For large values of m * (i.e., close to 1), the cyclist should be able to modulate freely his effort. Therefore, the corresponding value of the threshold P T (m * ) should be large enough. Conversely, the effort of the cyclist should be constrained when m * is close to the lower bound η. So, in this case, the value of the threshold P T (m * ) should be reduced. Thus, we select m * → P T (m * ) as an element of C 0 ([η, 1]; R * + ) ∩ C 1 ([η, 1]; R) satisfy-ingṖ T > 0, i.e., is a (strictly) positive and increasing function of the reference value m * ∈ [η, 1]. Thus, it is easy to see that We now tune the function (P H out , m * ) → α m * (P H out ) to tune the convergence rate of the control law. To do so, assuming a constant reference signal m * , we resort to the following Jacobian linearization of the controller dynamics (5a) in the vicinity of the equilibrium point P M out ,e = f m * (P H out ,e ): δṖ M out = −2α m * (P H out ,e ) f m * (P H out ,e )δ P M out . In order to impose a constant convergence rate κ > 0 in the vicinity of any equilibrium point, we select α m * (P H out ) = κ/(2 f m * (P H out )) > 0 which yields δṖ M out = −κδ P M out . However, for either small or large values of P H out , f m * (P H out ) is getting arbitrarily close to zero and thus induces the divergence of α m * (P H out ). To avoid this pitfall, we introduce a threshold ε T > 0 and set α m * = κ/(2ε T ) for any P H out satisfying f m * (P H out ) ≤ ε T . Thus, we obtain that α m * (P H out ) = κ/(2 max( f m * (P H out ), ε T )) > 0 which is bounded above by the constant κ/(2ε T ). In order to validate the proposed controlled strategy, we derive in this section a tracking performance of m with respect to the reference signal m * . We introduce 4 and, for any constants P H,M > P H,m > 0, we define 5 We can now state the following result dealing with the maximum amplitude of the power delivered by the motor for a suitable range of admissible initial conditions P M out ,0 . Lemma 1 Let P M out ,0 ∈ [0, C f ], P H out ∈ C 0 (R + ; R + ), and m * ∈ C 0 (R + ; [η, 1]) be given. The unique maximal solution P M out of (5a-5b) is defined over R + and satisfies P M out (t) ∈ [0, C f ] for all t ≥ 0. Proof. As t → α m * (t) (P H out (t)) and t → f m * (t) (P H out (t)) are bounded, it is easy to see that the vector field associated with (5a) is locally lipschitz in P M out , uniformly in t ≥ 0. Thus, the Cauchy-Lipschitz theorem (Khalil and Grizzle, 2002) ensures the existence of a unique maximal solution P M out , defined over [0,t M ) with 0 < t M ≤ +∞, associated with the initial condition P M out ,0 . Noting that P M out = 0 is the unique solution of (5a-5b) associated with the zero initial condition, we immediately 4 It can be easily seen from the definition of f m * (P H out ) that C f < +∞ by using the fact that 0 < P T (η) ≤ P T (m * ) ≤ P T (1) < +∞ for all m * ∈ [η, 1] and that xe −ax ≤ e −1 /a for all x ≥ 0 and a > 0. 5 c f (P H,M , P H,m ) > 0 because it is defined as the infimum over a compact set of a continuous function that is (strictly) positive. deduce that P M out (0) ≥ 0 implies P M out (t) ≥ 0 for all t ∈ [0,t M ). Let ε > 0 be arbitrarily given. We prove by contradiction that sup As P M out (0) ≤ C f , a continuity argument shows that t 0 > 0 and P M out (t 0 ) = C f + ε. From (5a), we obtain thaṫ where the inequality holds true because α m * (t 0 ) (P H out (t 0 )) > 0 and f m * (t 0 ) (P H out (t 0 )) ≤ C f . By continuity, there exists δ ∈ (0, min(t M −t 0 ,t 0 )) such thatṖ M out (t) < 0 for |t −t 0 | < δ . We deduce that P M out (t) ≤ P M out (t 0 ) = C f + ε for t 0 ≤ t < t 0 + δ , which is not consistent with the definition of t 0 . By contradiction, the claimed result sup holds. We deduce that t M = +∞ and sup By letting ε → 0 + , the proof is complete. Now, assuming that a minimal level of power is provided by the human, we obtain the existence of a lower bound on the power delivered by the motor for a suitable range of admissible initial conditions P M out ,0 . Lemma 2 Let P H,M > P H,m > 0 be given constants and define c f = c f (P H,M , P H,m ) > 0. Let P M out ,0 ∈ [ √ c f , C f ], P H out ∈ C 0 (R + ; R + ) with P H,m ≤ P H out (t) ≤ P H,M for all t ≥ 0, and m * ∈ C 0 (R + ; [η, 1]) be given. Then, the associated trajectory P M out of (5a-5b) satisfies P M out (t) ≥ √ c f for all t ≥ 0. Proof. From (5a) and as P M out (t) ≥ 0, we have thaṫ Let ε ∈ (0, √ c f ) be arbitrarily given. Assume that there exists t ≥ 0 such that P M out (t) < √ c f − ε. So, we can introduce t 0 inf{t ≥ 0 : P M out (t) < √ c f − ε}. As P M out (0) ≥ √ c f , we obtain by continuity that t 0 > 0 and P M out (t 0 ) = √ c f − ε. Consequently, we have thaṫ Thus, there exists δ > 0 such that P M out (t) ≥ P M out (t 0 ) = √ c f − ε for t 0 ≤ t < t 0 + δ , which is not consistent with the definition of t 0 . By contradiction, we obtain that P M out (t) ≥ √ c f − ε for all t ≥ 0. By letting ε → 0 + , the claimed conclusion holds. We can now introduce the main theoretical result of this paper. Specifically, assuming that a minimal level of power is provided by the human, we assess for a suitable range of initial conditions and in the case of a cooperative behavior that m tracks m * . Theorem 1 Let P H,M > P H,m > 0 and p ∈ {1, 2} be given constants and define c f = c f (P H,M , P H,m ). There exist constants β ,C 1 ,C 2 ,C 3 ,C 4 ,C 5 > 0 such that, for any initial condition P M out ,0 ∈ [ √ c f , C f ], any P H out ∈ C 0 (R + ; R + ) ∩ C 1 (R + ; R) with P H,m ≤ P H out (t) ≤ P H,M for all t ≥ 0, and any m * ∈ C 0 (R + ; [η, 1]) ∩ C 1 (R + ; R), the associated trajectory P M out of (5a-5b) satisfies the estimate: with √ c f ≤ P M out (t) ≤ C f for all t ≥ 0. Furthermore, assuming a cooperative behavior of the cyclist, i.e., P H out (t) ≤ P T (m * (t)) for all t ≥ 0, we have that Proof. We define for all t ≥ 0, As m * (t) ∈ [η, 1] and P H out (t) ∈ [P H,m , P H,M ], then f m * (t) (P H out (t)) > 0 for all t ≥ 0 and thus V is continuously differentiable with: We introduce the following quantity 6 : We investigate first the case p = 2. Using Lemmas 1-2, we obtain for all t ≥ 0 that: An integration shows that, for all t ≥ 0, Using the definition of V and the fact that > 0. Now, assuming a cooperative behavior, i.e., P H out (t) ≤ P T (m * (t)) for all t ≥ 0, we obtain from (6) that Using (7), it is sufficient to note based on the latter identity applied at t = 0 that to conclude the existence of constants C 3 ,C 4 ,C 5 > 0, that are independent of the initial condition and the signals P H out , m * , such that (8) with p = 2 holds true. We now consider the case p = 1. From (9) and using the Young's inequality 7 , The remaining of the proof for the case p = 1 is similar to the case p = 2. The experimental setup involves the e-bike depicted in Fig. 1 which is mounted securely in a stationary cycling turbo trainer. This allows for rotation of the rear wheel with minimal resistance and, at the same time, to measure the e-bike speed at the wheel. As discussed in Section 3, the amount of power the motor delivers is controlled by means of the control input Y (t). But due to the physical characteristics of the motor, the amount of motor power delivered for a given value of Y (t) depends on the human power input (discussed further in ). As such, we introduce a secondary control algorithm to get the actual motor power to converge to the target motor power. This secondary control algorithm defined a regulation error e k = P M out−Target − P M out−Actual which was used to update the control input Y k+1 = Y k − γe k , where γ > 0 is a proportional gain. The sampling period of the measurement system on the bike was limited to 1 second which limited the sampling period of the secondary control algorithm. If the sampling period could be faster, it is reasonable to expect the convergence of the actual motor power to the target motor power would happen faster. The aim of the experiments reported in this section is the validation of the control law described in the previous section. The experiments test the control strategy for a human operating in the both competitive and cooperative regions of 7 Young's inequality: ab ≤ a 2 2δ + δ b 2 2 for all a, b ≥ 0 and δ > 0. the characteristic depicted in Fig. 2 . The experiments were completed for a range of values of m * , emulating different pollution levels. Indeed, as m * stands for the desired value of the power ratio (1), a low value of m * corresponds to a e-bike operating mostly in electrical mode. This is particularly suited for highly polluted areas to reduce the effort of the cyclist, hence reducing its ventilation rate. Conversely, a high value of m * corresponds to a e-bike operating mostly with the power delivered by the cyclist, which is intended for lowly polluted areas. The policy of selecting P T (m * ) was that for higher pollution areas (i.e. lower values of m * ), P T should also be lower to try to keep the cyclist's effort lower to avoid breathing in high levels of pollution. Other policies are possible for selecting this threshold depending on the desired outcome. 4.1.1 Disturbance rejection for a constant reference m * First, the system has been tested with a constant reference input m * to evaluate the tracking capability of the closedloop system in the presence of an input disturbance, namely, a sudden change in the power delivered by the human P H in . We consider here the case of a cooperative scenario, i.e., the power delivered by the human remains below the threshold P T (m * ). The experimental result is depicted in Fig. 3 . It is observed that the constant reference m * = 0.7 can be tracked satisfactorily in the presence of small variations of the power P H in (t) delivered by the human. The tracking is also ensured in the presence of a larger change in average human power from approximately 100 W to 150 W, which occurs from time t = 80 s to time t = 160 s. Indeed, a sudden increase of the power delivered by the human induces first a significant increase of the ratio m. Nevertheless, the control algorithm successfully increases the power delivered by the motor to regulate the value of the ratio m to track the constant reference value m * = 0.7. We now illustrate with some experiments the main feature of our control strategy, namely: the management of cooperative and competitive modes. The results presented are for m * = 0.45 and m * = 0.6 in Fig. 4 and Fig. 5 , respectively. It can be clearly seen in the first part of both sets of results that m is regulated to the target value m * in the cooperative region, but when the cyclist increases their effort beyond the threshold P T (m * ) and into the competitive region, the target motor power starts to be gradually reduced as the human continues to increase their effort further into the competitive region. As as expected in the competitive region, m is no longer regulated to m * . When the human starts to reduce their effort, the target motor power starts to be increased again. Experiments were also completed for higher values of m * such as m * = 0.9, but in this situation the human should be providing almost all of the power anyway so there is little difference trying to regulate the motor power. Additionally, experiments were completed for values of m * lower than 0.45 but the system became unstable at this point due to the large sampling period which was limited by the measure- The experimental results are depicted in Fig. 6 . Over the range of time t = 0 s to t = 160 s, the cyclist maintains their effort (essentially) below the threshold P T (m * ). Hence the power ration m is regulated in a satisfactory manner to the time-varying reference m * . From time t = 160 s, the cyclist enters into the competitive mode, inducing a significant reduction of the power delivered by the motor. The cooperative mode is resumed from time t = 230 s until the end of the experiment. In this test case, we show that the control strategy investigated in this paper can be successfully used to perform an indirect control of the breathing rate of the cyclist. In this experiment, the ventilation rate (VR) of the cyclist is monitored by the spirometry equipment COSMED Spiropalm 6MWT with a COSMED VO 2 max digital flowmeter. In this setting, the reference signal m * is generated depending on a time-varying artificial environmental pollution signal. Specifically, large values of m * (i.e. close to 1) correspond to low pollution levels. In this case most of the power is delivered by the human which can freely adjust his effort. Conversely, small values of m * (i.e. close to the lower bound η > 0) correspond to high pollution levels. In this case, the motor assists the cyclist in order to limit the effort provided by the human. The experimental results are depicted in Fig. 7 . We observe that the reference signal m * is adequately tracked by the actual ratio m as long as the cyclist remains in cooperative mode (time t ≤ 520 s). During the first part of the experiment (time t ≤ 520 s), most of the poser is provided by the cyclist with a ratio m around 0.75. This progressively induces an increase of the ventilation rate of the cyclist. Around time t = 220 s, the reference value m * of the ratio is lowered to the value m * = 0.45, indicating a relative increase of the power provided by the motor compared to the one delivered by the cyclist. This gradually reduces the effort of the cyclist, hence reduces his ventilation rate. Such a tendency is stopped in the competitive scenario (times ranging from t = 525 s to t = 580 s) while restored as soon as the cyclist goes back to a cooperative mode (for times larger than t = 580 s). We presented a human-in-the-loop control system for deployment on an e-bike. Specifically, we introduced a con- trol algorithm that is able not only to manage route disturbances but also to manage the interactions with the cyclist. The basis of the control was a pitchfork bifurcation system, augmented using ideas from gain-scheduling. After having investigated the robustness of the proposed approach, we experimentally evaluated the effectiveness of our system. I had superpowers when ebike riding -towards understanding the design of integrated exertion On the fair coexistence of loss-and delay-based TCP Parked cars as a service delivery platform Electric and Plug-in Hybrid Vehicle Networks: Optimization and Control. Automation and Control Engineering 2020. Analytics for the Sharing Economy: Mathematics, Engineering and Business Perspectives Optimal pacing in a cycling time-trial considering cyclist's fatigue dynamics Distributed ledger technology for smart cities, the sharing economy, and social compliance Optimal energy management in series hybrid electric bicycles Weak" control for human-inthe-loop systems Nonlinear systems Smart e-bike monitoring system: Real-time open source and open hardware gps assistance and sensor data for electrically-assisted bicycles Elements of applied bifurcation theory Survey of gain-scheduling analysis and design On the design of cyber-physical control system for a smart pedelec (ebike) Control sharing in human-robot team interaction Unstable systems stabilizing each other through adaptation -part ii Research on gain scheduling On the crowdsourcing of behaviors for autonomous agents Global forecasts of urban expansion to 2030 and direct impacts on biodiversity and carbon pools The cyber-physical bike: A step towards safer green transportation A full hybrid electric bike: How to increase human efficiency Self-sustaining strategy for a hybrid electric bike Pedaling torque reconstruction for half pedaling sensor Smart Bikes for Smart Cities A context-aware e-bike system to reduce pollution inhalation while cycling Optimal power management of an electric bicycle based on terrain preview and considering human fatigue dynamics A hidden Markov model for route and destination prediction