

{"id":150,"date":"2015-10-02T16:05:28","date_gmt":"2015-10-02T16:05:28","guid":{"rendered":"http:\/\/project.inria.fr\/softrobot\/?page_id=150"},"modified":"2017-04-03T15:07:41","modified_gmt":"2017-04-03T15:07:41","slug":"real-time-inverse-simulation-method","status":"publish","type":"page","link":"https:\/\/project.inria.fr\/softrobot\/documentation\/real-time-inverse-simulation-method\/","title":{"rendered":"Real Time Inverse Simulation Method"},"content":{"rendered":"<h1><strong>Introduction<\/strong><\/h1>\n<p>This section details the formulation that is used for real-time inverse method on FEM. It describes how it can\u00a0be used to estimate the external loads, pressures, displacements&#8230; that lead to a given\u00a0deformation. The static FEM accounts for non-linear geometrical deformations\u00a0and integrates over the structure a Hookean constitutive law. During\u00a0each step i of the simulation, a linearization of the internal forces is computed:<\/p>\n<p align=\"center\">f(x<sub>i<\/sub>) \u2248 f(x<sub>i\u22121<\/sub>) + K(x<sub>i\u22121<\/sub>)dx \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0(1)<\/p>\n<p>where f provides the volumetric internal stiffness forces at a given position x\u00a0of the nodes, K(x) is the tangent stiffness matrix that depends on the actual position of the nodes and dx is the difference between consecutive positions in time dx = x<sub>i<\/sub>\u00a0\u2212 x<sub>i\u22121<\/sub>. The lines and columns that correspond to fixed nodes are removed from the system to improve the condition number of the matrix K. Static equilibrium (the sum of external and internal forces equal to zero) is sought at each step:<\/p>\n<p align=\"center\">\u2212K(x<sub>i\u22121<\/sub>)dx = p + f(x<sub>i\u22121<\/sub>) + J<sup>T<\/sup>\u00a0\u03bb \u00a0 \u00a0 \u00a0 \u00a0(2)<\/p>\n<p>where p accounts for the external forces (e.g. gravity) that are known and J<sup>T<\/sup>\u00a0\u03bb gathers the\u00a0contributions of the Lagrange multipliers. Two types of multipliers are defined:<\/p>\n<p><strong>actuators multipliers \u03bb<sub>a<\/sub><\/strong>:\u00a0we use these constraints to describe the external efforts applied on the boundaries (such as pressure for instance). The\u00a0location of the boundary conditions are supposed to be known, the directions of\u00a0the effort J<sup>T\u00a0<\/sup>can be updated at each step, and \u03bb<sub>a<\/sub>\u00a0is the unknown intensity of\u00a0the efforts. We can set (and update at each step i) an interval of\u00a0potential values as min \u2264 \u03bb<sub>a<\/sub>\u00a0\u2264 max.<\/p>\n<p><strong>effectors multipliers \u03bb<sub>e<\/sub><\/strong>: as we don&#8217;t want to act on the effectors but only on the actuators, we assign \u03bb<sub>e<\/sub>\u00a0= 0.\u00a0Even if they are null, these multipliers are useful to\u00a0build the optimization problem.<\/p>\n<p>Indeed, the next step consists in the projection of the FEM model equations\u00a0into the constraint space: the size of matrix K is often very large so an optimization\u00a0in the motion space would be very computationally expensive. Instead,\u00a0using the Schur complement of the constraint problem, we do a projection that\u00a0drastically reduces the size of the search space.\u00a0Thus three steps are performed.<\/p>\n<p><strong>Step I:<\/strong>\u00a0a free configuration x<sup>free<\/sup>\u00a0of the deformable model is found by solving\u00a0equation (2) with \u03bb = 0. For the constraints defined on effectors, we\u00a0compute a violation noted \u03b4<sub>e<\/sub><sup>free<\/sup>. For instance, in a position effector,\u00a0\u03b4<sub>e<\/sub><sup>free<\/sup>\u00a0provides a vector between the effector position during the free motion and the desired position.<\/p>\n<p><strong>Step II<\/strong>: This step is central in the method. It consists in projecting the mechanics into the constraint space. As the constraints are the inputs (effectors) and outputs (actuators) of the inverse problem, we obtain the smallest possible projection space for the inverse problem:<\/p>\n<p align=\"center\">\u03b4<sub>e<\/sub>\u00a0= J<sub>e<\/sub>K<sup>\u22121<\/sup>J<sub>a<\/sub><sup>T<\/sup>\u03bb<sub>a<\/sub>\u00a0 + \u03b4<sub>e<\/sub><sup>free<\/sup>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0(3)<\/p>\n<p align=\"left\">We will note W<sub>ea\u00a0\u00a0<\/sub>= J<sub>e<\/sub>K<sup>\u22121<\/sup>J<sub>a<\/sub><sup>T<\/sup>.\u00a0\u03b4<sub>e<\/sub>\u00a0represents a vector between actual positions of effector points and positions that effectors have to reach.<\/p>\n<p><strong>Step III<\/strong>: The final configuration, at the end of\u00a0the time step, is corrected by using the value of the constraint\u00a0response:<\/p>\n<p align=\"center\">x\u00a0= x<sup>free<\/sup>\u00a0+ K<sup>\u22121<\/sup>J<sub>a<\/sub><sup>T<\/sup>\u03bb<sub>a<\/sub><\/p>\n<h1><strong>Quadratic programming<\/strong><\/h1>\n<p>In the case of a Quadratic Programming (QP) problem, during the <strong>Step II<\/strong>, one sets a QP by minimizing the norm of the vector \u03b4<sub>e<\/sub>\u00a0given in (3).<\/p>\n<p align=\"center\">min( 1\/2 \u03b4<sup>T<\/sup><sub>e<\/sub>\u00a0\u03b4<sub>e\u00a0<\/sub>) = min( 1\/2 \u0014\u03bb<sub>a<\/sub><sup>\u0015T<\/sup>\u0014W<sup>T<\/sup><sub>ea<\/sub>W<sub>ea<\/sub>\u03bb<sub>a\u00a0<\/sub>+ \u03bb<sub>a<\/sub>\u0015<sup>T<\/sup> \u0014W<sub>ea<\/sub>\u03b4<sub>e<\/sub><sup>free\u00a0<\/sup>) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0(4)<\/p>\n<p align=\"center\">subject to min \u2264 \u03bb<sub>a<\/sub> \u2264 max and \u2212 \u03b5\u00a0\u2264 \u03bb<sub>e<\/sub> \u2264 \u03b5<\/p>\n<p align=\"left\">The size of the QP problem is much smaller than solving the problem in the motion space of equation (2), allowing to solve this problem in real-time. This type of problem can be solved by a variety of methods.\u00a0The matrix of the QP, ie. W<sup>T<\/sup><sub>ea<\/sub>W<sub>ea,<\/sub> is symmetric. If the number of actuators is equal or less than the size of the effector space, the matrix is also positive-definite. In that case, the solution of the minimization is unique. In the opposite case, i.e when the number of actuators is greater than the degrees of freedom of the effector points, the matrix of the QP is only positive-semidefinite. Consequently, the solution could be non-unique.<\/p>\n<p align=\"left\">In such case, some QP algorithms are able to find one solution among all possible solutions. A new criterion for the minimization can also be introduced, based on the deformation energy. Indeed, this energy W<sub>def<\/sub> is linked to the mechanical work of the forces exerted by the actuators. E<sub>def<\/sub> can be computed while evaluating the dot product between \u03bb<sub>a<\/sub> and the displacements of the actuators \u2206\u03b4<sub>a<\/sub> = \u03b4<sub>a<\/sub> \u2212 \u03b4<sub>a<\/sub><sup>free<\/sup>\u00a0due to the actuator forces E<sub>def<\/sub> = \u03bb<sub>a<\/sub><sup>T<\/sup> \u2206\u03b4<sub>a<\/sub> = \u03bb<sub>a<\/sub><sup>T<\/sup>W<sub>aa<\/sub>\u03bb<sub>a<\/sub>, with W<sub>aa<\/sub>=\u00a0J<sub>a<\/sub>K<sup>\u22121<\/sup>J<sub>a<\/sub><sup>T<\/sup>. Yet, matrix W<sub>aa<\/sub> is positive-definite if the actuators are placed on different nodes of the FEM or with different directions (i.e\u00a0if there is no linear dependancy between lines of J<sub>a<\/sub>). Thus, we can add this energy in the minimization process by replacing equation (4) by:<\/p>\n<p align=\"center\">min \u0012(1\/2 \u00a0\u0014\u03bb<sub>a<\/sub><sup>\u0015T<\/sup>(<sub>\u0014<\/sub>W<sup>T<\/sup><sub>ea<\/sub>W<sub>ea\u00a0<\/sub>+ \u03b5W<sub>aa<\/sub>)\u00a0\u03bb<sub>a\u00a0<\/sub>+ \u03bb<sub>a<\/sub>\u0015<sup>T<\/sup>\u00a0\u0014W<sub>ea<\/sub>\u03b4<sub>e<\/sub><sup>free<\/sup>) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0(5)<\/p>\n<p align=\"left\">with \u03b5\u000f chosen sufficiently small so that the deformation energy does not disrupt the quality of the effector positioning. In practice, we use\u00a0\u03b5 \u000f = 1e-3 ||W<sup>T<\/sup><sub>ea<\/sub>W<sub>ea<\/sub>||<sub>\u221e<\/sub> \/ ||W<sub>aa<\/sub>||<sub>\u221e<\/sub> . Thanks to this modification, the QP matrix becomes positive-definiteand a unique solution of the problem can be found.<\/p>\n<h1><strong>Gauss Seidel<\/strong><\/h1>\n<p>One can also use a Gauss-Seidel (GS) iterative solver to find a solution among the possible solutions. \u00a0Let\u2019s consider that \u2206\u03b4<sub>i<\/sub> provides the shift between the position of the effector and a desired position along direction <em>i<\/em>: \u2206\u03b4<sub>i<\/sub> = \u03b4<sub>i<\/sub>\u2212\u03b4<sub>i<\/sub><sup>desired<\/sup>. We want to find a position on the actuators that deforms the structure so that \u2206\u03b4<sub>i<\/sub> = 0.\u00a0During each iteration <em>it<\/em>, the algorithm updates one by one the contribution \u03bb<sub>j<\/sub> of each actuator <em>j<\/em>, while freezing the contribution \u03bb<sub>k<\/sub> of the other actuators.<\/p>\n<p align=\"center\">\u03b4<sub>j<\/sub> \u2212w<sub>jj<\/sub>\u03bb<sub>j<\/sub><sup>(it)<\/sup>\u00a0= <span style=\"font-size: large;\">\u2211<\/span><span style=\"color: #999999;\"><em><sub>k=0,k&lt;j-1<\/sub><\/em><\/span> w<sub>jk<\/sub>\u03bb<sub>k<\/sub><sup>(it)<\/sup>\u00a0+ <span style=\"font-size: large;\">\u2211<\/span><span style=\"color: #999999;\"><em><sub>k=j+1,k&lt;N<\/sub><\/em><\/span>\u00a0w<sub>jk<\/sub>\u03bb<sub>k<\/sub><sup>(it\u22121)<\/sup>\u00a0+\u03b4<sub>j<\/sub><sup>free<\/sup>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0(6)<\/p>\n<p>As we use a GS algorithm, when doing a local update on actuator <em>j<\/em>, the frozen contribution of the actuators [0 \u2192 j\u22121] comes from the current iteration <em>it<\/em> whereas the contribution\u00a0of actuators [j + 1 \u2192 N] (where N is the total number of actuators) comes from the previous iteration <em>it\u22121<\/em>. The local update of actuator <em>j<\/em> provides a new contribution \u03bb<sub>j<\/sub><sup>(it)<\/sup>\u00a0and the effector position \u03b4<sub>i<\/sub>, along direction <em>i<\/em>, is easily updated:<\/p>\n<p align=\"center\">\u03b4<sub>i<\/sub> += w<sub>ij<\/sub>(\u03bb<sub>j<\/sub><sup>(it)<\/sup>\u2212\u03bb<sub>j<\/sub><sup>(it\u22121)<\/sup>) = w<sub>ij<\/sub>\u2206\u03bb<sub>j<\/sub>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0(7)<\/p>\n<p>Thus, during the update of <em>j<\/em>, we can measure how the actuator can (or not) reduce the value of \u2206\u03b4<sub>i<\/sub>.\u00a0When performing this update in 3 dimensions, direction <em>i<\/em> is alternatively replaced by x, y and z. Imposing a variation of \u03bb<sub>j<\/sub> will create a 3D motion of the end effector:<\/p>\n<p align=\"center\">( \u03b4x \u03b4y \u03b4z )<sup>t<\/sup>\u00a0+= ( w<sub>xj<\/sub> w<sub>yj<\/sub> w<sub>zj<\/sub>)<sup>t<\/sup>\u00a0* \u2206\u03bb<sub>j<\/sub> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0(8)<\/p>\n<p>We will note\u00a0\u03b4<sub>*<\/sub>=\u00a0( \u03b4x \u03b4y \u03b4z )<sup>t<\/sup>\u00a0and w<sub>*j<\/sub>\u00a0= ( w<sub>xj<\/sub>\u00a0w<sub>yj<\/sub>\u00a0w<sub>zj<\/sub>)<sup>t<\/sup>. \u00a0\u00a0The control should try to reduce the shift between actual and desired positions, measured by \u2206\u03b4<sub>*<\/sub>. However, the actuator <em>j<\/em> can only move the effector along the direction given by w<sub>*j<\/sub>\/||w<sub>*j<\/sub>||. Consequently, we search for a value of \u2206\u03bb<sub>j<\/sub> so that:<\/p>\n<p align=\"center\">(w<sub>*j<\/sub>\u2206\u03bb<sub>j<\/sub> ) \u00b7 ( w<sub>*j<\/sub>\/||w<sub>*j<\/sub>||\u00a0) = \u2212\u2206\u03b4<sub>*<\/sub> \u00b7 ( w<sub>*j<\/sub>\/||w<sub>*j<\/sub>|| ) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 (9)<\/p>\n<p>This value can be obtained by using:<\/p>\n<p align=\"center\">\u2206\u03bb<sub>j<\/sub> = \u2212 (w<sub>xj<\/sub>\u2206\u03b4<sub>x<\/sub> + w<sub>yj<\/sub>\u2206\u03b4<sub>y<\/sub> + w<sub>zj<\/sub>\u2206\u03b4<sub>z<\/sub>) \/||w<sub>*j<\/sub>||<sup>2<\/sup> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 (10)<\/p>\n<p>Given the new value of \u2206\u03bb<sub>j<\/sub>, one can update \u03bb<sub>j<\/sub><sup>(it)<\/sup>\u00a0and the position \u03b4<sub>j<\/sub> of the actuator <em>j<\/em> using the GS equation (6).<\/p>\n<h1><strong>Bibliography<\/strong><\/h1>\n<ol>\n<ul>\n<li><a href=\"https:\/\/hal.archives-ouvertes.fr\/hal-00823766\/document\" target=\"_blank\">Control of Elastic Soft Robots based\u00a0on Real-Time Finite Element Method<\/a><\/li>\n<li><a href=\"http:\/\/hal.univ-lille3.fr\/file\/index\/docid\/1059667\/filename\/paper706.pdf\" target=\"_blank\">Introducing interactive inverse FEM simulation and its\u00a0application for adaptive radiotherapy<\/a><\/li>\n<li><a href=\"https:\/\/hal.inria.fr\/hal-01163760\/document\">Real-time control of soft-robots using asynchronous finite element modeling<\/a><\/li>\n<\/ul>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Introduction This section details the formulation that is used for real-time inverse method on FEM. It describes how it can\u00a0be used to estimate the external loads, pressures, displacements&#8230; that lead to a given\u00a0deformation. The static FEM accounts for non-linear geometrical deformations\u00a0and integrates over the structure a Hookean constitutive law. During\u00a0each\u2026<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/project.inria.fr\/softrobot\/documentation\/real-time-inverse-simulation-method\/\"><span>Continue reading<\/span><i class=\"crycon-right-dir\"><\/i><\/a> <\/p>\n","protected":false},"author":850,"featured_media":0,"parent":13,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-150","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/project.inria.fr\/softrobot\/wp-json\/wp\/v2\/pages\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/project.inria.fr\/softrobot\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/project.inria.fr\/softrobot\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/project.inria.fr\/softrobot\/wp-json\/wp\/v2\/users\/850"}],"replies":[{"embeddable":true,"href":"https:\/\/project.inria.fr\/softrobot\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":8,"href":"https:\/\/project.inria.fr\/softrobot\/wp-json\/wp\/v2\/pages\/150\/revisions"}],"predecessor-version":[{"id":785,"href":"https:\/\/project.inria.fr\/softrobot\/wp-json\/wp\/v2\/pages\/150\/revisions\/785"}],"up":[{"embeddable":true,"href":"https:\/\/project.inria.fr\/softrobot\/wp-json\/wp\/v2\/pages\/13"}],"wp:attachment":[{"href":"https:\/\/project.inria.fr\/softrobot\/wp-json\/wp\/v2\/media?parent=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}