Skip to content

Commit ccc8df5

Browse files
committed
Refactor lift cylinder mount calculations for leverage
Reworked the lift cylinder base Y and Z position calculations to optimize leverage at the lowest arm position. The new approach computes attachment points based on arm geometry, axle clearance, and desired cylinder angle, improving clarity and maintainability.
1 parent 7e0cf87 commit ccc8df5

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

LifeTrac-v25/mechanical_design/openscad/lifetrac_v25.scad

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,33 @@ BUCKET_TILT_ANGLE = BUCKET_GROUND_TILT + (animation_phase * (BUCKET_MAX_CURL - B
232232
// =============================================================================
233233

234234
// Lift cylinder mounting points (arms pivot at rear, cylinders attach forward)
235-
LIFT_CYL_BASE_Y = WHEEL_BASE * 0.5; // Base mount Y position (forward of pivot)
236-
LIFT_CYL_BASE_Z = FRAME_Z_OFFSET + MACHINE_HEIGHT * 0.4; // Base mount Z position
235+
// Optimized for leverage at bottom position (cylinder pushes up/forward from low rear point)
236+
237+
// 1. Define Arm Attachment Point
237238
LIFT_CYL_ARM_OFFSET = ARM_LENGTH * 0.25; // Attachment point along arm from pivot (proportional)
238239

240+
// 2. Calculate Arm Attachment Position in World Coords at Lowest Angle (Bucket on Ground)
241+
// Pivot is at [0, ARM_PIVOT_Y, ARM_PIVOT_Z]
242+
_theta_min = -ARM_GROUND_ANGLE;
243+
_attach_y_world = ARM_PIVOT_Y + LIFT_CYL_ARM_OFFSET * cos(_theta_min);
244+
_attach_z_world = ARM_PIVOT_Z + LIFT_CYL_ARM_OFFSET * sin(_theta_min);
245+
246+
// 3. Determine Base Z Height (Constrained by Axle Clearance)
247+
// Must clear the rear axle (FRAME_Z_OFFSET + WHEEL_DIAMETER/2)
248+
_min_base_z = FRAME_Z_OFFSET + WHEEL_DIAMETER/2 + 80; // 80mm clearance
249+
LIFT_CYL_BASE_Z = _min_base_z;
250+
251+
// 4. Calculate Base Y for Optimal Leverage Angle
252+
// We want the cylinder to push at an angle ~45-50 degrees from horizontal
253+
// to be roughly perpendicular to the arm (which is at ~-45 degrees).
254+
// Slope m = tan(target_angle).
255+
// Y = Attach_Y - (Attach_Z - Base_Z) / m
256+
_target_cyl_angle = 50; // Degrees
257+
_calc_base_y = _attach_y_world - (_attach_z_world - LIFT_CYL_BASE_Z) / tan(_target_cyl_angle);
258+
259+
// 5. Clamp Y to valid frame range (0 to WHEEL_BASE/2)
260+
LIFT_CYL_BASE_Y = max(50, min(WHEEL_BASE/2, _calc_base_y));
261+
239262
// Bucket cylinder mounting points
240263
// Cylinders now attach to the cross beam instead of individual arms
241264
BUCKET_CYL_ARM_POS = CROSS_BEAM_1_POS; // Mount at cross beam position

0 commit comments

Comments
 (0)