rule, DEVELOPMENT OF CONTROL FOR THE ANKLE JOINT SIMULATOR APPLIED TO THE PROBLEM ON VERTICAL POSTURE BALANCE OF A

The optimal ankle joint controller based on the model that describes the system of human vertical balance in response to small disturbances was developed. The method for optimization of the selection of control matrices was proposed, which leads to stabilization, taking into consideration the requirements of comfortable return of a human to the equilibrium position, minimization of the efforts of a simulator of the central nervous system (CNS). With a view to understanding the ways of functioning of the CNS, the operation of its departments responsible for stabilization was analyzed, which makes it possible to apply this knowledge to the problem of the balance of the vertical posture. The research is limited to the study of functioning of the ankle joint in terms of its influence on the posture stabilization. The merit of this research is the development of a methodological platform for further simulation of functioning of the ankle, knee and hip joints in totality and determining the optimal choice of the CNS management strategy. The research supports the hypothesis that at small disturbances in the sagittal plane, the key role in stabilization is played by the ankle joint. The law of the controller management was presented and its model implementation was carried out. To do this, we used the actual values of operating points, obtained based of the program platform of movements tracking Opti Flex Track 13 which simulates human movements in real time. The results are of value in the process of studying the vertical stabilization of a human. Simulation of operation of different muscle groups taken together is essential for rehabilitation of patients with CNS problems at reduced muscle activity. The results are useful for the design of a functional electrical CNS stimulation controller, development of the technical rehabilitation facilities for people who are at risk of falling


Introduction
Some of the most complex and relevant scientific problems of today are the problems of designing, modeling, analysis and control of biomechanical systems and mechatronics systems, because the needs of the people with the problems of the central nervous system and the muscular-skeletal system have been increasing recently. Various mathematical modeling of human biomechanics simulation is used at present. Thus, in papers [1][2][3][4][5], the dynamic models of varying complexity were used in the study of coordination of movements in mammals. Based on the aforementioned scientific research, it is necessary to note one interesting fact: upright anthropoid subjects and objects react in a certain way to disturbance by shifting back of the movable support surface. Specifically, they move in the sagittal plane and use one strategy or a combination of two strategies provided the feet are not movable. For small displacements [6], as a rule, knees, hips are neck keep a rather upright position, mostly ankle joints ("ankle joint strategy"-AS) move in this case. Instead, another motion is used, as a rule, to coordinate displacements that hold the weight center of a human within the foot support perimeter. Specifically, bending or expansion of hip muscles with a smaller simultaneous extension or bending of ankle joints ("hip strategy" -HS) at keeping the other joints relatively immobile. We use the model in the space of states for the simulation of such position displacements in the sagittal plane. It makes sense, because the dynamics of the general senso-motor system can be linearized in operating points, selected in a certain way, without a significant impact on the model accuracy. Thus, the studied problem of the adaptation of the methods of control systems analysis for the improvement of the existing models of biomechanics and mechatronics is relevant. Its solution can be applicable for an explanation of the selection of AS or HS strategies in application for the description of functioning of separate CNS departments.

