(small) (normal) (large)

## Pantographic leg

Example of loop closing joints to simulate a parallel structure resembling a pantographic leg. Special loop closure joints specify the loop closure relation between two joints in the kinematic tree as shown on line 54. Here, a torsional spring force acts on the “knee” joint causing initial high-frequent oscillations which quickly settle the leg in the rest position.

 ```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 ``` ```include "physics/physics.cdn" include "physics/cjoints.cdn" integrator { method = "runge-kutta" } node "panto" : physics.system { node "hip" : physics.joints.revoluteY { com = "[0; 0; -0.02]" m = "0.01" I = "Inertia.Box(m, 0.01, 0.005, 0.04)" q = "0.1 * pi" # Torque due to slight damping D = "1e-3" τ = "-D * dq" } node "knee" : physics.joints.revoluteY { tr = "[0; 0; -0.04]" com = "[0; 0; -0.03]" m = "0.02" I = "Inertia.Box(m, 0.01, 0.005, 0.06)" q = "-0.4 * pi" # Torque due to a virtual spring around the # initial angle of the leg q0 = "q" | once K = "0.1" τ = "K * (q0 - q)" } node "ankle" : physics.joints.revoluteY { tr = "[0; 0; -0.06]" com = "[0; 0; -0.025]" m = "0.01" I = "Inertia.Box(m, 0.01, 0.005, 0.05)" q = "0.4 * pi" } node "par" : physics.joints.revoluteY { tr = "[0; 0; 0.02]" com = "[0; 0; 0.025]" m = 0.1 I = "Inertia.Box(m, 0.01, 0.005, 0.05)" q = "-0.4 * pi" } edge from "{hip,knee,ankle}" to ["knee", "ankle", "par"] : physics.joint {} # Close pantographic parallel structure node "parcl" : physics.cjoints.revoluteY { tr = "[0; 0; 0.06]" } edge from "{par,parcl}" to ["parcl", "hip"] : physics.cjoint {} include "physics/model.cdn" include "physics/dynamics.cdn" } ```

⌦ Open in playground