Skip to main content

Module chain

Module chain 

Source
Expand description

A machine of joints, each driven by a motor through a transmission (joint::RotaryJoint): the machine for every mechanism that can say its dynamics in joint coordinates, M(q) q’’ + h(q, q’) = tau. A joint’s coordinate is an angle (rad) or a travel (m); its gearbox’s ratio is motor radians per unit of it, so a ball screw is a gearbox of ratio 2 pi / lead (times any reduction before it), a rack 1 / pinion radius, a linear motor 1 (its “rotor” the forcer, its torques forces). Stiffness, backlash, friction and stops are those at the joint, in its unit.

Rigid: the rotors turn with their joints times the ratio, their inertia counts at the joint times the ratio squared, and each gearbox loses its efficiency on what passes through it (two passes, as on the delta). Elastic (effects.joint_elasticity): the rotors are states of their own behind the gearboxes’ springs.

A mechanism (Mechanism) gives the load’s dynamics, its kinematics from joints to the tool, its own signals and rating checks and its scene. Everything else (states, losses, energy, torque breakdown, friction view, heating gearboxes) is here, the same for all.

Structs§

FlexCoupling
The two-way bending modes (Mechanism::flex_coupling) at one moment, with T = 1/2 q’^T M q’ + d’^T p + 1/2 d’^T M_d d’ their share of the kinetic energy and V = -d^T Q_g of the potential:
FlexMode
A bending mode of a mechanism’s load (Mechanism::flex_modes): its modal mass (kg), stiffness (N/m) and damping (N s/m), in the coordinate of its deflection (a link’s tip, m; a twist’s angle, rad, and kg m^2, N m/rad), the link (0 the first) it bends and how.
JointMachine
JointSpec
One joint as the machine sees it: its drive, the joint’s id and translation key (for friction contacts and signals), and where it has a gearbox ahead of a converter (screw, rack): the joint’s travel per radian of the gearbox output, so that the torque at the gearbox output is the joint force times it (signal gearbox.<motor>.output_torque).
Lu
solve’s elimination of a fixed-size matrix, kept for several right-hand sides: each solve does the very operations solve does, so the results are the same to the bit, without a heap allocation and with the matrix eliminated once.

Enums§

FlexKind
How a link deflects in a FlexMode: in the plane its joint turns it in, across that plane, or twisted about its length; a bend’s second shape where a link bends in two (BendSecond, BendAcrossSecond).

Constants§

JOINT_KEYS
MOTOR_IDS
Motor ids “1” to “7” and the ids of their gearboxes’ loss powers, so that ThermalPart gets &'static strs.
MOTOR_KEYS
Translation keys of motors 1 to 7 and of joints 1 to 7.

Traits§

Mechanism
What a mechanism tells the joint machine.

Functions§

condition_number
The 2-norm condition number of a rows x cols matrix (row by row): sqrt of the largest over the smallest eigenvalue of J^T J; infinite where it is singular.
eigenvalues
The eigenvalues of the symmetric n x n matrix a (row by row), by Jacobi rotations.
invert
The inverse of an n x n matrix (row by row), column by column with solve; None where it is singular.
matrix_modes
matrix_modes_at with a constant C (symmetric, row by row).
solve
Solves the n x n system m (row by row) x = b by Gaussian elimination with partial pivoting; None where m is singular.
solve_in_place
solve without its copies: eliminates a in place and leaves the solution in x; false where a is singular or the solution not finite (a and x are then of no use).