Skip to main content

Crate machine_hexapod

Crate machine_hexapod 

Source
Expand description

Hexapod (Stewart-Gough platform): six electric cylinders between a base and a moving platform, each a ball screw driven by its own servo motor through a coupling. Six degrees of freedom: the tool pose is the platform centre x, y, z (m) and the platform’s orientation as a rotation vector rx, ry, rz (rad, axis times angle, in the base frame).

Geometry (generic proportions, [hexapod]): the base joints B_i on a circle of base_radius_m in pairs at 120 k +- base_half_angle_deg, the platform joints a_i (platform frame) on a circle of platform_radius_m at 120 k +- (60 - platform_half_angle_deg), so that each leg runs from a base pair to the neighbouring platform pair and the six legs form the usual triangles. Leg i’s length is L_i = leg.closed_length_m + q_i with q_i the cylinder’s extension, its joint coordinate (0 to leg.stroke_m).

inverse   P_i = p + R a_i,  d_i = P_i - B_i,  L_i = |d_i|,  q_i = L_i - L_closed                   (closed form)
twist     xi = (v, w): q_i' = u_i . v + (b_i x u_i) . w,  u_i = d_i / L_i,  b_i = R a_i,  rows of J
forward   Newton on the twist: xi = J^-1 (q - q(x)), p += v, R = exp(w) R, from the home pose, until |q - q(x)|
          < 1e-13 m; refused (NaN) where it does not converge within 40 steps
dynamics  M_xi xi' + c + g = J^T f,  M_xi = diag(m 1, R I R^T),  c = (0, w x I_w w),  g = (0, 0, m g, 0, 0, 0)
          q'' = J xi' + a0,  a0_i = (|w_i|^2 - (u_i . w_i)^2) / L_i + u_i . (w x (w x b_i)),  w_i = v + w x b_i
          so in leg space: M_q = J^-T M_xi J^-1,  h = J^-T (c + g - M_xi J^-1 a0),  M_q q'' + h = f

f_i is the force leg i pushes the platform with: what its screw passes on (chain::JointMachine, one joint::RotaryJoint with a transmission::BallScrew per leg: the screw and nut stiffness, the coupling, backlash, friction in the screw and the rod’s guide, the motor).

Each leg is two bodies: the part on the platform joint (the rod and nut, mass leg.platform_share of leg.mass_kg, its centre leg.platform_part_centre_m from the platform joint towards the base) and the part on the base joint (cylinder and motor, the rest of the mass, its centre leg.base_part_centre_m from the base joint towards the platform), each with its inertia about its own centre across the leg (leg.*_part_inertia_kgm2, 0 = a point mass). Both turn with the leg’s direction u = d / L. With d’ = v + w x b (the platform joint’s velocity) and L’ = u . d’:

u' = (d' - u L') / L,  L'' = u' . d' + u . d'',  u'' = (d'' - 2 u' L' - u L'') / L        (d'' = w x (w x b) at xi' = 0)
base part  X = B + c u,        X' = c u' = A xi,    A = c A_u,           A_u = (1 - u u^T) [1, -[b]x] / L
rod part   X = P - c u,        X' = P' - c u',      A = [1, -[b]x] - c A_u,  P = p + b

and with a0 the acceleration at xi’ = 0 (c u’’ for the base part, w x (w x b) - c u’’ for the rod part) each part adds m A^T A + I_t A_u^T A_u to M_xi and m A^T (a0 + g e_z) + I_t A_u^T u’’ to c + g (d’Alembert; I_t about the centre across the leg, whose turn is u x u’). The platform’s mass and inertia are the platform’s alone, the payload is a point mass at the platform centre with the inertia mass.payload_inertia_kgm2 (x, y, z, about the centre, in the platform frame) that turns with the platform. The legs’ rotors spin along their legs and turn with them (effects.rotor_gyroscopic): the moment h u’ (h = J i q’) reaches the platform as a couple across the leg, F = h (u x u’) / L at its joint and b x F, which does no work (rotor_gyroscopic); each part’s spin about the leg’s axis is free between the two joints and nothing excites it.

Structs§

Geometry
The hexapod’s geometry and kinematics, apart from masses and drives.
Hexapod
Legs
The legs at a platform pose: unit vectors u_i from base to platform joint, lengths L_i, and the platform joints’ offsets b_i = R a_i from the platform centre (base frame).

Constants§

LOSSY_EFFECTS
Effects that take energy out or put it in; the standard suite runs with them off.

Statics§

ENTRY

Functions§

exp
The rotation of a rotation vector.
log
The rotation vector (axis times angle, angle up to pi) of a rotation matrix.
lossless_config
The default config with every loss switched off.