Computational Design of Skinned Quad-Robots

We present a computational design system that assists users to model, optimize, and fabricate quad-robots with soft skins.Our system addresses the challenging task of predicting their physical behavior by fully integrating the multibody dynamics of the mechanical skeleton and the elastic behavior of the soft skin. The developed motion control strategy uses an alternating optimization scheme to avoid expensive full space time-optimization, interleaving space-time optimization for the skeleton and frame-by-frame optimization for the full dynamics. The output are motor torques to drive the robot to achieve a user prescribed motion trajectory.We also provide a collection of convenient engineering tools and empirical manufacturing guidance to support the fabrication of the designed quad-robot. We validate the feasibility of designs generated with our system through physics simulations and with a physically-fabricated prototype.


INTRODUCTION
T He design and construction of robots that can execute com- pelling motions is a challenging task.It requires careful geometric planning of robotic mechanisms and professional knowledge of the kinematic and dynamic behavior of the robot.Embedding such knowledge into procedures of computational robot design [1], [2] in conjunction with rapid prototyping techniques, such as 3D printing technology, bears tremendous potential to accelerate the construction of personalized robots.For instance, Megaro et al. [3] used a kinematic optimization algorithm for the design of multilegged robots consisting of rigid links.However, real-world creatures are not merely rigid skeleton rigs.The muscle and flesh surrounding the skeleton provides diverse morphologies, enriched expressivity.For instance, people wearing a prosthetic limb often prefer a highly realistic rubbery artificial arm over a more functional mechanical one [4].Moreover, skins and muscles might be essential for facilitating challenging tasks, such as reproducing compliant grasping of a hand or swimming motions of a fish [5], [6].
Different to the simulation of the robots with rigid links only, the influence of the soft body on the control torques at actuators and on the contact forces at the ground should be simulated and fully taken care of to judge the plausibility of a designed soft robot.This imposes a significant computational challenge for the motion design and fabrication of skinned robots.In this paper, our goal is to address this problem by integrating both dynamic simulation and kinematic optimization into the motion design of quad-robot systems, with soft skins attached as their organic embodiments.Its kernel is an optimization problem that integrates both userprovided kinematic preference and physical constraints of the robot to obtain a dynamically feasible motion plan.The primary physical constraint is the dynamic viability of the skeleton trajectory when a soft skin is attached.The dynamics of the robot is formulated as two-way coupled subsystems of the rigid multibody system and the deformable skin.In addition, our system also incorporates motor constraints and a stability constraint.The motor constraints ensure that the calculated joint torques are within the physical limits of the installed servo motors, whereas the stability constraint requires the center of projection (COP) of the robot structure to fall inside the supporting polygon.As a result, given the surface mesh and desired kinematic trajectories of the robot, our pipeline generates a physically-valid motion plan that can be realized under the given hardware constraints.The robot itself can be fabricated using rapid prototyping technology.
While space-time optimization is widely used in long-horizon motion design problem, it is computationally prohibitive if directly applied to our case of two-way coupled system, mostly due to the large number of DOFs of the soft skin mesh coupled with the skeleton and various physcial constraints.To this end, we propose an alternating optimization algorithm of two optimization steps to mitigate the computational cost: (1) Space-time optimization with repect to the DOFs of the rigid skeleton while assuming the deformation of the soft skin remains the same as the previous iteration.(2) Frame-by-frame optimization as in [7] to further optimize the motion plan obtained in step 1 according to all the physical constraints at each frame.To this end, we non-trivially extend the spring-based control force formulation in [7] to handle the full simulation of the two-way coupled rigid skeleton and soft skin.Our solver can efficiently handle the Lagrange multipliers introduced by the coupling constraints and the collisions between the skeleton and skin.With a proper initialization, these two steps are alternatively executed until the convergence.In the space-time optimization step, the influence of the soft skin to the rigid skeleton is treated as known quantity and simplified to be the coupling forces and the influence of the center of mass (COM) at each link in the skeleton due to the skin deformation.This setting makes the spacetime optimization computationally efficient through decoupling the skin mesh DOFs, which is critical to achieve global effect in the motion design.The skin deformation is updated after each frame-by-frame optimization.
To ease fabrication, we provide a convenient workflow with tailored engineering tools and empirical fabrication guidance We propose a computational fabrication system for designing and fabricating skinned quad-robots.Given an input mesh representing the shape of a quad-robot such as this beetle-like robot, we design its mechanical skeleton with motors to drive its locomotion.The motion plan is generated by an optimization algorithm with kinematic trajectories as the user input.The trajectories consist of the foot swing trajectories (red curves), center of mass (COM) trajectory (blue curve) and foot contact plan (yellow bars) input by the user.Our optimization fully takes account of all the physical and dynamical constraints.By fabricating this robot design, it can be verified that our algorithm is able to generate plausible and physically feasible motion plans for quad-robots, and the simulated results well match the physical experimental results.Note that we only render the transparent input surface without thickness to demonstrate the surface-structure coupling geometry.
embedded in a standard CAD software, empowering regular users to design quad-robots.The modular design scheme allows the user to quickly start from a design template of the mechanical skeleton in SolidWorks and adapt it to the body shape.The rigid skeleton is fabricated via 3D printing, and the skin is separately fabricated using injection molding by pieces.We tested the optimization algorithm on skinned quad-robots with varying body-to-leg ratios and different mechanical skeletons.Both physical and numerical experiments show that the proposed algorithm is an effective means of obtaining physically valid motions of the skinned quad-robots.