Literature review and problem statement
Papers [7,8] report results of the simulation of muscular-skeletal biomechanics based on AS and HS strategies. It was shown that such systems can be described using the ground reaction forces and electromyograms, but have a limited applicability.
Papers [9][10][11] also dealt with the research into the problems of CNS control based on the above simulation approaches, and single-and double-link models of an inverted pendulum were developed in order to stabilize the equilibrium position, the feedback control was calculated and the identification method was proposed. In paper [12], a complex model of the skeletal-neuro-muscular system based on the optimal linear-quadratic control (LQR-control) was developed. This feedback model is used to the control analysis based on the database of the position, muscle length and muscle rigidity. Papers [13,14] proposed the model that includes the minimum sets of states of the dynamic system for body stabilization, which is in the best way consistent with the experimental results [15][16][17][18]. Paper [15] focuses on the validation of the generalized model of translational dynamics and a human and the control in the sagittal plane. In article [16], the simulation strategies, associated with somatic-sensory and vestibular losses, are presented, and in article [19], the interaction between the single-and multi-joint muscular systems is explored. In paper [20], the biomechanical model of the muscular-skeletal system of a human with inertial effects is studied. The above studies demonstrate that the AS is effective at small disturbances, while greater dependence on HS is observed when disturbances become larger in size. The HS strategy turns out to be more effective to stabilize the body weight center than the AS strategy even in the absence of the constraints, which influences the selection of the control model.
However, the problem regarding the application of these models to the issues of simulation of functioning of the nervous system departments responsible for the stabilization of the vertical balance of a human remains unresolved. For example, these models do not explain the selection of the strategies of ankle and hip joints control, described in [7]. This could be caused by objective difficulties, associated with the adequate description of all possible muscle groups based of the electromyogram, by the impossibility of measuring the respective physical magnitudes, significant costs of preparation of experimental setups and equipment, which makes the corresponding studies inappropriate.
The option of overcoming these difficulties in using the available models is a fundamentally different approach, based on the so-called FAS method [1]. Within this approach, the dynamics system is constructed based on determining only kinematic magnitudes. To describe the entire set of possible angular accelerations achieved by joints, the realistic accelerations sets, taken from the experiments, are used. In contrast to the above studies, the FAS method will make it possible to analyze the AS and HS strategies based only on the kinematic magnitudes, which will enable us to obtain specific results that vary, depending on the disturbance size [7].
All this gives grounds to argue that having the specified effective tool (FAS method), constructed based on the dynamic model and a number of hypotheses concerning functioning of CNS of a human, it is advisable to conduct a study of the simulation of the operation of the joints, which are responsible for the human posture stabilization. This will make a significant contribution to the solution of the relevant problems of biomechanics and mechatronics. That is why the search for the optimal control strategies for specific applications requires a reasonable selection of the most expedient and convenient-to-use methods. In this context, the dynamic control model in the states space and the FAS method are the key tools that can be applicable to solving the above problems. To design the optimal ankle joint controller, the model built on the basis of the aforementioned FAS approach is used. This research is extension of [1,13,17,18] in the direction of study into muscular coordination.

The aim and objectives of the study
The aim of this work is to develop the optimal controller for the ankle joint simulator based on the dynamic model, which describes the system of the steady vertical balance of a human in response to small disturbances.
To achieve the set goal, the following tasks have been set: -to develop control strategy for the ankle joint in order to stabilize the posture of a human in response to small disturbances in the sagittal plane based on the dynamic model of the muscular-skeletal system of a lower limb of a human; -to develop a method to optimize the selection of control matrices coefficients, which leads to the stabilization, taking into consideration the requirements of a comfortable return of a human to the equilibrium position, minimization of nervous efforts of a simulator of the central nervous system (CNS); -to carry out model implementation of the developed controller in operating points, which are obtained based on the software platform of tracking movements in real time.

