Expand description
LinkageMachine: a planar parallel linkage built from a machine file’s [[machine.linkage]] node: two motor-driven
arms in the vertical x-z plane, one at each side of the base, each carrying a pair of forearms down to a plate that
keeps its orientation (a five-bar whose lower links are parallelograms: the planar delta). The tool is the plate’s
centre; the node’s two axes are its x (across) and z (up).
The registered planar delta’s equations, for any lengths and masses the node names (the crate’s module comment derives them). Arm k points along s_k x (s_1 = +1, s_2 = -1); e = base radius - platform radius, the arm angle theta_k (0 horizontal, positive down), upper arm L_a, forearm L_b:
elbow c_k = (s_k (e + L_a cos theta), -L_a sin theta)
inverse A cos theta + B sin theta + C = 0, A = -2 L_a (x' - e), B = 2 L_a z, C = (x' - e)^2 + z^2 + L_a^2 - L_b^2
theta = 2 atan((-B - sqrt(A^2 + B^2 - C^2)) / (C - A)) (elbow out; x' = s_k x)
forward p = the lower of the two points at L_b from both elbows
Jacobian J_x p' = J_q theta', J_x rows u_k = p - c_k, J_q = diag(u_k . dc_k/dtheta_k); J = J_x^-1 J_q
dynamics M(theta) theta'' = tau_gear + Q_g - m_nt J^T J_x^-1 w + tau_joint, M = I_b 1 + m_nt J^T J
I_b = I_arm + L_a^2 (m_elbow + r m_fb), Q_g,k = g m_LG cos theta_k - m_nt g J_zk
m_LG = m_arm l_cg + L_a (m_elbow + r m_fb), m_nt = plate + payload + 2 (1 - r) m_fbEach arm’s joint is a RotaryJoint read from its motor’s own config (catalog::motor_config: [motor],
[gearbox] with [motor.<id>], [gearbox.<id>] over them) and the shared [joint] (bearing friction, stops),
elastic or rigid with effects.joint_elasticity. The machine is the crate’s, line for line, so that the file
machines/planar-delta.toml gives the crate’s numbers (crates/sim-machines/tests/machine_file_linkage.rs).
Structs§
- Arms
- A linkage’s drives and names: per arm its joint, its motor and its gearbox’s id for its warmth (
gearbox_<motor>, as its loss is named); per axis of the tool its id and key. - Legs
- The legs’ geometry and the kinematics, apart from masses and drives.
- Linkage
Machine - Linkage
Node - The linkage node, read and checked: its number fields by name (an optional one left out is 0), and per arm the
gearbox node’s id (arm k’s motor is the netlist’s motor k). Two arms: the planar linkage (
LinkageMachine); three: the spatial one (crate::spatial::Delta).
Constants§
- LOSSY_
EFFECTS - Effects that take energy out or put it in, as on the registered planar delta: the standard suite runs with them off.
- SIDE
- The side each arm points to along x.
- SPATIAL_
ONLY - Values only the spatial linkage (three arms) reads: the range’s radius, the rods’ spin, the upper arms’ bending.
Traits§
- Numbers
- Where a linkage reads its numbers: a crate’s tables by their paths (
geometry.forearm_m), or a file’s linkage node by the path’s last part (forearm_m), so that one constructor serves both.
Functions§
- condition_
number - The 2-norm condition number of a 2 x 2 matrix: the square root of the larger over the smaller eigenvalue of J^T J, m +- sqrt(((a - c) / 2)^2 + b^2) with m = (a + c) / 2 for J^T J = [[a, b], [b, c]].
- dot
- inverse
- The inverse of a 2 x 2 matrix;
Nonewhere it is singular. - mul
- norm
- steady_
loss - The gearbox’s loss factor at a steady speed
wwhere it passesoutputto the arm:rigid_solvetakes it of the torque that goes in, output / loss, so it is found by fixed point (the efficiency’s fade over the power makes the two differ by 1e-3 of the torque at 0.01 m/s on the linkage). - sub
- transpose