RELATED WORK
Computational fabrication aims at designing and creating physical artifacts with the help of computational methods.A large class of methods addresses inverse design problems by incorporating fabrication limitations in geometric design algorithms via constrained optimization or the integration of fast simulation techniques [8], [9].This line of research enables the design of objects with a wide range of controllable physical and mechanical properties, such as appearance [10], [11], [12], [13], deformation [14], [15], [16], [17], articulation [18], [19], [20], and mechanical motion [21], [22], [23], [24], [25].Some existing contributions also investigated how to instantiate virtual characters as 3D-printable physical entities like mechanical robots [3], [21].Yet, these methods merely focus on robots consisting of rigid links and basic balancing constraints and/or velocity limits.Bickel et al. [26] proposed a process for designing synthetic skin and actuation parameters for animatronic characters that mimic facial expressions of a given subject.Skouras et al. [15] optimized the internal material distribution so that the resulting character exhibits the desired deformation behavior.Focusing on actuation, Bern et al. [27] computed the layout of winch-tendon networks to animate plush toys, and Ma et al. [28] optimized the chamber structure and material distribution for designing soft pneumatic objects.
Our work shares some of these goals but takes a significantly different approach.Instead of relying on a rigid or quasi-static underlying simulation of the skin deformation in our case, the influence of the soft skin on the embedded moving mechanical skeleton makes us face a dynamic two-way coupled multibodyelastic problem.It is much more challenging to accurately simulate and optimize due to the drastically increased system complexity, nonlinearity and discontinuity, i.e., due to the complimentary constraints enforced at the contact vertices.
Physics-based character motion generation has vast applications in both graphics and robotics.Algorithmic approaches include leveraging space-time optimization with necessary physical constraints and developing controllers to drive forward simulations.
The locomotion controller aims to compute joint torques or control forces to drive the locomotion behaviors of articulated figures.The joint torques are usually calculated via the proportional and derivative (PD) controller such that the rigid skeleton of a character follows designated joint angle trajectories [40], [41], [42].Balance control strategies, such as the swing foot placement or zero moment point, are essential to generating stable locomotions.[40], [41], [43], [44], [45], [46], [47], [48].Continuous adaptation of the target joint trajectory for balancing a walking human was developed in [49].Controllers that produce highly dynamic skills for human animation were suggested in [50], [51], [52].The joint torques can also be computed via optimal control to approximate the motion capture data or motion data from kinematic simulators [53], [54].
Our work is inspired by studies on how to drive the soft skin deformation with the underyling rigid skeletons or pseudo muscle force [7], [55], [56].Two-way coupling of rigid bodies and elastic bodies was considered in [57].Fast simulation and control of soft robots of various configurations and actuations has also been studied using finite element method and the reduced formulation of compliance matrix [58], [59], [60], [61], [62].
Elastic body simulation focuses on the formulation of an elastic deformation energy and the proper handling of contact constraints to simulate realistic deformations of soft bodies [63], [64], [65], [66].A comprehensive survey of physics-based elastic deformation models can be found in [67].
Space-time optimization techniques can also be applied to control the motion of elastic bodies that are represented by volumetric meshes.To reduce the number of variables used to control the vertex positions in the optimization, model reduction techniques are frequently used [68], [69], [70].Barbič et al. [68] imposed the equation of motion constraint in elastic body deformation, using the discrete adjoint method to compute the gradients of control forces.Pan et al. [71] integrated the contact forces as additional variables to handle environment interactions and solved the spacetime objective with alternating optimization, but did not handle the two-coupling problem we want to solve.

OVERVIEW
Given an input surface mesh of a quad-robot, we first design mechanical skeleton and skin mesh (Section 6.1) for the robot, and then use the proposed two-step alternating algorithm to optimize for a physically plausible motion plan (Section 5).The overall system flowchart is illustrated in Fig. 1.
During the alternating optimization, the first space-time optimization step outputs joint angle trajectories for the design according to the user-specified end-effector and COM trajectories (Section 5.1).This step is made possible by only considering the approximated skin deformation.The second frame-by-frame optimization step improves the physical plausibility of the joint angle trajectories with full simulation and various physical constraints(Section 5.2), such as physical torque limits for the selected motors in the design.Two-way coupled multibody-elastic dynamics (Section 4) are adopted in this step for the full simulation.
Finally, the designed robot is fabricated by fast prototyping methods for a physical validation (Section 6.2), and stepper motors are mounted to drive the skeleton and the attached soft skin to realize the motion plan.

TWO-WAY COUPLED MULTIBODY-ELASTIC DY-NAMICS
A core ingredient of our system is the dynamic simulation of the robot using a self-actuated rigid skeleton with a soft skin attached.We are inspired by existing coupled simulation systems in graphics [72], [73], [74] and exploit the Lagrange multipliers method to enforce the two-way coupling between the skeleton and the soft skin, which can be naturally integrated into the subsequent locomotion optimization.The Lagrange multipliers are used to guarantee that the skeleton and skin are attached to each other at prescribed locations, and we solve for all the unknown DOFs from both subsystems simultaneously.

Two-Way Skeleton-Skin Coupling
We use Lagrangian mechanics for both the rigid skeleton and soft skin and obtain a symmetric formulation for these two subsystems.To ease the formulation of motion contraints, we use the generalized coordinates q to parameterize the entire skeleton, where q = {c x , c y , c z , q 1 , ..., q m }.The vector q is composed of the Cartesian coordinates of the center of mass (COM) at the root link {c x , c y , c z } and the three Euler angles at each joint {q 1 , ..., q m }.We opt to model the soft skin using the neo-Hookean material model [75] because it has been demonstrated to be well suited for robotic skins made out of silicone [76] and can handle large local deformations induced by joint rotation observed in our examples.If necessary, however, our approach should be easily extensible to more sophisticated material models such as Mooney-Rivlin and Ogden.The DOFs representing the vertex displacements of the tetrahedral skin mesh are denoted by the vector u.Though numerical discretization, the equations of the forward simulation of rigid skeleton and soft skin at each time step can be written into a linear system Ax = b, where A is the system matrix and b is a vector of the sum of constant terms and external forces.The detailed derivation of two linear systems, A r , b r for rigid skeleton and A d , b d for soft skin, are elaborated in Appendix A.
The two subsystems are coupled by attaching the soft skin to the underlying skeleton at prescribed glue vertices.Mathematically, this straightforward treatment leads to a set of nonlinear position constraints: The matrix R converts the positions on the rigid links where the skin is attached, r, from local to world coordinates.This operation can be easily expressed as a rotation chain from the links all the way back to the root.Meanwhile, t concatenates the root translations of the rigid links, and x c denotes the positions of the glue vertices on the skin mesh x c = S c u, where S c is a selection matrix.
Using the Lagrange multipliers method, we obtain the coupled multibody-elastic system: The coupling constraint is linearized via ∇C .In each time step, we solve for the changes of the system DOFs in Eq. 30.Thus, we have q i = q i−1 + ∆q and u i = u i−1 + ∆u, where the superscript [•] i indicates the frame index.