Description of the mathematical model of control object in the space of states
The considered model was proposed and described in detail in [1], the model has three coordinates of the phase vector of states: joint angular displacements, velocity and acceleration (vectors x, respectively), as shown in Fig. 1.
These coordinates of the phase vector of state describe the basic dynamics and the most important characteristics of the system -angular displacements of the hip (hip), knee (knee), and ankle (ankle) joints, velocity and acceleration. Joint torque moments produced by muscles and external forces are caused by disturbances that influence the body, due to which a movement is described by the components of this state vector.
Kinematical characteristics of x, x and the moments are the variables that are subject to measurement or assessment. This model of the control system is supposed to obtain the vector of target values from the higher levels of the CNS, compares it with the measured state and generates the control command u.
The first requirement for the model is that it should adequately reflect the behavior of the input/output systems of the human CNS, consisting of sensors, a controller and effectors. Although it consists of many nonlinear elements, the CNS is supposed to act linearly in the neighborhood of the point corresponding to the vertical static standing. The model of the control system takes the form: where ank u and hip u are the controlling signals of the CNS, specifically, the ankle strategy (AS) and the hip strategy, respectively. Determining control as a totality of the ankle and hip strategies, the main basis b is used for the identification of joint angular accelerations.
Let us describe this model (1) in detail. To identify the control systems in the space of states, we used a set of acceptable acceleration set (FAS) [1]. This is a set of three main acceleration vectors, which was determined in different possible combinations that can produce all the possible postural movements. That is, the totality of all joint angular accelerations, collected in vector x that can be obtained by any combination of possible activations of muscles (that is, with normalized activation coefficients in the range of ≤ ≤ 0 1 i a for = 1,2,..., i m of muscles). FAS can be found using the data obtained from the equations of motion, geometry of locomotor system and muscular properties, assuming that muscles contract slowly [1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18]. Thus, the FAS is used as the measure of acceleration that can be achieved in any direction in the place of force application on a hip, ankle, in knees for the assigned nervous force level. Thus, nervous forces are equivalent to the amount of muscular strength, normalized to the maximum possible applied force.
Let us consider the case of small displacements in the sagittal plane. In this case, the AS strategy is the key strategy in the process of body returning a body to the equilibrium position. Let us determine the constraints that occur in this case and which may affect the selection of control options and are imposed on the system of the human body mechanics. These constraints, firstly, include holding the knees straight. This fact is experimentally revealed in the reactions of a human to the inverse disturbances of the support surface that push the body forward; secondly, keeping feet on the supporting surface; thirdly, there are constraints to maximum muscular forces (for details, see [13,17]). The restriction is also the horizontal shaking the body weight center, which should not go beyond the basic parts of the surface of the support to ensure sustainability.
The equation of described constraints takes the form: where x is the vector of joints angles. Thus, the linear control system of decreased order that takes into consideration the above limitations (3), (4) takes the following form [1] where is the vector of state and control takes the form, respectively: Matrices of systems A, B taking into consideration both the mechanics of the body and the dynamics of the relevant sensors depending on the desired complexity of a model take the form The model under consideration includes minimum sets of states. In order to detect the difference between disturbances, which can be resisted by the AS strategy, and those that use the HS strategy, CNS must have the information from the lower and upper sensors of the body to assess the movement of the weight center. It is assumed that there is a feedback from the sensors in the upper body to the muscles of legs [16]. That is why we take into consideration the condition that all mechanical conditions of the CNS in arbitrary implementation are available or evaluated for using in the formation of controlling signals.
Model (5) with limitations (3) and (4) is a dynamic model in the space of states of the muscular-skeletal system of a lower limb of a human. This model simulates the operation of the ankle joint and is suitable for the development of the balance control of the vertical position of the human, is especially well-suited for simulation and is a convenient experimental platform. This serves as an ideal starting point for applying modern mathematical control methods to the problem of CNS control of various types.

Design of the optimal controller and statement of the control problem
To obtain the trajectories that minimize the objective function that assesses the deviation of the state of the phase vector from the target one, linear-quadratic controller (LQR-control) is used. This regulator generates feedback that provides smoothness and stability of a trajectory. The control selection censor uses actual data about the current state of the system for selecting control signals necessary for combating disturbance. Because the body dynamics is considered close to linear in the studied neighborhood, the controller can also be linear for limited disturbance. According to this, the controlling center selects a suitable matrix of the controller's coefficients.
The HS strategy can be defined as the movement along constraints (3), whereas the AS strategy is based on generating angular accelerations along the ankle axis. These two strategies, described by phase vectors in the space of joint acceleration of a leg and a hip, can serve as the main basis for all possible movements of joints. Thus, any movement (in which knees are kept evenly) can be expressed as a combination of the AS and HS strategies.
The aim of the control design is the following. It is necessary to direct the states of phase vector ( ) x t to correspondingly established target values ( ), x t determined from the experimental data. These data are obtained from the biomechanical experimental measurements [2, 21], carried out using software for tracking the movement OptiTrackFlex13 with the appropriate software. The static map values of target control values are formed during the simulation of the human ankle joint operation in the process of inverse body stabilization [2]. They include the initial deviations of the torso, the coordinates of the equilibrium position and the return velocity.
In this case, the prerequisite is obtaining the information about the feedback state with the help of the evaluation or through appropriate sensors. Suppose that the CNS acts as the LQR controller. If the CNS has similar targets and similar criteria of effectiveness, the LQR control system will produce a smooth stable trajectory of realization of states, similar to the one observed in people in response to small disturbances.
Thus, we consider the problem of determining the optimal feedback control ( ) u x for the linear system (5) at the above constraints (2) to (4). The proposed controller adjusts the state of the system (5) to assigned target values, determined by using experimental data.
In order to direct the system (5) to target values = ( ) , x t x we will make replacement = ( ) , x t x = + , u u v where y is a new independent variable and u is selected from condition + =0.

