Self-paced heart rate control for treadmill exercise

Introduction: With conventional heart rate (HR) control systems, the exercising person is bound to walk or run at a pace determined by the feedback. This may be challenging for people with impairments that make it difficult for them to achieve a smooth, continuous pace. The aim of this work was to assess the technical feasibility of a novel self-paced heart rate control strategy and to compare its accuracy with conventional heart rate control. Methods: We propose a self-paced heart rate control system that embeds an automatic positioning controller within the heart rate control loop. The treadmill speed command is decoupled from the heart rate compensator, whereas speed is determined by the exerciser’s own volition: target speed is displayed visually to the person and, when they try to follow this target, the position controller sets the treadmill speed while keeping the person at a safe reference position on the track. A further novel contribution of this work is a new input-sensitivity-shaping, frequency-domain design strategy for feedback control of position. Results: Experimental evaluation with four participants showed that self-paced heart rate control is technically feasible: all participants were able to accurately follow the target running speed calculated by the HR compensator and presented to them visually; for all four participants, self-paced HR tracking accuracy was not substantially different from conventional HR control performance; on average, the self-paced heart rate controller gave slightly better performance than conventional HR control, with RMS tracking error of 2.98 beats per minute (bpm) vs 3.11 bpm and higher average control signal power. Conclusion: The proposed self-paced heart rate control strategy with embedded automatic position control is deemed feasible. This approach may be helpful for people with gait impairments or other limitations that make it difficult for them to follow an imposed treadmill speed.