Collision and Contact Handling
There are two types of collisions/contacts we need to take care of in our simulation.The first is the collision between the robot's feet and the ground surface, which provides necessary support and friction forces to the robot.As will be detailed in Sec.5.2, we resolve them using linear complementary constraints (LCP) to guarantee the physical feasibility of the locomotion.
The second is the self-collision of the soft skin; rotating joints tend to compress the inward skin and induce self-collisions.Moreover, skin-skeleton collisions 1 could also occur when the skeleton is being articulated.Because such collisions typically take place under low relative velocities, we handle them using the explicit penalty force method [77], [78].

MOTION PLAN OPTIMIZATION
As the system input, the trajectories of the COM, end effectors, and the footfall pattern are provided by the user.Our system generates a dynamically feasible motion plan for the robot that resembles as much as possible the one prescribed by the user.A motion plan, defined as P = {q i , i = 1...N; ∆t}, includes the skeleton configuration q i of the i-th frame for i = 1 to N, and the time step size ∆t.
Previous works, e.g.[Megaro et al 15], solved the motion design problem by simultaneously finding the optimal skeleton configuration for all the frames in P.However, this problem becomes much more challenging in the case of a multibodyelastic system, due to the large number of DoFs and associated physical constraints.Thus, the global approach with full DOFs is infeasible in our case.In this section, we elaborate the details of our two-step alternating motion plan optimization algorithm which uses approximated skin deformation to significantly improve the efficiency of the global space-time optimization.Specifically, the influence of the skin deformation on the skeleton is approximated as the coupling forces at glue vertices and the influenced COM positions of each link.The convergence of the algorithm is tested considering the difference between the space-time optimized one and the optimized one after the frame-by-frame optimization step.Fig. 2 illustrates the algorithm flowchart.

Space-time Optimization With Skin Deformation Approximation
Similar to the formulation in [36], for each i-th frame, we consider the set of generalized coordinates of the rigid skeleton, q i , together with the contact forces F i c, j and torques τ τ τ i c , j that are exerted on the j-th end effector in contact with the ground.The influence of the skin deformation to the skeleton at i-th frame is simplified to be the coupling forces λ λ λ i at glue vertices and the skin deformation u i .They are obtained from the previous frame-by-frame optimization and not optimized in this step.The displacements in u i are represented into the local coordinate frames of links at each frame in order to compute the influence of the skin deformation to the COM of the robot.
Given these quantities, the optimization objective is defined as the weighted sum of six terms that balance the user-specified end effector and COM trajectories and the smoothness of the optimized motion: (3) The first term E i τ τ τ is standard in space-time optimization to minimize the torques τ τ τ i exerted at the joints: The torques τ τ τ i are computed using inverse dynamics, and the coupling forces λ λ λ i are integrated as the external forces exerted by the elastic skin at the coupling points.
The second term E i S encourages the smoothness of the optimized motion, which is: The two terms, E i EE and E i COM , enforce the optimized motion to follow the user-specified end-effector and COM trajectories respectively: where the functions φ i EE (q i , u i ) and φ i COM (q i , u i ) define how to compute the end effector and COM positions, given the generalized coordinates of the skeleton and the deformation of the skin mesh.For each end effector, we select one vertex closest to the end effector of the rigid skeleton and represent this vertex into the local coordinate system of the end effector to compute φ EE (see Fig. 3).
The term E i F penalizes the deviation from the motion { qi , i = 1, .., N} generated in the previous frame-by-frame optimization or the initialized motion plan at the first iteration: After the frame-by-frame optimization step, the weight of the E F term to follow the motion plan of the previous iteration in the space-time optimization is increased by 10%, which means the algorithm leans toward physical plausibility.
The last term E O enforces that the end-effectors in the contact are flat: where ψ i EE (q i ) is a function to compute the orientation of the end effector and n is set to be (0, 1, 0), the normal of the support plane.The formulation of this term is motivated by the fact our skinned robot is soft and hence a contact area appears whenever feet contact the ground.We try to maximize the contact area at the moment of contact because it is important to achieve a stable motion.Similarly, when the foot is about to hover, we want to clear as many contact vertices as possible.Therefore, when an end effector is close to these important moments, we add E O to the objective function, which try to make the end effector face the upright direction of the ground.
We also impose hard kinematic and dynamic constraints on the optimized variables to obtain a stable motion plan.The kinematic constraints include the contact constraint, the center of pressure (COP) constraint and the optional periodic constraint, while the dynamic constraints include the momentum and the friction force constraints as in [36].Contact constraint: In the optimization, we need to enforce the footfall pattern that is specified by the user to encode when the foot should leave or touch the ground.This constraint can be written into: where c i j is a binary variable set to 1 if the j-th end effector is in contact with the ground at the i-th frame.This variable can be directly derived from the footfall pattern.The y coordinate of the end effector, denoted by φ i EE, j (q i , u i ) y , should be 0 since the ground is set to be y = 0. COP constraint: The COP should be inside the supporting polygon for a stable motion plan.This constraint can be written into: where the funtion φ i COP computes the COP position using the same method as in [3].The rows in P represent edges of the supporting polygon.Since the space-time optimization requires the foot to be flat on the supporting plane, the supporting polygon is formed by the convex hull of the vertices that represent the sole meshes of the end-effectors in contact.However, the contact forces and torques at a sole are simplified to be exerted on a single point of the end effector to ease the optimization.Fig. 3 illustrates the contact points (red balls) selected as the positions of the end-effect for the beetle-like robot.Periodic constraint: When the user desires a periodic motion, the joint angles are expected to be the same in the first and the last frame of the optimized motion plan: where J extracts the joint angles from the generalized coordinates.
Momentum constraint: The change of the linear and angular momentum of the robot should be determined by the external contact forces and torques, which can be formulated into the following equations: where R i and L i are, respectively, the total linear and angular momentum of the robot at i-th frame, and p i c, j gives the contact position of the j-th end effector.Friction force constraint: The contact force should be inside the friction cone to satisfy the Coulomb model of friction.Specifically, we have: where F i c, j ⊥ and F i c, j represent the components of the contact force perpendicular and parallel to the ground respectively.The first equation requires the contact force to be inside a friction cone.The second equation relates the contact force and the contact torque, where ν b and ν t are set to be the radius of the circumcircle of the sole mesh.Optimization: With the defined objective function and constraints, the space-time optimization step can be written into: where φ e and φ g represent the equality and inequality constraints respectively.We solve this sequential quadratic programming problem using the Gauss-Newton algorithm.The weights in the objective function are specified as follows:

Frame-by-frame Optimization with Full Dynamics
In the frame-by-frame optimization, we drop the simplification of the previous step and consider the full dynamics formulated in Eq. ( 30) in a similar way as in [7].This allows us to further improve the physical plausibility of the motion.In practice, this requires the solution of a difficult quadratic programming problem with complementarity constraints (QPCC) to handle contact and friction.Different to the soft body only formulation in [7], the coupling constraints between multi-body skeletion and elastic skin introduce a large number of Lagrange multiplier variables and largely increase the complexity of the solver.To speed up the solution, we follow the condensation technique widely used in physical simulation [79], [80].Specifically, we select the driving torques at joints and foot contact forces as optimization variables and lump the DOFs of mesh vertices and rigid skeletons to these variables through the condensation of the system matrix in Eq. ( 30).This choice facilitates the formulation of the physical torque limit constraints of motors as well.In this section, we describe the details of the matrix condensation and the per-frame optimization problem.System matrix condensation: With the coupled multibody-elastic system defined in Eq.( 30), the nonlinear relation between the simulated DOFs ∆u and ∆q and the vector b r and b d can be revealed by eliminating the unknown Lagrange multipliers λ λ λ in the matrix condensation (see Appendix.B for the detailed derivation): Here, F ⊥ and F are magnitudes of normal and tangent forces at all the contact vertices on the skin mesh, and τ τ τ represnets the join torques.To handle LCP constraints, the contact force at a contact vertex is modeled as F = nF ⊥ + DF instead of the 3D vector representation in Section 5.1, where nF ⊥ represents the upright supporting force along the contact normal n = [0, 1, 0] and F ⊥ ∈ R is the force magnitude.D ∈ R 3×4 is a matrix and its columns are the vectors that span the contact plane.In our system, we use four directions to form the friction cone [81] and F ∈ R 4 is the tangent magnitude.The explicit penalty forces for resolving the collision between the skeleton and skin are pre-determined quantities and merged into the constant terms in b r and b d .Given q i−1 and u i−1 , ∆q i and ∆u i determine the positions and orientations of COM, COP, and end effectors at the i th frame.Thanks to Eq. ( 11), these kinematics variables are now functions of τ τ τ, F ⊥ , and F .Therefore, we can derive the functions required in the computation of kinematic information, namely φ i EE , ψ i EE , φ i COM and φ i COP , if external forces τ τ τ i , F i ⊥ , and F i are given.Note that the purpose of these functions are explained in the space-time optimization (see Sec. 5.1).Optimization: We follow the control strategy used in [7] to optimize the input motion plan on a frame-by-frame basis.It is used to make sure that the output joint angle trajectories of the space-time optimization step are physically feasible, which is achieved using the two-way coupled multibody-elastic dynamics as constraints.At each frame, it can be formulated as a quadratic programming problem with complementarity constraints.
Specifically, we seek for joint torques (τ τ τ i ) and contact forces (F i ⊥ , F i ) such that the corresponding ∆q i = φ i ∆q and ∆u i = φ i ∆u Fig. 4. Our QPCC solver converges quickly in most cases.The left plot is the converging curve of a frame when the front left leg of the monster-like robot leaves the ground.The middle plot is the converging curve of a frame when this leg is in the air (i.e.other three feet are on the ground).
The right plot is the converging curve of a frame when this leg hits ground again.
satisfy necessary hard constraints and the resulting locomotion matches the input locomotion as much as possible.Mathematically, it is formulated as In Eq. ( 12), the first hard inequality constraint of τ τ τ i m < U m is the motor constraint requiring for all the M motors that the computed torque magnitude is within its physical limit U m .The second inequality constraint P • φ COP ≤ 0 requires the position of the COP to be within the supporting polygon as in Sec.5.1.The last complementary constraint is enforced at each individual contact vertex.It characterizes the contact mechanism such that when normal force exists, the relative velocity between the ground and the contact vertex along the contact normal should be zero, etc.Here, ∆u i c ∈ R 3 is the incremental displacement of a contact vertex.The auxiliary vector λ is related to the tangent velocity of a sliding contact; µ is the friction coefficient; and 1 is a vector of ones, that is, The objective function E G has four terms: where: The first energy term E S is the smoothness penalty, which favors motions with consistent velocities.The term E i F penalizes the deviation from the motion { qi , i = 1, .., N} generated in the previous space-time optimization.E O is the same soft constraint on the orientation of an end effector as in Eq. ( 3), which can maximize the contact area for a stable motion.E τ τ τ is used to penalize the large variation of the control torques at joints between frames.The last term E C imposes a penalty to moving end effectors who are responsible for supporting feet.In other words, if a foot is in contact with the ground and supporting the body, we use E C to reduce the risk of its possible tangent sliding.Here, E is an elementary matrix that picks positions of supporting end effectors.The weighting constants for each of these penalty terms are as follows: α S = 1, α F = 10, α O = 2, α τ τ τ = 0.5 and α C = 10.

Solving the QPCC
The key to solving the QPCC problem of Eq. ( 12) is to have a feasible configuration for all the contact vertices.Our strategy is similar to that of [7]: We flip complementary constraints when the inequality constraint reaches the boundary.Specifically, contact vertices fall into one of the three following categories: • Contact breakage means that the contact vertex will leave the ground plane in the next frame, and the complementary constraints should be lifted.• Sliding indicates that the contact vertex is moving within the ground plane.In this situation, the complementary constraint for its normal force F ⊥ becomes: and the complementary constraints for the tangent force F are: • Static friction implies that the contact vertex is fixed on the contact plane.In this case, the complementary constraint for its normal force is the same as Eq. ( 15).The constraints for the tangent force are: The inequality constraint of µF ⊥ − 1 F ≥ 0 specifies the friction cone constraint in the case of static friction.d We begin solving Eq. ( 12) by assuming all the contact vertices are fixed, which simplifies the original problem to min where φ i ∆u c returns the incremental displacements of all the contact vertices.This assumption of fixing all the contact vertices is realized via the Lagrange multipliers method, and the resulting multipliers γ γ γ c correspond to the constraint forces at these vertices.Now, let γ γ γ c ∈ R 3 be the constraint force at one of the contact vertices.It can be decomposed along normal and tangent directions as: γ ⊥ = n γ γ γ c , and γ γ γ = I − n n γ γ γ c .
We label all the contact vertices as contact breakage, static friction, or sliding by checking γ ⊥ and γ γ γ .If γ ⊥ ≤ 0, which indicates a contact breakage, we remove the constraint at the vertex in the next iteration.If γ ⊥ > 0, we further examine the magnitudes of µγ ⊥ and γ γ γ .If µγ ⊥ > γ γ γ , the vertex falls into the static friction category, otherwise the vertex is considered sliding.After all the contact vertices are labelled, we can convert the complementary constraints into a set of equality or inequality constraints, as explained in Eqs. ( 15), (16), and ( 17), and re-solve the QP optimization.It is known that QPCC is NP-complete, and few contact vertices could make the optimization procedure computationally intractable.Therefore, we simplify this procedure by grouping vertices on the planar surface of the foot mesh into five patches similar to [7].
In our experiments, we found that such initial vertex grouping often provide a good start for the QPCC solver.Typical converging curves are plotted in Fig. 4, and we stop the optimization after 10 iterations.We observe that the condensed QPCC solver is around 50x faster than the QPCC without condensation.