Ax Bu
We will obtain − = − 1 , u B Ax and system = + , y Ay Bv will have the zero-equilibrium position.
Thus, it is necessary to find unknown matrix K in order to obtain feedback.
so that the system (5) of feedback should have the following properties: -u(x) reaches asymptotic stability of equilibrium; -u(x) minimizes the quality functional ( ) where Q and R are the weight matrices of deviations of states x and controls u from nominative values x and u, respectively. The optimal trajectory of state under the influence of the controller minimizes functional (7). The law of control ( ) u x directs the system asymptotically to the target value of phase vector x(t). Matrices Q and R are arbitrarily selected in order to meet the condition of positive certainty. Now we will consider the quadratic form where P is the constant symmetric positively determined matrix. The surfaces of the level of the Lyapunov matrix V are the ellipsoids in the space of states x(t). If < 0 V along all trajectories (with the exception of = , x x where = 0 V ), then all the trajectories are asymptomatically approximated to x under the influence of control (6), since V is the function that has a single global minimum in point x . These Lyapunov functions can be optimized as it is shown in [22] in terms of minimization of the nervous efforts of the CNS and energy consumption. The trajectories of the phase vector over time approach .
x Based on the known theoretical base, we solve the algebraic Riccati equation and obtain the matrix of coefficients − = 1 T . K R B P We use numerical MatLab methods, which are described below, to solve these equations. The designed controller provides a globally asymptotically stable equilibrium position; its reliability follows from the equation of Hamilton-Jacobi-Bellman [23]. An important feature of such statement of the control problem is that the variations of possible control strategies HS and AS can be included in the objective function according to a specific set goal. In this case, the effectiveness of the objective function is determined by the ability to meet different control targets, the model is compatible with the results of other researchers [13,14].

1. Analysis of experimental data and selection of operating points
The necessary biomechanical experimental tests were carried out on the test setup with the help of the movement tracking program Opti Flex Track 13 with the appropriate software in the scientific research lab, located at Łodź University. When simulating disturbances in equilibrium position of a human in the sagittal plane and the process of returning to the upright position, the target values of velocities and coordinates were obtained. The type of deviations "forward" and reverse return due to the ankle joint were considered (Fig. 2). To perform analysis, experimental studies for a healthy male (body weight of 70 kg and height of 183 cm) were carried out and a series of disturbances of various types was implemented.
Combining OptiTrack with the own algorithms of processing in real time, the camera can track movements within the admissible values less than 0.5 mm and is ideal for the detailed and comprehensive movements tracking. OptiTrack platform was used for obtaining high-precision biomechanically relevant data using the appropriate sets of biomechanical markers that are included in the system assembly.
The testing data are stored and transmitted for further analysis in MatLab environment. Fig. 2 shows the deviation from the equilibrium position for experiment 2. The maximum possible deviation forward of a healthy human, in which the weight center is still in the foot plane, was recorded. The controlling element in the area of ankles will return the object to the position of equilibrium.  Table 1 and are accessible to the controller in real time.
Using the available instruments of MatLab, the operating values of angular velocities of the return trajectory were calculated. The range of data [350-500] corresponds to the time interval t(s)=[4; 7.2] (Fig. 3). Data downloading and the visualization (plotting) were performed using the corresponding toolbar Curve Fitting. Fig. 3, 4 show the return trajectory for one of the experiments: temporal dependence of the sine of the ankle joint deviation angle. The values of angular velocities and initial data for the three experiments were included in Table 1.