Introduction
Feedback control of heart rate (HR) can be used to optimise exercise training and testing routines (Hunt and Fankhauser, 2016;Wang and Hunt, 2021a). When applied using a treadmill for walking or running, the exercising person is bound to walk or run at the speed determined by the feedback control algorithm: the latter continuously adjusts treadmill speed to maintain a target heart rate. This constraint can be problematic if the person is unable or unwilling to maintain the commanded treadmill speed, in which case the exercise has to be interrupted or stopped to ensure safety; this can be done by the person stepping to the side of the treadmill track or pressing the emergency stop, or by a signal to an external person who has the ability to stop the treadmill. But a rapid stopping of the treadmill in itself carries risk because high acceleration may challenge the person's balance thus leading to a fall. These factors become especially relevant in the context of rehabilitation of patients with gait impairments, where walking or running at a smooth, continuous pace might be difficult and balance control compromised.
To solve this problem, the present work developed a self-paced heart rate control methodology wherein a conventional heart rate controller is combined with an automatic position controller, resulting in a so-called "self-paced heart rate control" approach. Here, the HR controller works as normal to continuously adjust the commanded treadmill speed. Instead of sending the speed command directly to the treadmill, however, the target speed is merely displayed to the walker/runner together with the actual treadmill speed, and they can then decide on their own volition whether they wish to, and are able to, follow this target. The actual treadmill speed is determined by a second feedback controller for position that is designed to maintain the exerciser at, or close to, a safe reference location on the treadmill.
In this setup, therefore, the exerciser's walking/running speed is only indirectly coupled to the target speed from the HR compensator: the treadmill is commanded by the position controller, which in turn is responding to the person's freelyselected walking/running speed, meaning that the treadmill is effectively under the exerciser's control. Of course, the intention is that the exerciser will be able to follow the target speed from the HR compensator by means of the visual feedback of the target and actual treadmill speeds, but this target speed is not strictly imposed on the person as in conventional HR control. This means that the person's safety, as far as their location on the treadmill is concerned, is ensured irrespective of the target speed computed by the HR controller.
Should the user be unable or unwilling to follow the target treadmill speed, then the heart rate feedback loop is not closed, in which case the only controller is the position controller which works to keep the user at the reference position, irrespective of what walking/running speed the person chooses. However, our working assumption throughout this paper, and in the experimental evaluation, is that the user is doing their best to follow the target, so the heart rate feedback loop is closed.
While the concept of automated positioning on a treadmill is not new-it is a technique that has commonly been referred to as "self-paced treadmill," or SPT-the embedding of a position controller within the HR control system to form the self-paced heart rate controller is a new concept that is presented and evaluated here.
Several self-paced treadmill (SPT) strategies have been proposed in the past, with the aim of automatically keeping the exerciser at a safe position. One possibility is a passive approach using a curved treadmill that requires neither sensors to determine position nor actuators to drive the treadmill (Kim et al., 2017). A more common solution is to measure position and to employ feedback control using a motordriven treadmill. Some studies adopted a camera motion capture system using body markers for position measurement and a weighted proportional-derivative (PD) compensator for position control (Sloot et al., 2014;Plotnik et al., 2015;Wiens et al., 2019). Other work measured distance with an ultrasound sensor and implemented an acceleration/deceleration control strategy to position the runner within 11 zones on the treadmill track (Scheadler and Devor, 2015). We previously used a wire-draw encoder for distance measurement and a feedback controller design based on closed-loop time-response tuning (Hunt et al., 2018).
Recent studies have shown that treadmill exercise using selfpaced (with position feedback) or fixed-speed strategies have similar kinetic and kinematic characteristics (Sloot et al., 2014;Plotnik et al., 2015;Wiens et al., 2019), muscle activity (Ibala et al., 2019) and energy cost (Theunissen et al., 2022). Moreover, analysis of spatiotemporal data from walking tests with SPT shows more natural fluctuations and a reduction of speed-related constraints (Wiens et al., 2019). It is natural to assume that these properties of SPT exercise carry over to the method of self-paced HR control described in the following.
While there is currently no data regarding the influence of speed visual-feedback on HR control performance, recent studies in gait rehabilitation using treadmill exercise have shown that introducing visual feedback has a positive influence on training outcomes in different pathologies, e.g., cerebral palsy, stroke or Parkinson's disease, signified by reduction in gait asymmetry, increased mobility (Liu et al., 2020) and improved balance (Almeida and Bhatt, 2012;Levin et al., 2017). A potential reason for these benefits is that, with visual-feedback, participants can better adapt their motion, such as by optimising their gait pattern to compensate the impairments associated with their condition. Positive adaptations have been verified by a reduction in oxygen cost (Levin et al., 2017), improvement of assessment of life habits after training (Tobar et al., 2018) and an increase in step length (Almeida and Bhatt, 2012;Liu et al., 2020). These adaptations and benefits may carry over as potential side benefits of self-paced HR control, due to the incorporation of a visual feedback task: this is a stimulating activity which challenges (in a positive sense) the active processing networks of the central nervous system.
In the present work, we employ a tethered approach in the selfpaced HR controller by using a wire-draw encoder for position measurement (as in (Hunt et al., 2018)), although any other method of determining position is in principle compatible with the position controller (e.g., a non-contact ultrasound sensor). A further, novel contribution presented in the sequel is that a new closed-loop inputsensitivity-shaping, frequency-domain design strategy is proposed for feedback control of position. This approach is taken in order to avoid unwanted excitation of the control signal (i.e., the treadmill speed command) by the periodic fluctuations in the distance measurement signal resulting naturally from the cyclical gait pattern: these fluctuations can be regarded as a disturbance signal entering the feedback loop, and they have to be expressly considered as part of the feedback design.
With reference to a standard feedback control system with compensator C and nominal plant P o , classical loop shaping is based upon shaping of the open-loop gain function L o = CP o , which then leads indirectly to the corresponding frequency responses of the closed-loop sensitivity functions (Åström and Murray, 2008). Alternatively, the closed-loop sensitivity functions can be shaped directly (Diaz et al., 2019) (Kwakernaak, 1993), because this function determines the behaviour of the control signal. Here, the control signal is the physical treadmill speed which is directly experienced by the user, and which must therefore be made to behave well. Since, in this combined-controller setup, the proper functioning of the HR controller is now dependent on the ability of the walker/ runner to maintain the target speed demanded by the HR controller, it remains to verify whether there is any loss of HR control accuracy compared to the case of conventional HR control. We have previously conducted extensive studies of conventional HR control during treadmill running, (Hunt and Fankhauser, 2016;Wang and Hunt, 2021a), which demonstrated average root-meansquare HR tracking errors (RMSE) on the range of about 2-3 beats per minute (bpm): this range serves as a baseline in the present work for assessment of the relative performance of the new self-paced HR control strategy.
The novel aspects and merits of the present work can be summarised as follows: • We present a novel strategy for self-paced heart rate control, which has not previously been considered: this approach may be helpful for people with gait impairments or other limitations that make it difficult for them to maintain an imposed treadmill speed. • We describe a new frequency-domain method for position controller tuning based on closed-loop input-sensitivity shaping. Previous work on closed-loop shaping has considered only the sensitivity and complementary sensitivity functions, whereas the behaviour of the control signal, which is determined by the closed-loop input sensitivity function, is paramount in this application. • We also aimed to conduct experiments to empirically assess the technical feasibility of the proposed self-paced HR controller and to compare its accuracy with conventional heart rate control.