Initialization
Given the mechanical skeleton and the skin mesh of a robot, we first associate the mesh vertices to the links of the skeleton to obtain its skinning information.Hence, the mesh vertices can be deformed with the skeleton in the space-time optimization step, while the local coordinates of the vertices should be computed using their deformed positions and the local frame of the links at each frame.The initial motion plan are computed through the spacetime optimization step without the trajectory following terms E i F .In this step, the skin deformation is assumed to be static and each link has additional weights from its associated vertices.Afterwards, the initial skin mesh deformation is simulated by imposing the coupling constraints in the elastic simulation of the skin, and the initial coupling force is then obtained according to the deformation of the tetrahedra connected to the coupling points [56].

DESIGN AND FABRICATION
Designing and fabricating a quad-robot is a challenging task.We facilitate the design by using a set of mechanical skeleton templates, and narrow the gap between professional and regular users by creating several SolidWorks scripts.This allows even an inexperienced user to tweak high-level semantic parameters.Fig. 6 shows three built-in mechanical skeleton templates provided in our system for quad-robots.Each template is built of modularized CAD parts to ease the fabrication cost.The first one is the design used in the beetle-like robot, which consists of a torso structure and four limb structures.Their exploded views are detailed in the figure as well.The torso structure has four shoulder joints that connect to its four limbs.A microcontroller board sending trigger signals to the motors is mounted inside of the torso.The limb structure includes linkage parts of an upper leg, a lower leg, and a foot.On each limb, two uniaxial motors are mounted to provide necessary rotational freedoms at the knee and the ankle.The other two templates vary in different initial poses and foot link geometries.
In the following, we describe the details of the design pipeline and the fabrication procedure respectively.

Design and Editing of Mechanical Skeleton
The design starts with a given 3D model that corresponds to the appearance of the robot.Our system extracts an initial skeletal line using the mesh contraction method [82] as shown in Fig. 5.This skeleton is actually an approximation of the medial axis of the model, and it is used as a general guide for the followup template embedding and editing.We employed the modular design idea so that the user can edit the geometry of a template mechanical component to obtain a customized mechanical skeleton  for quad-robots of various morphologies.To this end, several SolidWorks scripts are developed to assign semantic parameters of a link, such as the link length, motor mount size, etc., and the user only needs to tweak these intuitive parameters to obtain a personalized design without creating one from scratch.The size of pilot holes on the link for screw installation remains unchanged under such edits.An example is given in Fig. 7, where the lengths of the link and the motor bay are increased.Although a few iterations may be necessary during embedding, the developed SolidWorks scripts greatly accelerate the procedure.Typically, given a new surface model of a quad-robot, we embed limbs first and then adjust the geometry of the torso to make sure it fits the exterior skin.Specifically, a global scale of the mechanical structure template and local rotations of the links are first performed so that the template can be inside the input surface mesh.Then, the user can select the start and end points of a link on the extracted skeletal line and trigger the designed script to edit the link geometry to match the specified length and adjust the width of the link.Finally, the bracing unit of the torso is generated in a similar way as the skin creation(the details follows shortly), and we dig out holes to reduce its weight, for instance, the bracing unit for the torso of the beetle-like robot shown in the first picture in the second row of Fig. 1.Skin and folding regions creation: The exterior skin of the robot is designed to be 8 mm thick at the foot and 4 mm thick at other parts by default, and it is created by the mesh hollow operation in Materialize Magics.This operation treats the space surrounded by the input 3D surface model as a solid and hollows the interior space of the solid to match the specified thickness parameters to create the skin that is amenable to fabrication.When it is being bent, the skin can yield rather large resisting forces under stretching deformations.Regular commercial motors may not possess sufficient power to overwhelm the internal stretching.To resolve this practical issue, we add a few folding regions on the original skin mesh, as shown in Fig. 8.The folding region is created by applying a sweeping cut operation in Solidworks over the original skin surface where the motor is installed.This small treatment increases the skin area where substantial bending occurs and effectively reduces the resulting stretching force.Note that the hollow operation is performed after the creation of the folding regions.Fortunately, the two software are compatible in mesh file format.The mechanical structure of the robot is 3D printed with polypropylene-like stereolithography (SLA) resin, which is a widely used material for fabricating joints and low-friction moving parts.The exterior skin of the robot is made of a layer of soft rubbery material and fabricated via injection molding.To reduce the effort and cost of creating the skin molds, we fabricate the skin on a piece-by-piece basis: one limb has one skin piece, and the torso has two pieces as shown in Fig. 1 (Skin pieces).The skin-skeleton attachment is physically realized by another 3D printed bracing unit between the skin and the skeleton.This bracing unit is attached to each link on the skeleton and serves as a supporting structure between the rubbery skin and the mechanical skeleton (see Fig. 1 & Fig. 9).The purpose of this design is to expect that the friction between the skin and the printed parts can disable the relative motion between skin and skeleton at these parts, which is verified in the physical validation.We thus select the glue vertices in Fig. 9 according to the position of skin-skeleton attachment parts so that the coupling constraints can reflect this physical setting.The mass matrix and the inertia tensor of this bracing unit are integrated in our multibody subsystem dynamics.Finally, skin pieces are glued together after all skin pieces are installed using nonreactive PVA adhesive.