2. Selection of matrix coefficients of the controller and optimization
Instead of the "trial and error" method for selecting each element of the respective matrices [1], it is proposed to use the optimization method for the most effective selection of control matrices, so that physical magnitudes that are related to the stabilization the equilibrium position of a human could be regulated. This optimization reduces the solution search space and takes into consideration the limitations imposed by the biomechanics of the system.
The control center assesses the state of the system after disturbances, and then sets the parameters of the control matrix. The designed control law ensures robustness, that is, the states of the system are finally stabilized and reach the above determined target values and the error system is reduced to zero. Using Control System Toolbox of the MatLab software environment, we will calculate a unique solution X of the matrix equation of Riccati. To calculate the respective matrices that determine the system control law, we will use command care that yields the solution to the matrix equation by Riccati. To obtain the solution and control functions, which direct the states of the system to their target values, and assuming the absence of movements of knee joints, we make the selection of weight matrices R and Q. These matrices are selected from the condition of the minimum of quality functional, that is, at minimum consumption of nervous efforts and energy so as to prevent unwanted deviations of the states of the system from a stable upright position.
2) Calculation of coefficients of the Lyapunov function. Verification of the condition: matrix Q must be determined positively.
Calculation of the Lyapunov function where Dx is the deviation of states. Solution of Riccati equation, obtaining the control matrix.
3) Calculation of quality criterion J.

4) Optimization of the Lyapunov function and quality criterion. Application of the iteration procedure.
Step 1.
We increase the first element of the vector by small magnitude → + D 1 0 11 11 , q q q leaving other coordinates without changes. We will calculate the Lyapunov function and functional 1 , J according to stage (3). After this, we will decrease the first element of the vector by small magnitude → − D 2 0 11 11 , q q q leaving other coordinates without changes. Verification of condition Q -is positively determined, solution of Riccati equation, obtaining the control matrix. We will calculate the Lyapunov function and functional 2 .
J We will select the maximum and value among these three calculated values of functional and fix value q 1t that is correspondent to it.
Step 4. Transition to the second coordinate → ± D 1 0 12 12 q q q and performance of similar actions. After this, the value, at which value of J is maximum, is accepted.
Performance of similar calculations regarding other coordinates of vector C. The first calculation cycle is completed.
Step 6. The second cycle of iterations. After the repetition of the procedure as for all coordinates with deviation D , q a new, smaller deviation D < D 1 , q q is selected and the procedure is repeated with a new deviation.
The third cycle of iterations. After completion of the second cycle of iteration, the deviation decreases again, that is D < D 2 1 , q q and the procedure lasts till the required accuracy degree.
To improve the control law, matrix Q can be parametrized by magnitudes that correspond to the size disturbance and the corresponding contribution of the used strategies HS and AS, related to the constraints that make it possible to keep feet straight on the ground. Matrix R models the efforts related to the movement of the system's poles. The contribution to implementation of the AS and HS strategies is taken into consideration in matrix R. In turn, matrix Q is selected positively determined, it is restricted to the assessment of only angular deviations of joints, excluding the assessment of joints' velocities. Parameters of Q matrix make it possible to control the magnitudes of joints' velocity and thus the relative attenuation of the system. The optimized LQR controller provides well attenuating control system which adequately approximates both desired and actual behavior.