Controller design
The treadmill setup, dynamics and key variables are shown in Figure 1: the speed of treadmill track is denoted v t while the commanded speed (sent from the control computer) is v p t ; these two variables are linked by the motor (M) dynamics given by the transfer function P m (s). The exerciser's walking or running speed is denoted v r , and is the relative speed between the person and the treadmill track. The person's distance x from a reference point at the front of the treadmill is simply the integrated difference between the track speed and the exerciser's speed, viz.
where x 0 is the initial position.

Conventional heart rate controller
For the conventional (i.e., non-self-paced) heart rate control system ( Figure 2A, detailed in (Wang and Hunt, 2021a)), the compensator C h (s) computes the treadmill speed command v p t and this is sent directly to the treadmill. The control system is driven by a target heart rate profile HR* which is shaped by a reference prefilter C pf with output HR′, while the measured heart rate is denoted HR. The signal d h is an output disturbance that represents physiological heart rate variability (HRV) and other sources of plant uncertainty.
The transfer function P oh (s), v p t ↦ HR, is the nominal plant that is used for compensator synthesis, i.e., for calculation of the parameters of C h as detailed in the sequel. The overall nominal plant P o h P m P r P h comprises three subsystems: motor dynamics P m (s), v p t ↦ v t ; runner dynamics P r (s), v t ↦ v r , which conceptually models the runner's response to changes in track speed; and the heart rate response dynamics P h (s), v r ↦ HR, which is the dominant component of P oh , i.e., the mode which is slowest and has the largest magnitude. In practice, it is not necessary to individually model the Treadmill setup, dynamics and key variables.
Main photo-adapted with permission from hpcosmos.com to illustrate monitor and tether; Inset-actual setup.

Frontiers in Control Engineering
frontiersin.org three plant subsystems since the overall nominal plant P o h was previously obtained from empirical, open-loop identification experiments that used an excitation input v p t and output HR (Wang and Hunt, 2021b); the individual dynamics of P m , P r and P h are therefore implicitly captured in the identified P o h transfer function.
Following the results of the identification study in (Wang and Hunt, 2021b), we proceed on the assumption of a nominal firstorder plant with gain k = 28.57 bpm/(m/s) and time constant τ = 70.56 s (these specific values were determined in (Wang and Hunt, 2021b) as averages from 11 individually-identified participants).
In summary, in the conventional heart rate control structure, the treadmill track speed is set automatically by the heart rate compensator and the exerciser is required to walk or run at approximately the same speed as the treadmill track such that they maintain their position at a safe location on the track.

