Abstract
This paper introduces an intelligent trajectory generator and a generalised proportional integral (GPI) control law for the movement of two carts on a circular motorised rail. The objective is to continuously monitor a person performing physical rehabilitation exercises and moving freely inside the circle. Each cart is equipped with an red-green-blue depth (RGB-D) device so that the patient is monitored from two points of view. One RGB-D device is dedicated to track the body part being exercised, while the other focuses on the person’s face to detect his/her emotional state. The proposed feedback control scheme is based on an exact feed-forward action combined with a velocity vector structural estimation using a model-based integral state re-constructor. Furthermore, the proposed intelligent trajectory generator comprises the references required to move the carts based on the instantaneous position of the patient and the current position of both carts. It also establishes the role (master or slave) of each cart, the direction that each cart must follow, and it generates smooth trajectories that avoid collisions between the carts. Moreover, the paper introduces a description of the displacements of both carts and the positioning of the tilt and pan angles of each RGB-D sensor so as to track the patient’s face and the body from the best viewpoints. The performance of the intelligent trajectory generation and the control of the two carts were analysed with numerical simulations. A comparison was made between the developed GPI control and a standard proportional integral derivative (PID) control. The simulation results show the effectiveness of the trajectory planner, and demonstrate that the GPI control has a better dynamic response than the PID control as well as a better performance in terms of the integral squared tracking error, the integral absolute tracking error, and the integral time absolute tracking error.
Keywords
Introduction
The popularity of computer-based physical rehabilitation systems is constantly increasing. These rehabilitation systems typically use depth cameras to detect and track humans [1, 2, 3, 4, 5, 6]. In this sense, facial emotion detection of a patient performing the exercises helps to understand how he/she feels during the rehabilitation program [7]. This is of great importance in the treatment of certain diseases such as chronic pain as emotions play a major role during rehabilitation [8]. Facial analysis is also at the core of exercise-induced fatigue [9]. Emotional information is useful as feedback to the system to modify and adapt the exercise category and difficulty [10]. Our vision-based solutions are grounded on human detection [11, 12, 13] and tracking [14]. This paper is also inspired in previous research on multi-robotics [15, 16], tracking robotics [17] and rehabilitation robotics [18, 19].
When monitoring people undergoing physical rehabilitation exercises, it is mandatory to count on the best viewpoint of the exercised part of the body by modifying the angles of the camera accordingly [20, 21]. Moreover, if facial emotion is to be detected in order to know the mood derived from the rehabilitation exercises, then another viewpoint must be dedicated to capture the face of the patient. Red-green-blue depth (RGB-D) sensors must be smartly placed in the optimal positions to acquire images of the patient’s exercised part of the body and face. For this reason, mechanical solutions and control strategies are being developed for human rehabilitation exercises [22, 23, 24, 25]. In addition, as RGB-D images provide detailed depth information instead of specific 3D data acquired by traditional 3D sensors, they have fewer computation costs and are more suitable for real-time face expression recognition [26].
This paper, an extension of a recent conference paper [24], describes the behaviour of a motorised circular rail equipped with an intelligent trajectory generator which is capable of smartly relocating two carts, each one equipped with an RGB-D sensor, in order to monitor the patient’s face and the physically rehabilitated body part from two complementary views [27, 28]. The principal contributions of this research in regards to a recent one [24, 29] are (i) the design of an extension to the generalised proportional integral (GPI) control technique for both stabilisation and trajectory tracking tasks for each of the carts comprising the circular motorised platform, and (ii) the possibility that the patient moves freely inside the circle traced by the rail. In relation to the first contribution, the new control law has the advantage that no asymptotic observers or time discretisations are needed in the feedback loop to estimate the states commonly used in the design of traditional state-based feedback controllers for these systems [30, 31]. In addition, under the assumption that the patient can move freely, we define a trajectory generator for each of the two carts on the platform which work in a coordinated manner to monitor both desired parts of the body. At the same time, the security of the system is maintained and it is ensured that both carts never collide during their tracking of the person undergoing a rehabilitation program.
The paper is structured as follows. Section 2 presents a general description of the different elements comprising the circular motorised platform. Section 3 describes the dynamic model of the carts in charge of monitoring the patient, the dynamical model of the carts and the problem formulation. Section 4 introduces a complete description of the smart trajectory generator in charge of generating the reference trajectories of the carts, which are necessary to optimally locate the patient’s face and physical rehabilitation exercises. Section 5 presents the GPI control methodology applied to the stabilisation and tracking problem of the carts. In this section, it is proved that the GPI controller produces an asymptotically, exponentially convergent tracking error behaviour in relation to the origin of the coordinates in the error space. Section 6 introduces a series of numerical simulations to evaluate the performance of the trajectory generator and control. Lastly, the more relevant conclusions are drafted in Section 7.
General description of the system
As mentioned above, the ultimate practical application of this proposal is to monitor a patient performing a series of physical rehabilitation exercises from two viewpoints, in this way covering the face from one RGB-D camera and the part of the body being rehabilitated from another. In other words, in first place, the body part that is being exercised must be monitored to supervise that the exercises are being correctly performed. This will help to correct any bad movement. From the other cart facial expressions are detected in order to infer when the exercises are causing pain, dizziness, fatigue, etc. In this way, it will be possible to adapt the exercises to each patient. In order to carry out this process, a circular platform, composed of two carts (denoted as
List of symbols
List of symbols
Proposed circular motorised rail system: (a) Initial configuration and; (b) Final configuration.
Figure 2 illustrates the general scheme of the platform, which consists of the following components:
A motorised cart system composed of two carts mounted on the circular rail and equipped with an RGB-D sensor. The aim of this system is to relocate the two motorised carts to monitor the patient’s face and the physical rehabilitation exercise from two complementary viewpoints. Two motorised carts equipped with an RGB-D device each (see Fig. 3), which move on the rail in a continuous manner to register the rehabilitation exercises and the facial expressions of the patient who freely moves inside the circle formed by the rail.
General scheme of the platform. An intelligent trajectory generator that generates the coordinate trajectories of the two carts to locate them in the optimal configuration to monitor the patient. The intelligent trajectory generator comprises the references required to move the carts (denoted as
Layout of the cart equipped with an RGB-D sensor. A GPI control action for each cart that uses the reference trajectories constructed by the trajectory generator, generating the necessary control actions in order to achieve both the stabilisation of the system and the tracking of the references (i.e.


The dynamic model has been developed using as a basis the cart system shown in Fig. 3. The cart incorporates smooth support wheels, which are mobile supports that enable the cart to move, along with a rack and pinion that transmits its movement. The cart has been divided into three subsystems, which will make it possible to compute the balance of forces. These subsystems are the RGB-D sensor, the body of the cart and the sprocket. The calculations first consider the RGB-D sensor, after which they follow the transmission of forces to the motor that moves the sprocket. The dynamic model is obtained by attaining the function responsible for providing the torque generated by the motors. This will be the input to the system and is, therefore, important because from here on the system equations composing our state model are obtained.
The following expressions are calculated for the motors’ torques:
where
or, written in a compact form:
where
Variables’ definition of a cart equipped with an RGB-D sensor.
The proposed trajectory generator must calculate the displacements of both carts inside the circle formed by the rail and the angular positions of the pan and tilt angles of the RGB-D sensors (i.e.
the instantaneous position of the patient in the circular rail (denoted as the instantaneous position of the body part to be monitored in the circular rail (denoted as the direction towards which the patient is facing (denoted as principal vector, the direction to which the patient’s body part to be monitored is pointing (denoted as secondary vector, the instantaneous configurations of the two carts (denoted as
Based on this information, the intelligent trajectory generator must perform the following functions:
generate the optimal configuration of both carts, establish the role (master or slave) of each cart in such manner that the master cart will be in charge to track the patient’s face and the slave cart will be assigned to monitor physical rehabilitation exercises; determine the direction that each cart must follow in order to minimise the distance travelled; avoid the possible collisions between both carts.
The development of the mathematical model that is carried out for the computation of the reference trajectories of the carts when they act with the master or slave roles, denoted as
respectively, are introduced. Let us highlight that the behaviours of the carts are different depending on the master and slave roles assigned. These roles are dynamically established according to the instantaneous locations of both carts. Moreover, the angular position of the slave cart must vary when a collision is foreseen with the master cart after the trajectories have been calculated. In this case, the slave cart must follow the opposite path. We have to remark that we will focus our study in the development of the mathematical procedure for obtaining the reference trajectories of the master cart,
The procedure for achieving the reference trajectories for the slave cart,
We start the development of the model by obtaining the new position of the master cart in the circular rail,
Angular positions of the master cart.
In order to obtain the mathematical description of the line
where
Upon operating with Eqs (4) and (5), we obtain:
By defining
Now, after simple algebraic manipulations in Eq. (8), the following result is obtained:
The values of the resulting cut points
In order to discover which point is correct, the parametric equation of line
The following step is to calculate the angular position of the RGB-D sensor’s pan of the master cart,
However, as the RGB-D sensor is mounted on a cart rotating around the rail, the turn
where
Angular position of the the master cart’s tilt sensor.
Next, the angular position of the tilt of the RGB-D sensor of the master cart,
where
Again, after computing Eqs (18) and (19), the angular position of the tilt of the RGB-D sensor of the master cart,
Finally, grouping Eqs (12), (16) and (20), the final reference trajectory vector for the master cart,
The selection of each cart’s role is determined according to the following criteria:
When the destination angular positions of the cart that are required to cover the patient’s position have been calculated, the cart closest to the main vector, defined by the angular position Any collision between the carts must be avoided, and it is consequently necessary to check that the route used by one cart is not interspersed with the other, thus avoiding such a situation. If both carts are at the same distance from angular position If both angular positions are at the same distance from the two carts, the one whose speed in the direction of the angular position is greater takes the role of master. If both carts are travelling at the same speed or are stationary, cart
In order to explain these situations, two examples are analysed (see Fig. 7), where it is possible to determine which of the two carts should go to each position according to the destination.
Examples of role distribution.
In Fig. 7a, the distribution of roles is very simple according to the first rule described. Cart
cart a change of roles of the carts is necessary and cart
The intelligent trajectory planner studies these options and selects the optimal movement of the carts (which is given by the minimum path travelled by the two carts) and immediately changes the roles of the carts, with cart
We conclude by stating the main results regarding the design of the intelligent trajectory planner:
Given the instantaneous position of the patient in the circular rail,
In recent years, novel robust control algorithms have been developed for smart mechanical structures [32, 33, 34, 35]. In the case of the circular rail, the generalised proportional integral (GPI) control, which has performed well in regulating the dynamic systems of a linear and non-linear nature [36, 37], has been applied to control the movement of the two carts in an intelligent and precise manner. The main advantage of GPI control is that it sidesteps the need for traditional asymptotic state observers and directly proceeds to use, in a previously designed state feedback control law, defective integral reconstruction of the state. This, a priori, neglects the effects of unknown initial conditions and possible class-ical perturbation inputs (constant and low-order time polynomial errors, such as ramps and parabolic signals).
These structural estimates are based on the key observation that the states of observable linear systems may be integrally parametrised in terms of inputs and outputs alone (i.e. linear combinations of inputs, outputs and of a finite number of iterated integrals of signals). The errors of integral reconstruction are compensated later by means of a sufficiently large number of additional iterated integral tracking errors, integral input errors and control actions (see [38] for the relevant theoretical basis and [39, 40, 41, 42, 43, 44, 45] for the application of these ideas in diverse fields, including laboratory experiments).
In this work, we extend the GPI control technique to both the stabilisation and trajectory tracking tasks of the two carts that comprise the circular motorised platform. We first derive an exact controller to be used in the control of the configuration of the carts, under the assumption that there is complete knowledge of the system states of the two carts. The velocity vector estimation of the carts is then carried out by means of a model-based integral re-constructor complemented with a GPI controller. Finally, we prove that the proposed GPI controller scheme for each of the carts gene-rates tracking errors tending to zero, thus robustly tracking the patient’s face and/or his/her physical rehabilitation exercises.
Robust feed-forward controller for the motorised circular platform
Firstly, it is first necessary to recall that both carts have the same mechanical components, and thus have the same dynamic model. In this case, the derivation of the controller can be performed in a general manner, after which the sub-indexes
If Eq. (22) is subtracted to Eq. (3), the tracking error vector
A direct exact linearisation-based feedback controller that exponentially regulates to zero the tracking error vector
where
where
We shall conclude this section by stating the following result, which has been proved in the developments shown above:
Given the dynamics of each of the carts Eq. (3), of which the circular motorised platform illustrated in Fig. 2 is composed, where it is assumed that the velocity vector system,
An alternative complementary design that requires no perfect knowledge of the velocity vector system,
The control law given by Eqs (24) and (25) requires the perfect knowledge of the velocity vector system,
where
The structural velocity vector estimator provided in Eq. (28) certainly has the interesting advantage of being easily synthesised by using only the integral of a linear function of input vector
The following equivalent feedback control law is, therefore, obtained by substituting Eqs (28) and (29) in controller Eqs (24) and (25):
When the control given by Eq. (5.2) is implemented in the motorised cart model Eq. (3), we obtain that the tracking error dynamics evolves according to the following linear perturbed dynamics:
which has an offset error owing to the constant initial condition excitation of the asymptotically stable tracking error vector dynamics. This immediately prompts us to consider the possibility of using a modified linear control action including an integral error term that rejects these constant perturbation loads. We, therefore, propose the following control law, which is illustrated in Fig. 8:
GPI control scheme.
The use of the modified controller Eq. (5.2) in the dynamics of the motorised cart model Eq. (3) gives the following dynamics for the tracking error:
Now, by differentiating Eq. (5.2), the following third-order linear tracking error vector dynamics is achieved:
which clearly has the origin (
is composed of third-degree Hurwitz polynomials with desirable root locations. The constant gain matrices
Upon identifying each term in Eq. (35) with those in Eq. (36), we directly obtain the values required for the set of gain matrices
We conclude by stating the main result regarding the design of the control law, which has been proved throughout all of the above:
Given the reference trajectory vectors provided by the intelligent trajectory generator,
and, under the assumption that only measurements of the configuration of the carts,
produces a closed-loop behaviour of the tracking error vector, defined as
whose design parameters,
Numerical simulations were carried out in order to evaluate the performance of the intelligent trajectory generation and the control of the carts. For the numerical simulations, we considered the following values for the parameters of the carts and the circular rail:
Two case studies were developed to demonstrate the effectiveness of the proposed intelligent trajectory planner, which coincides with the case studies explained in Section 4.2. Additionally, in the case studies two different simulations were developed in order to establish a comparison between the GPI control presented in this paper and a standard PID control [50], denoted in the graphs as PID and whose control scheme is depicted in Fig. 9.
PID control scheme.
This case study was previously explained in Section 4.2 (see Fig. 7a). The instantaneous position of the patient in the circular rail is
Positioning graphs of the case study A: (a) starting configurations; (b) final configurations.
Figure 10a shows the configurations of the carts and the patient at the initial simulation instant. In this example, the trajectory generator selects the shortest path and assigns the role of master to cart
Distance according to path
As can be verified, the system selects the shortest path between the possible routes (clockwise or counter-clockwise). That is, the route in the counter-clockwise direction for cart
Figure 10b illustrates the final configurations reach-ed by the carts Q and S. Notice that the carts reach the desired positions, just as the RGB-D sensor has successfully rotated to point directly towards the patient. We also checked that the system has correctly selected the roles such that the total distance travelled by both carts is minimal (see Table 3). Since cart
Distance according to role
The next checked parameter was related with the angular positions of the pan of the RGB-D sensors of the carts. In this case, the angular position of cart
The data obtained for the these parameters are summed up in Table 4, showing that the system has correctly selected the route required to travel the shortest path for the angular positions of both carts’ pan. In this case, the routes are counter-clockwise and clockwise for the angular positions of the pan of the RGB-D sensors of carts
Pan according to path
After that, it was necessary to check the angular positions of the RGB-D sensors’ tilt of the carts. In this case, the angular position of the tilt of cart
3D graphs of case study A: (a) starting configurations; (b) final configurations.
Controlled evolution of cart 
The data obtained for the study are included in Table 5. Figure 11 depicts the 3D initial and final configuration of the system showing that the system has correctly selected the route required to travel the shortest path for the angular positions of both carts’ tilt. In this case, the routes are clockwise and counter-clockwise for angular positions of the RGB-D sensors’ tilt of carts
Tilt according to path
When grouping the aforementioned results, the reference trajectory vectors for carts
Input control evolution of carts 
Finally, Fig. 12 illustrates the controlled evolution of the angular positions of cart
Positioning graphs of the case study B: (a) starting configurations; (b) final configurations.
3D graphs of the case B: (a) starting configurations; (b) final configurations.
Controlled evolution of cart 
Input control evolution of cart 
Performance of the control methods (case study A)
Moreover, the performance of the control methods have been measured in terms of the integral squared tracking error,
This case study is the one previously represented in Fig. 7b, where the instantaneous position of the patient in the circular rail is
The intelligent trajectory generator foresees a collision of both carts and selects the optimal movement of the carts (which is given by the minimum path travelled by the two carts) and immediately changes the roles of the carts, with cart
Figures 14 and 15 show the projection on the XY-plane and the 3D view of the initial and final configuration of the system, respectively. It is observed that the system has correctly selected the route required to travel the shortest path, demonstrating the effectiveness of the proposed intelligent trajectory planner and achieving that the final angular position of cart
On the other hand, Fig. 16 depicts the controlled evolution of the angular positions of cart
Additionally, Table 7 shows the performance measures for the control methods. Again, the GPI control has been found to have a better dynamic response than the PID control and shows a better performance of the proposed control in terms of ISE, IAE and ITAE.
Performance of the control methods (case study B)
This paper has introduced an intelligent trajectory generator and a GPI control law for the motion of two carts, each equipped with an RGB-D sensor, on a circular motorised rail. The ultimate objective of the system described was a continuous monitoring of the facial emotion expressed by the patient and the physical rehabilitation exercises performed. This is thought for the evaluation of physical rehabilitation exercises by calculating possible deviations from the optimal gestures, while simultaneously assessing the patient’s degree of comfort during rehabilitation by monitoring his/her felt emotions.
The proposed feedback control scheme was based on an exact feed-forward action combined with a velocity vector structural estimation using a model-based integral state re-constructor that allowed us to achieve a trajectory tracking controller, guaranteeing to track the desired trajectories in an exponential asympto-tically stable nature. This was done without the use of state measurements, or without devising the dynamic systems normally employed to solve state estimation problems, as traditionally provided by asymptotic state observers.
Moreover, it was not necessary to use low-pass filters to improve the noise estimation of output time derivatives by means of sampling and discrete appro-ximations. Furthermore, the proposed intelligent trajectory generator comprised the references required to move the carts based on the instantaneous position of the patient inside the circular rail and the current configuration of the two carts. It also established a role (master or slave) for each cart, the direction that each cart had to follow, and generated smooth trajectories that avoided collisions between the carts.
The paper, therefore, has described the displacements of both carts and the positioning of the tilt and pan angles of each RGB-D sensor so as to track the patient’s face and the rehabilitated body part from the best viewpoints. In addition, the paper has also described a couple of case studies that demonstrate the effectiveness of the proposed approach, with a high performance of the feedback regulation scheme in the stabilisation and the trajectory tracking tasks of the carts, while security was maintained to ensure that both carts never would collide during their tracking of the person undergoing a rehabilitation program.
Given the results obtained in simulation, our future work will focus on the development of a real laboratory experimental platform. Tests will be performed to evaluate the performance of the trajectory planner and the GPI controllers of both carts in real physical rehabilitation scenarios. In addition, real images captured from RGB-D sensors will be processed to validate the current proposal.
Footnotes
Acknowledgments
This work was partially supported by Spanish Mini-sterio de Ciencia e Innovación, Agencia Estatal de Investigación (AEI) / European Regional Development Fund (FEDER, UE) under PID2019-106084RB-I00 and DPI2016-80894-R grants, by CIBERSAM of the Instituto de Salud Carlos III, and by VALU3S EU project (H2020-ECSEL grant agreement no 876852).