Fabrication
Motor specification We use the MG995R servo motor to drive the motion of the skinned robot.The motor's size is 40 Physical and simulation statistics of three tested robots.Joints: the number of joints on the skeleton.Skin: the number of vertices on the skin mesh.Glue: the number of glue vertices.Weight: the physical weight of the robot.Opt.: the average time used for optimizing Eq. ( 12) of one motion frame.with the maximum torque of 20 kg•cm under 6.4 V (i.e.U m = 1.96N•m in Eq. ( 12)).In total, 12 motors are installed in the beetle-like robot.All the motors are controlled with an Arduino board, which supports up to 32 motors.

EXPERIMENTAL RESULTS
In this section, we first report the torque limits and folding region experiments in the motion design of the beetle-like robot to validate its physical feasibility.The mechanical skeleton of this robot is designed based on the first template in Fig. 6 and fabricated using 3D printing.A comparison to kinematic optimization only is also provided for this robot.Second, we report the motion design results for two additional quad-robots: a monster-like robot and a lizardlike one.The performance of our optimization algorithm depends on the number of vertices on the skin mesh, the number of glue vertices, and the number of joints of the mechanical skeleton.The frame interval ∆t is 0.005 second, and we employ the discrete collision detection algorithm to handle self-collisions and footground collisions.Normally a motion cycle has around 500 frames.
Our optimization algorithm was implemented on a desktop PC with an intel i7-7700 CPU and 16 GB memory.The soft skin is made of isotropic rubber material whose Young's modulus is 0.09 GPa, and Poisson's ratio is 0.46.Table 1 reports some essential physical and simulation statistics of these three examples.The space-time optimization step with approximated skin deformation for a skeleton is around 40 seconds.For the slow-walking motions as shown in Fig. 1 and Fig. 19, we only need one iteration to converge, since the frame-by-frame optimization can reproduce the motion from space-time optimization step well with physical constraints.For the relatively fast trotting motion in Fig. 18, the algorithm converges after two iterations.Torque limit: The torque limit in the motion optimization (i.e.Eq. ( 12)) of the beetle-like robot is set as 1.96 N•m to match the physical torque limit of the used MG995R motor.To verify if this hard constraint is faithfully enforced during the optimization, we examine torque values that are calculated by our motion design  system after per-frame optimization.The result is reported in Fig. 10, where torque curves at an ankle joint and a shoulder joint are plotted.It can be seen that the imposed motor constraint successfully bounds the torque magnitude to be within the limit to ensure that the designed motion is physically possible.
Folding regions Adding folding regions to the robot's skin is an effective fabrication artisanry to enable the robot assembly using off-the-shelf servo motors and lower the fabrication cost.To demonstrate its advantage, we compare the skin deformation under the joint rotation when the robot is attached to a regular soft skin and a folded skin.Both skins are fabricated using the same materials.It can be seen from Fig. 11 that rotating joints yield large stretching stress over the skin, which could easily go beyond the physical capacity of many commercial servo motors.In this test, we follow the aforementioned motor specification by setting the maximal torque to 1.96 N•m and test if this power is sufficient to generate the necessary skin deformation.We set our target bending angle to ±70 • , which is a common value in many walking gaits.The motor is programmed to reach this target in 2 seconds.Our simulation shows that the smooth robot skin without folding region prevents the motor from producing sufficient joint rotation and the maximum angle that can be reached is only about ±20 • .With the folding region, swept by an 8 mm-depth tooth over the smooth skin, our simulation predicts that the motor is able to generate the desired rotation.The physical experiment results are quite consistent with our simulation prediction as reported side by side in Fig. 11.VS. kinematic-only optimization: In contrast to robots with only rigid mechanical skeletons, skinned robots exhibit a much more complicated dynamic behavior, which should be fully incorporated during the motion design.To illustrate the necessity Ours Kinematics only Fig. 13.Physical experiments show that kinematic-only optimization is not a feasible solution for skinned robots -there are noticeable back steps (highlighted with a red box) in a motion cycle as the driving torques, after damped by the skin deformation, are not strong enough to produce necessary normal contact forces.Please refer to the accompanied video for a clearer comparison.
of incorporating influences of the soft skin, we compare the motion plans generated using our method and the one by Megaro et al. [3].Because the primary focus in [3] is to design robot creatures with only rigid links, Megaro and colleagues used a kinematic-based optimization strategy, which includes the trajectories of COM, COP, end effectors, and the footfall pattern.Based on the resulting motion plan, we compute the corresponding driving torques at joints using inverse dynamics.Specifically, the driving torques are computed by imposing another set of rotation constraints over the skeleton in Eq. ( 30) using the Lagrange multipliers method (with necessary complimentary constraints and inequality constraints to handle the ground contact and motor torque limit).The constrained joint rotation corresponds to the one obtained from the kinematic-based motion plan, and the multipliers represent required generalized constraint force, which are converted to joint torque via J ωk to achieve the target joint rotation.As shown in Fig. 12, the physical simulation results suggest that a kinematically valid joint trajectory does not guarantee a smooth walking cycle of the skinned robot, even though the constraints of COM/COP are also specified in the kinematic optimization without skin information.The coincidence, for the knee joint, of the joint angle curves of kinematic and inverse dynamics shows that our inverse dynamics computation can track the kinematic motion plan well, and the roll angle of the root link experiences a larger variation in the inverse dynamics simulation.This is also verified in the physical experiment as shown in Fig. 13.The motion plan obtained using only kinematic optimization leads to a shaky motion.We also observe backward motions as highlighted in the figure .Our method, because it fully considers various physics conditions and constraints, yields a much better result.
Motion design results: Fig. 14 illustrates the simple foot lifting motions designed by our system for the beetle-like robot.These two motions, i.e., single-foot lifting and double-foot lifting, are also used to show the COP is constrained to be inside the support polygon with our optimization algorithm.Please see the accompanying video for the animation.The embedded skeleton of the monster-like robot shown in Fig. 6 is designed using the third template.The weight of this robot is 11.87 kg, and its size is 48.5 cm × 64.6 cm × 27 cm.The young modulus at the tail and belly of the monster is reduced by 85% to demonstrate the dynamics of the skin.Two different input foot trajectories are used to generate the walking motions for the robot.As shown in the leftmost column in Fig. 17, the first trajectory has a longer stride length but lower step, while the second one has shorter stride and higher step.Our system is able to accommodate such variations and produces a smooth and physically correct motion plan.The walking speed for these two walking motions are 0.11 meter/second and 0.06 meter/second.We generate a trotting motion of 0.45 meter/second speed for the monster-like robot to demonstrate that our system can support fast motion.In this example, the trajectories of joint positions are labelled using the horse motion pictures photographed by Eadweard Muybridge, a famous photographer for his work on motions.The joint positions are mapped to a horse motion with the specified speed using the method in [83] and re-targeted to the skeleton of our monster.This initial kinematic motion (please see the accompanying video for the motion) is then optimized using our alternating motion optimization algorithm to turn it into a physically feasible motion.
We notice that the flighting phase of the initial kinematic motion is not consistent with the foot contact plan.To be more specific, the time of the flighting phase is not enough for the monster to return back to the ground.Thus, the space-time optimization with physical constraints, especially the momentum constraint, is necessary to eliminate such inconsistency, which is critical to the success of the alternating optimization.Fig. 16 illustrates the effect of the COP optimization.The red balls indicate that the COP positions at two frames in the initialized trotting motion plan are outside of supporting polygon after the first space-time optimization that does not account for the deformation of the skin mesh.Thus, the frame-by-frame simulation fails to produce a stable trotting motion with its initially optimized motion plan, as shown in the second row of Fig. 18.The COP constraint is turned off to produce this failed example once this constraint can not be satisfied by the solver.After the second iteration, the COPs are moved into supporting polygons, as indicated by the green balls.A smooth trotting motion can then be generated as shown in the first row on the right of Fig. 18.The comparisons of the optimized joint angles and the z components of COP are illustrated in Fig. 15.The variation of z components indicates the COP moves from left to right so that it is inside the supporting region.
Another example is reported in Fig. 19.The mechanical skeleton of this robot is further edited based on the second template of Fig. 6.We lengthened the torso and shortened the limbs to fit this template into the input model (125 cm × 47 cm × 46 cm).Our system also produces plausible motion plans for this quad-robot.Failure case: While our system is stable in the generation of slow walking motion, we find the generation of fast trot motion is sensitive to the physical parameters.When the mass of the monster is increased to two times, its influence on the mass center cannot be balanced in the optimization and the COP constraint is violated in the space-time optimization result, possibly due to its conflict between the foot contact constraint.Hence, the frame-by-frame   The designed trotting motion with our alternating algorithm.(c) The unstable motion simulated by the frame-by-frame optimization when the skin deformation is not considered in the space-time optimization.Fig. 19.The motion of a lizard-like robot.We edit the second template in Fig. 6 with SolidWorks scripts to create the design of its mechanical skeleton.With user provided inputs, our system generates plausible motions of this robot.
optimization will fail to produce a stable motion.Such situation might be handled through the integration of foot plan sampling step in [36].