Conventional position controller: Self-paced treadmill
In the conventional (i.e., without the incorporation of heart rate) position/distance control system ( Figure 2B, detailed in (Hunt et al., 2018)), the compensator C d (s) continuously updates the commanded treadmill speed v p t and sends it to the treadmill. The compensator processes the distance tracking error e d , which is the difference between the reference position x p (usually a constant) and the measured position x, i.e., e d = x p − x. The disturbance term d d mainly represents fluctuations in the measured distance resulting from the small, periodic anterior-posterior movements of the body linked to the stepping/running cadence; it also represents other sources of plant uncertainty (e.g., neglected treadmill motor dynamics).
The transfer function P od (s), v p t ↦ x, is the nominal plant used for determination of the parameters of C d (s) (see below). Similar to the conventional HR controller, the first element of this plant is the motor dynamics P m (s), v p t ↦ v t . The second element is the positiondynamic transfer function P d (s), which is governed by the first-order differential equation in Eq. 1. As illustrated in Figure 2B, therefore, the input to P d is the speed difference v t − v r and the output is the Block diagrams of the conventional HR and distance controllers, and the combined structure for self-paced HR control. (A) Conventional heart rate control system. HR* is the target heart rate profile, HR is the actual heart rate, and HR' is the output of reference prefilter C pf (s). The nominal plant is P oh (s) (individual subsystems P m , P r and P h are described in the text). d h is a disturbance term that models plant uncertainty, including heart rate variability. C h (s) is the HR compensator whose output is the control signal v t * , the treadmill speed command. (B) Conventional position/distance control system. x* is the reference distance, x is the measured distance, and e d the tracking error. The nominal plant is P od (s), comprising principally the integrating dynamic P d (s) = 1/s (treadmill motor dynamics P m can be neglected). d d is a disturbance term modelling periodic body movements. C d (s) is the distance compensator whose output is the control signal v t * , the treadmill speed command. (C) Self-paced heart rate control structure: the distance controller is embedded within the HR control loop. The HR compensator output v r * is decoupled from the treadmill, and is now a target speed for the runner, displayed visually on a screen. The distance compensator output is the control signal v t * , the treadmill speed command.
Since the treadmill motor dynamics are very fast in comparison to the distance dynamics, we proceed by neglecting them by setting P m (s) = 1 and, consequently, set P od (s) P d (s). Transforming Eq. 1, the nominal plant is seen to be In contrast to the conventional heart rate control system, with the conventional position controller the exerciser can arbitrarily choose their own speed, giving rise to the concept of "self-paced" treadmill (SPT). Distance measurement feedback then allows the compensator to automatically set the track speed to eliminate any deviation from the position setpoint and, in so doing, to keep the track speed v t close to the self-selected runner's speed v r .

Combined controller: Self-paced heart rate control
The proposed self-paced heart rate control system ( Figure 2C) has two key characteristics: (i) the position/distance controller is embedded within the heart rate control loop, and (ii) the heart rate compensator output is decoupled from direct connection to the treadmill; in the conventional HR control system (Figure 2A), the output of the heart rate compensator C h is the commanded treadmill speed v p t , which is sent directly to the treadmill as a speed command; in contrast, in the new self-paced HR control structure ( Figure 2C), the heart rate compensator output is now merely a target speed for the runner, whence we change the notation for the output of C h to v p r , where "r" signifies that it is the runner's speed and "*" that it is a target.
Visual feedback is provided to the exerciser on a screen that displays two signals: the runner's target speed v p r that is computed by the heart rate compensator C h , and the commanded treadmill speed v p t from the distance compensator C d . v p t is the treadmill speed command, where the assumption is implicit that the motor dynamics are fast enough so as to be neglected, i.e., that the actual treadmill track speed v t is close to the commanded v p t , or P m (s) ≈ 1.
As can be seen in the block diagram of the self-paced HR controller ( Figure 2C), the runner's self-selected speed v r serves as an input (actually, a disturbance input) to the distance control loop, which then drives the commanded response speed of the treadmill v p t (and, in turn, the actual v t ) such that the target position x p is closely maintained.