1) Target values of deviations of joint angles are equal to zero
For target values of joint angles and final velocities that are equal to zero (in accordance with equilibrium position) and weight matrices The new stabilized matrix of the system takes the form: which proves the stability of the obtained matrix of the system. We will model the stabilized system in MatLab based on the use of the solver for solving the system of differential equations ode45. Fig. 5 shows the results of modeling and the stabilized trajectories of the system. Temporal dependences of joint angles and velocities demonstrate sustainable behavior Numerical data of the controller validation in the selected operating points are shown in Table 2.
Modeling the trajectories of the stabilized system, the vectors of the state of which follow target values under the influence of the obtained control laws (numerical data are presented in Table 2), is shown in Fig. 5. Fig. 6 shows the stabilized velocities of ankle joints that follow their target values.
In the general case, the target values can be obtained from a number of sensors (for example, proprioceptors of the hip, vestibular organs), which can provide such data as position and velocity. In this context, the presented model can be integrated with similar models for the state assessment to create a complete model of the senso-motor control of the equilibrium position of a human, which includes the vector of outputs and the vector of states. The optimal controller that simulates the operation of a joint of a human in the process of reverse return to the equilibrium position in response to small disturbances was obtained. The conducted analysis and experimental research prove the hypothesis that in a certain approximation, the CNS behaves like a linear-quadratic controller LQR, at least in the case of the vertical balance stabilization. This is also proved by the following considerations. While dynamics and optimization of nervous efforts of the CNS can be adequately described by quadratic function of states and control elements, the LQR is a natural choice for modeling the CNS behavior. It is possible to argue that CNS functions as an optimal controller, because it uses all possible reserve datasets of both effectors and sensors, depends on states   , ank x and controls, while simultaneously satisfying the conditions described above. It is important to note that the system of LQR is a perfect linear system in the neighborhood of the operating points, which best describes the process of regulation of the postural balance of a human, minimizing quadratic function of quality. This study is a continuation of paper [1], its task is to show how external disturbances, applied to a body, affect its movement and reverse stabilization. The law of optimum control that simulates the work of the ankle joint of a human to ensure a steady vertical balance was obtained. The method of the optimization of selection of control matrix coefficients, which makes it possible to vary its numeric values, taking into consideration the specific requirements for the controller, was presented. Specifically, at most comfortable return of a human to the equilibrium position, the coefficients are chosen so that the desired trajectory would approximate the experimentally studied one. Provided the nervous efforts of the CNS simulator are minimized, the Lyapunov functions are optimized according to the presented optimization algorithm.
Modeling of the trajectories of the system under the action of the developed controller in the operating points, which were obtained based on the software platform of movement tracking in real time, was implemented. To do this, the actual values of the operating points, obtained based of the conducted experiments, were used.
Modeling resulted in obtaining the functions of the control laws in the matrix form for a number of target values, and the simulation of behavior of the system under the action of these laws was performed.
The use of the proposed iterative algorithm ensures that the states of the system are finally stabilized to some desired positions, and the estimation error is reduced to zero. Unlike [1], the developed optimization method is designed for the most effective selection of each element of the respective matrices with respect to stabilization of the equilibrium position of a human. This optimization reduces the solution search space and takes into consideration the limitations imposed by the biomechanics of the system. Control signals produced by optimal selection of each physical magnitude may be tested for result effectiveness, optimality and providing the control aim. It gives the information about what combinations ensure behavior that is most similar to the experimentally studied one during the operation of the real CNS of a human.
This research is limited to the comprehensive studying of functioning of the ankle joint and its impact on the posture stabilization of a human. Subsequently, it will be continued by the development of the optimal control of the ankle, knee and hip joints in totality and determining a set that best describes the selection of the CNS. For our specific problem, the simulation of functioning of various muscle groups is of great importance for the treatment and rehabilitation of patients with CNS problems in cases of decreased muscle activity. In addition, the results obtained in this research can be useful for such purposes as the design of functional electrical controller of the CNS stimulation or the development of technical means of rehabilitation for the people who are at risk of falling. The studied model is also ideal for exploring the issues that arise in the experimental study of the posture of a human.
The developed methodology for designing controllers-simulators will subsequently enable the simulation of functioning of the ankle, knee and hip joints. Based on the presented procedure, it is possible to obtain the target values of angular deviations, initial deviations and velocities. During varying and investigating the contribution of HS and AS strategies, as well as knee joints, it is possible to determine the optimal set of strategies that best describes the selection of the control of the central nervous system for the person who is at risk of falling.