CONCLUSION AND FUTURE WORK
In this paper, we have presented a fabrication-oriented motion planing algorithm and detailed design/fabrication procedures for personalized skinned quad-robots.The physical constraints, such as the equations of motion of the skinned robot and the motor constraints, are integrated into the motion planning such that the resulting motion plan is physically and dynamically feasible.
The condensation formulation allows us to conveniently establish the nonlinear relationship between external forces and the target kinematic parameters of the locomotion and to reach a QPCC formulation for the motion design.Our experiments show that the system is able to assist regular users to obtain natural and smooth motions designed for skinned quad-robots.
In the future, we want to explore a gait synthesis algorithm to generate the motion plan from high-level parameters, such as velocity and turning angles.Combining captured gait data and optimization with dynamic constraints has the potential to significantly reduce users' labor efforts of creating such motion planning.
Currently, the coupling between the FEM simulation of the soft skin and the rigid body dynamics of the mechanical structure is not fast enough for a closed-loop control of skinned quad-robots.We want to explore model reduction or homogenization techniques to reduce the computational cost of FEM simulation and produce interactive feedback to control skinned robots online.

APPENDIX A THE EQUATIONS OF MOTION
Lagrangian multibody dynamics: The multibody rigid skeleton of the robot is a kinematic tree of links connected by joints.Its classic Lagrangian mechanics formulation can be found in [84], where the DOFs of the skeleton are specified as the the generalized coordinate q of the joint angles and the root translation.
The equation of motion for the articulated rigid skeleton can be written as M r (q) q + D r q + f r (q, q) = g r , where the subscript [.] r denotes variables for the skeleton rig.Detailed derivation of M r and f r in Eq. ( 20) can be found in the excellent tutorial by Liu and Jain [85].D r is the damping matrix.
We refer to M r as the rigid mass matrix in order to differentiate it from the mass matrix of the soft skin.For a skeleton with K links, where I is the identity matrix, I ck is the inertia tensor for the k th rigid link, and m k is the mass of the link.The Jacobian matrix J k = J vk , J ωk , where J vk = ∂ x k /∂ q, relates the Cartesian coordinate x k of the link's COM to the generalized coordinate q.Similarly, J ωk relates the angular velocity ω ω ω k to the generalized velocity q such that ω ω ω k = J ωk q.It is noteworthy that the rigid mass matrix is not constant because of the orientation-dependent inertia tensor and the Jacobian matrix.
Non-inertia forces like Coriolis and centrifugal forces that couple the generalized coordinate are included in f r .The righthand side of Eq. ( 20) is the generalized external force applied to the skeleton, which includes the gravity force g and torques τ τ τ from the actuating motors: FEM elastic simulation: The dynamics of the soft skin can also be formulated using Lagrangian mechanics, and we can obtain the equation of motion in a similar form: The subscript [.] d denotes variables for the deformable skin, and g d is the external force applied to the soft skin.We discretize the volume of the skin by a tetrahedral mesh.The deformable mass matrix M d is constant and can be assembled using the standard FEM [86].D d is the damping matrix, and f d denotes the internal elastic force, and it is the negative gradient of the strain energy Ψ such that f d = −∇Ψ.The specific formulation of Ψ depends on the material model chosen.Typically, it is computed based on three isotropic invariants of the deformation gradient tensor F: For the robot with soft skin, its articulated skeleton motion will induce large local compression, especially near the joint.Material models like the StVK and co-rotational models that have been widely used in previous research [72], [74] become unstable under extreme compression.We therefore opted to use the Neo-Hookean material, whose strain energy density is defined as where µ and λ are Lamé constants.The first Piola-Kirchhoff stress tensor P ∈ R 3×3 can be computed based on Eq. ( 25) using the chain rule: The final formulation of f d is (27) Here, ∂ F/∂ u ∈ R 3×3×3 is a third-order tensor.For a tetrahedral element with linear shape functions, ∂ F/∂ u is constant and can be precomputed and stored at each element.Implicit backward euler time integration: We discretize the equation of motions for both the rigid skeleton and deformable body using the implicit backward Euler method to improve the stability of the simulation.Let ∆q = q i+1 − q i and ∆ q = qi+1 − qi , where the superscript [•] i is the frame index.Given the time interval ∆t between frame i and i + 1, the velocity and acceleration of q at frame i + 1 can be discretized as: qi+1 = ∆q/∆t and qi+1 = ∆ q/∆t = ∆q/∆t 2 − qi /∆t.The velocity and acceleration of u can be derived similarly.Subsequently, Eqs. ( 20) and ( 23) can be linearized as M r (q i ) + ∆tD r + C(q i , qi ) ∆q = ∆t 2 g r − D r qi , (28) and In Eq. ( 28), we compute M r (q i ) and C(q i , qi ) using state variables at frame i.Therefore, Eq. ( 20) is only semi-implicitly discretized [87], [88].
Linear systems: The two-way coupled multibody-elastic system in Eq. [2] in Sec.4.1 of our paper is as follows: The matrices A r , A d in this equation are just the abbreviation of system matrices in Eqs.(28) and (29), where A r = M r (q i )+∆tD r + ∆t 2 C(q i , qi

APPENDIX B SYSTEM MATRIX CONDENSATION
The system matrix condensation in Sec.5.2 starts with eliminating the Lagrange multipliers λ in Eq. ( 30) (the same equation with Eq. [2] in Sec.4.1).We first expand the second line of this equation, which yields: Similarly, expanding the first line in Eq. ( 30), we can produce an equation similar to Eq. ( 31) but for skeleton DOFs: Expanding the third line of Eq. ( 30) gives the linearized position constraint: Substituting both Eqs. ( 31) and (32) into Eq.( 33) yields: where . By substituting Eq. ( 34) back into Eqs.(31) and (32), we obtain the condensed formulas in Eq. [10] in our paper.
Fig.1.We propose a computational fabrication system for designing and fabricating skinned quad-robots.Given an input mesh representing the shape of a quad-robot such as this beetle-like robot, we design its mechanical skeleton with motors to drive its locomotion.The motion plan is generated by an optimization algorithm with kinematic trajectories as the user input.The trajectories consist of the foot swing trajectories (red curves), center of mass (COM) trajectory (blue curve) and foot contact plan (yellow bars) input by the user.Our optimization fully takes account of all the physical and dynamical constraints.By fabricating this robot design, it can be verified that our algorithm is able to generate plausible and physically feasible motion plans for quad-robots, and the simulated results well match the physical experimental results.Note that we only render the transparent input surface without thickness to demonstrate the surface-structure coupling geometry.
the formulation of b r and b d in Appendix.A, the joint torques and the contact forces exerted on the soft skin are absorbed into the vector g r and g d .Since the rest terms in b r and b d are constant, we can use φ ∆q and φ ∆u to represent Eq. (10) more precisely: ∆q = φ ∆q τ τ τ, F ⊥ , F , and ∆u = φ ∆u τ τ τ, F ⊥ , F .

Fig. 6 .
Fig. 6.Three mechanical structure templates and the exploded views of the torso and limb structures of the first template.

Fig. 7 .
Fig.7.With the assistance of the developed Solidwords scripts, the user only needs to tweak semantic parameters like the link length, motor mount size, etc. to obtain a customized link.The size of all the pilot holes for screw installation remains unchanged under such edits.

Fig. 5 .
Fig. 5.The initial skeletal line of the beetle-like robot.

Fig. 8 .
Fig.8.We add folding regions to facilitate the stretching deformation of the skin.The template folding region is similar to gear teeth, and it is formed by a sweeping cut operation, that is, the CSG difference between the volume surrounded by the original skin surface and the volume formed by rotating the sweeping contour along a central axis.

Fig. 10 .
Fig. 10.We plot the torque values of the optimized motion planning of the beetle-like robot.Orange curve: the torque curve at an ankle joint (at the orange box).Blue curve: the torque curve at a shoulder joint (at the orange box).

Fig. 11 .
Fig.11.Adding folding regions significantly relieves the stretching stress over the skin.We program the motor at an ankle joint of the beetle-like robot to rotate ±70 • within 2 seconds in this experiment.A smooth skin can only be bent around ±20 • , while the folded skin is able to reach the desired deformation.The physical experiment (black skins) results are consistent with simulation results (yellow skins).

Fig. 12 .
Fig. 12.The motion plan generated by the kinematic-only optimization [3] leads to unstable walking sequences.Left: Selected frames.Right: The joint angle curves.Kinematic: the kinematic optimization result.Inverse dynamics: the simulation result by following the kinematic optimization result.Our: our optimization result.The large roll angles of the root link is due to the unstable pose using kinematic-only optimization.Please see the accompanying video for the full comparison.

Fig. 14 .Fig. 15 .
Fig. 14.The foot lifting motion for the Beetle-like robot.(a) Single-foot lifting.(b) double-foot lifting.The green balls indicate the COP positions and gray lines the support polygons.Our optimization algorithm can constrain the COP to be inside the support polygon.

Fig. 16 .
Fig. 16.The effect of the COP constraints in the trotting motion plan.Red balls: The COP positions computed using the motion plan after initialization.Green balls: The COP positions optimized with the skin mesh deformation.The supporting polygons are in cyran.

Fig. 17
Fig.17.The monster-like robot takes two different input foot trajectories, and our system computes natural and physically correct motions for both inputs.
Fig.17.The monster-like robot takes two different input foot trajectories, and our system computes natural and physically correct motions for both inputs.

Fig. 18 .
Fig. 18.Trotting motion for the monster-like robot.(a) Marked joint positions.The color of a dot indicates to which part of the horse skeleton it belongs, and the positions are mapped to our monster skeleton joint angles using the space-time optimization with only kinematic constraints.(b)The designed trotting motion with our alternating algorithm.(c) The unstable motion simulated by the frame-by-frame optimization when the skin deformation is not considered in the space-time optimization.
) andA d = M d + ∆tD d + ∆t 2 ∂ f d /∂ u i .Analogically, we have b r = ∆t 2 g r −D r qi −C(q i , qi ) qi , and b d = ∆t 2 g d −f d (u i )− D dui .