Feedback design
Synthesis of the heart rate and distance compensators C h and C d proceeds from a generic nominal plant model P o (s), viz. the strictly proper rational function where A and B are polynomials of degree n a and n b , and A is monic.
The specific instances of P o used in the sequel for calculation of C h and C d are given in Eqs 2, 3, respectively. The compensators C h and C d are both strictly proper rational functions that are constrained to include integral action and which have the form where G and H are polynomials of degree n g and n h , with H monic. The strictly proper requirement, expressed algebraically as n g < n h , is to ensure the compensator gain rolls off to zero, i.e., lim ω→∞ |C(jω)| = 0, to make the controller insensitive to high-frequency disturbances. The integral action is to guarantee zero steady-state error (for the heart rate compensator, this means compensation of the very slow Phase III dynamics of HR response).
Derivation of both C h and C d is based on a frequency-domain, loop-shaping approach focused on the input sensitivity function. For completeness, the three principal sensitivity functions, i.e., the sensitivity function S o , the complementary sensitivity function T o , and the input sensitivity function U o , are defined here: For further development, the latter expression for the input sensitivity function U o can be expressed in terms of polynomials by substitution for P o and C using Eqs 4, 5, respectively, as 2.1.4.1 Heart rate controller design The main design challenge for HR control is to ensure that the control signal v r * responds appropriately to the broad-spectrum HRV disturbance d h , that is to say, that the target speed presented to the runner, or, in the case of conventional HR control, the treadmill speed command v p t , is not overly excited at frequencies that would be uncomfortable for the runner. Since the response of the control signal to the disturbance input is governed by the input sensitivity function, HR control design focuses on shaping the frequency response of U o h .
To address these requirements, the heart rate compensator C h (s) is designed by algebraic manipulation to give a specific shape to the input sensitivity function for the HR control loop: U o h is constrained to be a first-order, low-pass filter with a specified bandwidth p, viz.
where k is the plant's steady-state gain (see Eq. 2). The rationale for this choice of U o h is that its magnitude decreases monotonically towards zero with frequency, and that it is devoid of peaking. This avoids amplification of the HRV disturbance d h around the crossover frequency and provides attenuation of high-frequency components of d h .
Full details of the compensator derivation are given elsewhere, (Hunt and Fankhauser, 2016), while the solution is summarised here: for the nominal plant Eq. 2, the compensator that has the general form of Eq. 5 and that achieves the desired form in Eq. 10 for the input sensitivity function is The compensator is parameterised by the design parameter p (bandwidth specification for U o h ) and the two plant parameters, viz. gain k and time constant τ; as noted above, we used the identified values k = 28.57 bpm/(m/s) and τ = 70.56 s; the input sensitivity bandwidth was chosen to be 0.01 Hz, thus p = 0.0628 rad/s. Substituting these values into Eq. 11, the heart rate compensator is found to be C h s ( ) 0.0022s + 3.1 × 10 −5 s s + 0.077 ( ) .
The prefilter C pf is designed to shape the overall closed-loop transfer function from HR* to HR to be a second-order transfer function, denoted T cl , with critical damping and rise time of 150 s. Since T cl C pf · T o h , where T o h is the complementary sensitivity function for the HR loop (see Eq. 7), C pf is obtained as

Distance controller design
It is important to design the distance control system to make sure that the disturbance term d d does not inappropriately excite the control signal, i.e., the treadmill speed command v p t , as this may result in changes to treadmill speed that would be perceived negatively by the runner. The principal component of d d is the natural variation in the actual position of the runner caused by the periodic to-and-fro motion of the body at a frequency centred on the cadence. Since the normal range for running cadence is 150-180 steps per minute, the centre frequency band of d d is 2.5 Hz-3.0 Hz. The feedback design therefore focuses once again on shaping the input sensitivity function, since this transfer function links the disturbance with the control signal.
To address these requirements, the distance compensator C d (s) is designed to shape the input sensitivity function U o d to have a bandwidth of 2 Hz, which is just below the identified central frequency band of d d . Moreover, the design aims to make U o d as flat as possible below the bandwidth to avoid peaking and amplification at lower frequencies. For the distance controller, peaking is in principle possible because, since in this case A(s) = s (Eq. 3), the numerator of U o d contains the factor s (see Eq. 8): |U o d (jω)| is therefore zero at zero frequency and rises initially with frequency at a positive rate of 20 dB per decade.
In the following, we develop a novel optimisation-based design approach for synthesis of the distance compensator. C d is chosen to have the general form of Eq. 5 so that it is strictly proper and includes integral action. Assuming a nominal plant as in Eq. 3, where P o d 1/s, it was shown elsewhere, (Hunt et al., 2018), that the closed-loop poles can be placed arbitrarily in the complex plane with n g = 1 and n h = 2 in Eq. 5, whence G(s) = g 1 s + g 0 , H(s) = s(s + h 0 ) and With this definition of G and H, and using plant polynomials B(s) = 1 and A(s) = s (Eq. 3), the input sensitivity function is obtained from Eq. 9 as where Φ(s) is the closed-loop characteristic polynomial, Φ(s) = s 3 + h 0 s 2 + g 1 s + g 0 . Assuming all three closed-loop poles are real, Φ can be expressed as where, for stability, a, b and c are positive. Apparently, h 0 = a + b + c, g 1 = ab + bc + ac and g 0 = abc. Controller synthesis is now formulated as an optimisation problem that aims to find the a, b and c that shape U o d (jω) to be closest to a specified curve. Based on the performance requirements outlined above, we select the point (2 Hz, −3 dB) as the bandwidth, (0.5 Hz, 0 dB) and (1 Hz, 0 dB) to achieve a flat response between these frequencies, and (0.1 Hz, −3 dB) at the lower end of the bandpass range, set one decade below the upper bound of the flat part of the curve. These four target points are indicated as blue dots on the optimised frequency response of U o d (Figure 3).
The optimal a, b and c were obtained by least-squares using the matlab non-linear curve fitting function lsqcurvefit (Matlab, The MathWorks, Inc., USA), giving a = 0.5439, b = 0.5437 and c = 10.6170. Since h 0 = a + b + c, g 1 = ab + bc + ac and g 0 = abc, the distance compensator C d is C d s ( ) 11.84s + 3.14 s 2 + 11.70s .
With this compensator and the nominal plant P od 1/s, Eq. 3, the three principal sensitivity functions in Eqs 6-8 can be examined ( Figure 3): U o d (jω) closely matches the target points and is almost flat close to 0 dB, while S o d (jω) and T o d (jω) display only a small degree of peaking.

FIGURE 3
Closed-loop sensitivity functions for the distance control loop: input-sensitivity function U od , Eq. 8; sensitivity function S od , Eq. 6; and complementary sensitivity function T od , Eq. 7. Blue dots mark the target frequency response of |U od (jω)|. The vertical dashed line marks the selected U od bandwidth of 2 Hz, which is just below the assumed central frequency band of the disturbance d d from 2.5 Hz to 3.0 Hz.
Frontiers in Control Engineering frontiersin.org

Experimental methods
We used an experimental, small-group study design to focus on feasibility of self-paced heart rate control and its consistency with conventional heart rate control (this study design corresponds broadly with Phase II of Robey's five-phase model of the clinical research process (Robey, 2004)).

Protocol
Four healthy participants were included in the tests. They were aged between 23 years and 26 years, had mean body mass 70.3 kg and mean height 180 cm. All participants were healthy, regular exercisers (at least 3 times each week for at least 30 min), nonsmokers and free from musculoskeletal complaints.
Each participant completed two formal feedback control tests: one with conventional HR control ( Figure 2A) and one with selfpaced HR control ( Figure 2C). A counterbalanced experimental design was implemented, whereby the test order was changed for each participant to exclude any order-of-presentation effect. Separately, and prior to the formal tests, all participants were fully familiarised with both HR control systems.
Each test comprised three phases (Figure 4): 10-min warm up, 10min rest and 30-min formal measurement phase. During warm up, the reference signal had a constant value HR m that was set to the individual age-dependent heart rate deemed to delineate moderate and vigorous exercise intensities (see (Riebe et al., 2018)), viz. HR m = 0.765 × (220age). For the formal measurement phase, the reference comprised two cycles of a square-wave signal with period 10 min, mean value HR m and amplitude 10 bpm. The data from 295 s to 1795 s of the formal measurement phase were used for the evaluation of the outcome measures defined below.
During tests with the conventional HR controller, participants were instructed to maintain their position close to a location clearly marked at the sides of the treadmill track. For self-paced HR control, the reference distance x p was set individually to place each participant approximately at the same marks: for participants P01, P02, P03 and P04, x p was set to 0.7 m, 0.7 m, 0.4 m and 0.6 m, respectively.
For the self-paced HR control system, the reference/target running speed v p r (sample rate 0.2 Hz) and the treadmill speed command v p t (sample rate 10 Hz) were displayed on a screen using a window duration of 150 s ( Figure 5; see also Figure 6A, middle plot). Participants were instructed to adjust their running speed to make v p t follow the target v p r as closely as possible (recall from above, Secs. 2.1.2 and 2.1.3, that the distance controller works to ensure that v p t is close to the runner's actual speed v r ). During conventional HR control tests the screen was turned off.

Equipment
All tests were carried out on a PC-controlled treadmill (model Venus, h/p/cosmos Sports & Medical GmbH, Germany; Figure 1B).

FIGURE 4
Test protocol: reference/target heart rate profile HR*.

FIGURE 5
Illustrative screen display for the self-paced HR control system. The blue dashed line is the reference/target runner speed v r * . The red line is the treadmill speed command v t * , which serves as a proxy to the runner's actual speed v r .

Frontiers in Control Engineering frontiersin.org
The control algorithms were implemented using Simulink Desktop Real-Time (The MathWorks, Inc., USA) running on the PC. Heart rate was monitored using a chest strap sensor (H10, Polar Electro Oy, Finland) and transferred to the PC via Bluetooth at a rate of 1 Hz. For both controller setups, the HR compensator C h ran at a sample rate of 0.2 Hz (sample interval 5 s). Hence, the HR measurement was downsampled by averaging every five consecutive values.
The distance x was measured by a wire draw encoder (Ecoline BCG08-L1KM03PP, Sick AG, Germany) mounted at the front of the treadmill and connected to the runner via a side release buckle attached to a waist belt. The analogue output of the encoder was sampled in real time at 10 Hz using a data acquisition card (PCIe-6321, National Instruments Corp., USA) linked to the Simulink model. The distance compensator C d also ran at a rate of 10 Hz.

Outcome measures
Heart rate tracking accuracy for both conventional and selfpaced HR control was evaluated using the root-mean-square error (RMSE) between the HR measurement and the nominal, simulated HR response, where HR sim is the simulated overall closed-loop HR response (HR sim = T cl ·HR*), HR is measured heart rate, and N is the number of discrete sample instants of HR measurement over the evaluation period. Since the sample interval for HR control was 5 s and the evaluation duration was 1500 s, N = 301.
For heart rate control, the intensity of the control signal (speed output v p t or v p r of the HR compensator C h ) was quantified for both control structures by the average power of changes in the control signal, viz.
where v p denotes the control signal: for the conventional HR control system, v* represents v p t ; for the self-paced HR control system, v p stands for v p r . As the sample interval was 5 s, N = 301. For the distance compensator, applied within the self-paced HR control structure, the intensity of the control signal (commanded treadmill speed output v p t of the distance compensator C d ) was quantified by the average power of changes in this variable as Since the sample rate for the distance compensator was 10 Hz, N = 15001. For distance control, tracking accuracy was evaluated by the RMSE between the measured distance and the reference distance, where x p is the constant reference distance, x is the measured distance and N = 15001. Distance tracking accuracy was evaluated in this way for both self-paced HR control and for

FIGURE 6
Illustrative measurements for participant P01. In each figure, the upper plot shows the reference heart rate (HR*, black dashed line), the measured heart rate (HR, red line) and the nominal/simulated heart rate response (HR sim , black line). The middle plots show the control signals, comprising the output from the HR compensator (v r * or v t * , black line) and, for self paced, from the distance compensator (v t * , red line). The lower plots show the distance measurement, encompassing measured distance (x, red line) and target distance (x*, black line). The evaluation period is marked by the thick red horizontal line. (A) Self-paced HR control, P01. (B) Conventional HR control, P01.

Frontiers in Control Engineering
frontiersin.org conventional HR control; in the latter scenario, since the distance controller was not active, but participants were instructed to remain close to a marked position, the reference variable x* in Eq. 21 was set to the mean distance observed during the evaluation period.

Results
A representative set of results for one participant (P01) is shown in Figure 6: this participant was chosen for illustration because heart rate tracking accuracy RMSE h was closest to the mean observed value for both self-paced and conventional HR control.
Individual outcomes, and averages pooled across all four participants, are shown in tabular form in Table 1 and graphically in Figure 7.
Overall, mean HR tracking accuracy was slightly better (4% lower RMSE h ) for self-paced control: RMSE h was 2.98 bpm ± 0.95 bpm (mean ± standard deviation) vs 3.11 bpm ± 0.80 bpm (self paced vs conventional). Of the four pairs of tests, self-paced was better in two cases while conventional was better in two cases, whereby it was observed that the second test for each participant always had the lowest RMSE h .
The self-paced system was found to have substantially better distance control accuracy (16% lower RMSE x ) than the volitional distance control approach used during conventional HR control: RMSE x was 0.041 m ± 0.003 m vs 0.049 m ± 0.011 m (self paced vs conventional).

Discussion
The principal aim of this work was to assess the technical feasibility of a novel self-paced heart rate control strategy and to compare its accuracy with conventional heart rate control.
Experimental evaluation with four participants showed that the approach is technically feasible, since all participants were able to accurately follow the target running speed calculated by the HR compensator and presented to them visually. As a consequence, for all four participants, self-paced HR tracking accuracy was not substantially different from conventional HR control performance.
It was found, on average, that the self-paced heart rate controller gave slightly better performance than conventional HR control, with lower mean RMS tracking error RMSE h associated with higher mean average control signal power P ∇ . In the self-paced approach, the distance controller is embedded within the heart rate control loop in a classical nested-loop structure: this approach is known to work well when the inner loop works much faster than the outer loop such that deviations in the controlled variable of the inner loop-in this case, the actual runner speed-are corrected before they can have any substantial effect on the main controlled variable-in this case, heart rate. These conditions were fulfilled in the present work since the bandwidth of the input sensitivity function for the distance control loop was set to 2 Hz, which is approximately two decades higher than the 0.01 Hz bandwidth of the heart rate loop. RMSE, root-mean-square error; P ∇ , average control signal power; bpm, beats per minute; SP, self-paced HR control; CON, conventional HR control; **, outcome from first test; SD, standard deviation.

FIGURE 7
Comparison of outcomes for self-paced (left columns of blue dots) and conventional (right columns of red dots) HR control. The green lines link the pairs of samples for each individual participant. The left y-axis is for RMSE h and P ∇v* and the right y-axis is for RMSE x . The red bars depict mean values. For self-paced P ∇v* , v* v r * ; for conventional P ∇v* , v* v t * (cf. Table 1).

Frontiers in Control Engineering frontiersin.org
The results demonstrated a definite order-of-presentation effect since the second test for each participant had lower heart rate RMS tracking error; this was despite participants having been familiarised with the treadmill and experimental procedures prior to formal testing. This phenomenon was however addressed a priori by the counterbalanced experimental design-test order, i.e., SP then CON vs CON then SP, was changed for each participant-and the choice of an even number (four) of participants.
The novel design approach for the distance compensator, which optimised the shape of the input sensitivity function, was found to deliver highly accurate position control with mean RMS tracking error of 0.041 m, meaning that most of the observed position data points lay within just 4.1 cm of the reference distance (actually, about two thirds of the sample, since RMSE x in Eq. 21 is just the uncorrected standard deviation of the error sample). Moreover, the distance compensator output v p t , which is provided visually to the runner as a proxy for their actual speed, was well behaved and facilitated accurate volitional speed control on the part of the runner (e.g., Figure 6A, middle plot).
The position controller design that was tested in the present work was based on an assumption of a frequency band for normal running cadence, and therefore for the position disturbance term d d , of 2.5 Hz-3.0 Hz. If the system were to be applied to patients who have some walking/running impediment, it may be necessary to increase this band to encompass lower frequencies. If necessary, this would involve shifting the four frequency response target points ( Figure 3) to lower frequencies and/or lower magnitudes and recalculation of the controller parameters.
For position measurement, we employed a tethered approach involving physical connection of the runner to a wire-draw encoder, but, in principle, any other measurement system capable of delivering accurate, real time position information is compatible with the proposed self-paced strategy; for example, our experimental setup also allows non-tethered position control using an ultrasound sensor ( Figure 1B).

Conclusion
The proposed self-paced heart rate control strategy with embedded automatic position control is deemed feasible: as noted in the Introduction, previous studies of conventional heart rate control have reported a tracking accuracy (RMSE) of about 2-3 bpm (Hunt and Fankhauser, 2016;Wang and Hunt, 2021a). Against this baseline, the average RMSE for self-paced heart rate control found here, viz. 2.98 bpm, is reasonable. This approach may be helpful for people with gait impairments or other limitations that make it difficult for them to follow an imposed treadmill speed. However, since our experimental evaluation included only healthy participants, future research should evaluate the system's performance in target populations of individuals with significant impairments and, if necessary, explore whether the frequency-domain specifications of the feedback design need to be adapted.

Data availability statement
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.

Ethics statement
This research was performed in accordance with the Declaration of Helsinki. The study was reviewed and approved by the Ethics Committee of the Swiss Canton of Bern (Ref. . The patients/participants provided their written informed consent to participate in this study. Written informed consent was obtained from the individual(s) for the publication of any potentially identifiable images or data included in this article.