Toggle Clamp
A hold-down toggle clamp with an over-centre lock, made of five printed parts on M4 pivot screws. The clamp arm pivots on the base, the handle pivots on the tail of the arm, and two links join the handle to the base; pushing the handle forward straightens the knee, and just past dead centre the links come to rest against the back wall of the base, so the clamping load holds the clamp shut until the handle is pulled back. The four-bar linkage is solved in the code for any handle position: the closed position is asserted to be past centre, the spindle has to give about 0.5 mm to snap over, the arm opens 38 degrees, and every pair of parts is checked for collisions through the stroke. Assembled and closed it measures about 100 x 49 x 143 mm with a 60 mm reach; the print plate is 117 x 94 x 53 mm. Base and arm print on their floors, handle and links flat, no supports. Hardware: two M4 x 30 and two M4 x 25 screws with lock nuts, an M6 bolt with two nuts as the adjustable spindle, four M4 screws to mount the base. Parameters: reach, handle length, over-centre offset, pivot and spindle screw size, clearance, and how far the assembled view is opened.
# Toggle Clamp - hold-down clamp with an over-centre lock, five printed parts on M4 screws
#
# A four-bar toggle: the clamp arm pivots on the base at A, the handle pivots on the tail
# of the arm at C, and a pair of links joins the handle (D) to the base (B). Pushing the
# handle forward straightens the knee B-D-C; at dead centre the tail of the arm is as far
# from B as it can get and the spindle is pressed hardest into the work. The handle then
# goes a little further, D passes behind the line B-C and the links come to rest against
# the back wall of the base. From there the clamping load only pushes the knee harder
# into the wall, so the clamp stays shut until the handle is pulled back.
# The linkage is solved in the code for any handle position (the "open" parameter of the
# assembled view), and the over-centre condition, the stop and every pair of parts
# through the stroke are asserted.
#
# Parts: base (U channel with a back wall), arm (U channel, web down), handle (one thick
# plate) and two link plates. All print without supports in the print layout: base and
# arm on their floors, handle and links flat.
# Hardware: pivots A and B M4 x 30, C and D M4 x 25, each with a lock nut; an M6
# bolt with two nuts through the arm tip as the adjustable spindle; four M4 screws to
# hold the base down.
@param choices:["print", "assembled"] desc:"Print layout or assembled view"
$view = "print"
@param 0..100 step:5 desc:"Assembled view: how far the clamp is opened (%)"
$open = 0
@param 40..90 step:5 group:"Size" desc:"Reach: arm pivot to spindle axis (mm)"
$reach = 60
@param 60..140 step:5 group:"Size" desc:"Length of the handle above its pivot (mm)"
$handle_len = 90
@param 1..2.5 step:0.1 group:"Linkage" desc:"Over-centre offset of the knee when closed (mm)"
$over = 1.5
@param 3..5 step:1 group:"Hardware" desc:"Pivot screw size (3 = M3, 4 = M4, 5 = M5)"
$pivot_d = 4
@param 5..8 step:1 group:"Hardware" desc:"Spindle bolt size (6 = M6)"
$spindle_d = 6
@param 0.2..0.4 step:0.05 group:"Print" desc:"Side clearance between the layers of the joint (mm)"
$gap = 0.3
# --- linkage (side view: u forward, v up; A is the arm pivot) -----------------------------
$r_e = 6.5 # radius of every eye around a pivot
$arm_a = 16 # A to C, tail of the arm
$link_l = 20 # B to D, the links
$hand_d = 14 # D to C on the handle
$floor_t = 5
$hb = $floor_t + $r_e + 1.5 # height of B
$op_max = 48 # link rotation from closed to fully open (deg)
$bu = -$arm_a
$dcu = -$arm_a - $over # closed: D sits `over` behind the line B-C
$dcv = $hb + sqrt($link_l ** 2 - $over ** 2)
$ha = $dcv + sqrt($hand_d ** 2 - $over ** 2) # A and C are level when closed: the arm is horizontal
$lam_c = atan2($dcv - $hb, $dcu - $bu) # direction of the links when closed (a little over 90)
assert $hand_d >= 2 * $r_e + 0.8 # eye of the arm tail clears the eye of the links
assert $arm_a >= 2 * $r_e + 0.8
# intersection of two circles, on the left of the line from (pu,pv) to (qu,qv)
def ccd($pu, $pv, $qu, $qv) = sqrt(($qu - $pu) ** 2 + ($qv - $pv) ** 2)
def ccx($pu, $pv, $r1, $qu, $qv, $r2) = (ccd($pu, $pv, $qu, $qv) ** 2 + $r1 ** 2 - $r2 ** 2) / (2 * ccd($pu, $pv, $qu, $qv))
def cch($pu, $pv, $r1, $qu, $qv, $r2) = sqrt($r1 ** 2 - ccx($pu, $pv, $r1, $qu, $qv, $r2) ** 2)
def ccu($pu, $pv, $r1, $qu, $qv, $r2) = $pu + (ccx($pu, $pv, $r1, $qu, $qv, $r2) * ($qu - $pu) - cch($pu, $pv, $r1, $qu, $qv, $r2) * ($qv - $pv)) / ccd($pu, $pv, $qu, $qv)
def ccv($pu, $pv, $r1, $qu, $qv, $r2) = $pv + (ccx($pu, $pv, $r1, $qu, $qv, $r2) * ($qv - $pv) + cch($pu, $pv, $r1, $qu, $qv, $r2) * ($qu - $pu)) / ccd($pu, $pv, $qu, $qv)
# pose for a link rotation $o (deg) forward from the closed position
def d_u($o) = $bu + $link_l * cos($lam_c - $o)
def d_v($o) = $hb + $link_l * sin($lam_c - $o)
def c_u($o) = ccu(d_u($o), d_v($o), $hand_d, 0, $ha, $arm_a)
def c_v($o) = ccv(d_u($o), d_v($o), $hand_d, 0, $ha, $arm_a)
def arm_rot($o) = atan2($ha - c_v($o), -c_u($o)) # 0 closed, + lifts the tip
def hand_rot($o) = atan2(c_v($o) - d_v($o), c_u($o) - d_u($o)) - atan2($ha - $dcv, $bu - $dcu)
# which side of the line B-C the knee D is on: + behind (locked side), - in front
def side($o) = (c_u($o) - $bu) * (d_v($o) - $hb) - (c_v($o) - $hb) * (d_u($o) - $bu)
assert abs(c_u(0) - $bu) < 0.001 # the solver reproduces the closed position
assert abs(c_v(0) - $ha) < 0.001
assert abs(arm_rot(0)) < 0.001
assert side(0) > 0 # closed: the knee is past centre
assert side(10) < 0 # ten degrees open: it is in front again
# dead centre: B, D, C in line, C at distance link_l + hand_d from B
$cdu = ccu($bu, $hb, $link_l + $hand_d, 0, $ha, $arm_a)
$cdv = ccv($bu, $hb, $link_l + $hand_d, 0, $ha, $arm_a)
$rot_dc = atan2($ha - $cdv, -$cdu)
assert $rot_dc < 0 # the arm is lower at dead centre than closed:
$squeeze = $reach * sin(-$rot_dc) # the spindle has to give this much to snap over
assert $squeeze > 0
assert arm_rot($op_max) >= 30 # opening of the arm
assert hand_rot($op_max) > hand_rot($op_max - 4) # the handle is still moving back at full open
# --- layers across the width (z in the flat frame): 0 handle, 1 arm + links, 2 base cheeks
$t0 = 8 # handle
$t1 = 4 # arm flanges and links
$t2 = 4 # cheeks
$z1 = $t0 / 2 + $gap
$z2 = $z1 + $t1 + $gap
$zw = $z2 + $t2 # half width over the cheeks
$r_piv = $pivot_d / 2 + 0.2
$r_head = $pivot_d * 0.95 # room kept for a screw head or nut
def stad($u1, $v1, $u2, $v2, $r, $z, $h) = wire [($u1, $v1), ($u2, $v2)] | offset $r | extrude $h | translate 0 0 $z
def bore($u, $v) = cylinder $r_piv (2 * $zw + 2) | translate $u $v 0
# --- handle: eyes at D and C, grip leaning 12 deg back from the line D-C --------------------
$grip_a = atan2($ha - $dcv, $bu - $dcu) + 12
$gu = $bu + $handle_len * cos($grip_a)
$gv = $ha + $handle_len * sin($grip_a)
$hand0 = union [stad($dcu, $dcv, $bu, $ha, $r_e, -$t0 / 2, $t0), stad($bu, $ha, $gu, $gv, $r_e, -$t0 / 2, $t0)]
$hand_holes = union [bore($dcu, $dcv), bore($bu, $ha)]
$handle = $hand0 - $hand_holes
assert $handle.solids == 1
# --- links: two plates B to D ------------------------------------------------------------
$link0 = stad($bu, $hb, $dcu, $dcv, $r_e, $z1, $t1)
$link_holes = union [bore($bu, $hb), bore($dcu, $dcv)]
$link_a = $link0 - $link_holes
$link_b = $link_a | translate 0 0 (-2 * $z1 - $t1)
assert $link_a.solids == 1
# --- arm: two flanges from C past A to the tip, web underneath, block for the spindle -----
$tip = $reach + $spindle_d + 2
$web0 = $r_e + 2 # the web starts in front of the pivot
$fl_a = stad($bu, $ha, $reach, $ha, $r_e, $z1, $t1)
$fl_b = stad($bu, $ha, $reach, $ha, $r_e, -$z1 - $t1, $t1)
$web = box ($tip - $web0) 4 (2 * ($z1 + $t1)) center:(false, false, true) | translate $web0 ($ha - $r_e) 0
$block = box (2 * $spindle_d + 4) (2 * $r_e) (2 * ($z1 + $t1)) center:(false, false, true) | translate ($reach - $spindle_d - 2) ($ha - $r_e) 0
$spin = cylinder ($spindle_d / 2 + 0.2) (2 * $r_e + 2) | rotate 90 0 0 | translate $reach $ha 0
$arm0 = union [$fl_a, $fl_b, $web, $block]
$arm_holes = union [bore(0, $ha), bore($bu, $ha), $spin]
$arm = $arm0 - $arm_holes
assert $arm.solids == 1
# --- base: floor, two cheeks carrying A and B, back wall as the stop ------------------------
$stop_gap = 0.1 # drawn gap between the knee and the back wall
$uw = $dcu - $r_e - $stop_gap # front of the back wall
$ur = $uw - 5
$hc = $r_head + 1.2 # the cheeks keep this far from the D screw path
$dmu = d_u($op_max)
$dmv = d_v($op_max)
$mid = $dmv - $hc # top of the cheeks between wall and column
$ul = $dmu + $hc # back of the column under A
$uf = $ul + 15
assert $mid >= $hb + $r_piv + 2 # material above the B bore
assert $dmv + $hc <= $ha - 3
$cheek2d = polyline [($ur, 0), ($ur, $dcv + 2), ($uw, $dcv + 2), ($uw, $mid), ($ul, $mid), ($ul, $dmv + $hc), (-$r_e, $ha - 2), (-$r_e, $ha), ($r_e, $ha), ($uf, 0)]
$cheek_a = union [$cheek2d | extrude $t2 | translate 0 0 $z2, cylinder $r_e $t2 center:(true, true, false) | translate 0 $ha $z2]
$cheek_b = $cheek_a | translate 0 0 (-2 * $z2 - $t2)
$flange = 12 # floor outside the cheeks, for the mounting screws
$floor = box ($uf - $ur) $floor_t (2 * ($zw + $flange)) center:(false, false, true) | translate $ur 0 0
$wall = box ($uw - $ur) ($dcv + 2) (2 * $zw) center:(false, false, true) | translate $ur 0 0
def mount($u, $z) = cylinder 2.25 ($floor_t + 2) | rotate 90 0 0 | translate $u ($floor_t / 2) $z
$mounts = union [mount($ur + 7, $zw + $flange / 2), mount($ur + 7, -$zw - $flange / 2), mount($uf - 7, $zw + $flange / 2), mount($uf - 7, -$zw - $flange / 2)]
$base0 = union [$floor, $wall, $cheek_a, $cheek_b]
$base_holes = union [bore(0, $ha), bore($bu, $hb), $mounts]
$base = $base0 - $base_holes
assert $base.solids == 1
# --- the mechanism at a link rotation $o ---------------------------------------------------
def arm_at($o) = $arm | rotate 0 0 arm_rot($o) origin:(0, $ha, 0)
def hand_at($o) = $handle | rotate 0 0 hand_rot($o) origin:($dcu, $dcv, 0) | translate (d_u($o) - $dcu) (d_v($o) - $dcv) 0
def link_at($s, $o) = $s | rotate 0 0 (-$o) origin:($bu, $hb, 0)
# screws as envelopes: shank through the whole width, heads outside the parts they join
$pin_a = cylinder ($pivot_d / 2) (2 * $zw) | translate 0 $ha 0
$pin_b = cylinder ($pivot_d / 2) (2 * $zw) | translate $bu $hb 0
$head = cylinder $r_head 4 center:(true, true, false)
$heads_c0 = union [$head | translate $bu $ha ($z2 - $gap + 0.05), $head | translate $bu $ha (-$z2 + $gap - 0.05 - 4)]
$heads_d0 = union [$head | translate $dcu $dcv ($z2 - $gap + 0.05), $head | translate $dcu $dcv (-$z2 + $gap - 0.05 - 4)]
def heads_c($o) = $heads_c0 | rotate 0 0 arm_rot($o) origin:(0, $ha, 0)
def heads_d($o) = $heads_d0 | rotate 0 0 (-$o) origin:($bu, $hb, 0)
# closed: everything clear, the knee 0.1 mm from the wall, and the wall is what stops it
assert clear($base, hand_at(0))
assert clear($base, link_at($link_a, 0))
assert clear($base, hand_at(-2)) == false
assert clear($base, link_at($link_a, -2)) == false
# every pair of parts at four positions through the stroke
def pose_ok($o) = clear($base, arm_at($o)) and clear($base, hand_at($o)) and clear($base, link_at($link_a, $o)) and clear($base, link_at($link_b, $o)) and clear(arm_at($o), hand_at($o)) and clear(arm_at($o), link_at($link_a, $o)) and clear(arm_at($o), link_at($link_b, $o)) and clear(hand_at($o), link_at($link_a, $o))
assert pose_ok(0)
assert pose_ok($op_max / 3)
assert pose_ok(2 * $op_max / 3)
assert pose_ok($op_max)
# screws: heads at C and D pass the cheeks, the handle and links pass the shanks at A and B
def screws_ok($o) = clear($base, heads_c($o)) and clear($base, heads_d($o)) and clear(arm_at($o), heads_d($o)) and clear(hand_at($o), $pin_a) and clear(hand_at($o), $pin_b) and clear(link_at($link_a, $o), $pin_a)
assert screws_ok(0)
assert screws_ok($op_max / 3)
assert screws_ok(2 * $op_max / 3)
assert screws_ok($op_max)
# --- output -----------------------------------------------------------------------------
def stand($s) = $s | rotate 90 0 0 # flat frame (u, v, z) to x = u, z = v
def put($s, $x, $y) = $s | translate ($x - $s.bbox.min[0]) ($y - $s.bbox.min[1]) (-$s.bbox.min[2])
$o_now = $open / 100 * $op_max
$asm = union [$base, arm_at($o_now), hand_at($o_now), link_at($link_a, $o_now), link_at($link_b, $o_now)]
$assembled = stand($asm)
assert $assembled.solids == 5
$base_s = stand($base)
$arm_s = stand($arm)
$hand_s = $handle | rotate 0 0 (-$grip_a)
$link_s = $link_a | rotate 0 0 (-$lam_c)
$base_p = put($base_s, 0, 0)
$arm_p = put($arm_s, 0, $base_s.bbox.y + 6)
$hand_p = put($hand_s, 0, $base_s.bbox.y + $arm_s.bbox.y + 12)
$link_p1 = put($link_s, $base_s.bbox.x + 6, 0)
$link_p2 = put($link_s, $base_s.bbox.x + 6, 2 * $r_e + 5)
$plate = union [$base_p, $arm_p, $hand_p, $link_p1, $link_p2]
assert $plate.solids == 5
assert clear($base_p, $arm_p)
assert clear($arm_p, $hand_p)
assert clear($base_p, $link_p1)
assert clear($link_p1, $link_p2)
assert clear($link_p2, $arm_p)
assert $plate.bbox.min[2] ~ 0 tol:0.001
assert $arm_p.bbox.z ~ 2 * $r_e tol:0.01 # the arm lies on its web
assert $hand_p.bbox.z ~ $t0 tol:0.01
assert $link_p1.bbox.z ~ $t1 tol:0.01
print "pivot height A (mm)" $ha "B (mm)" $hb
print "arm opens (deg)" arm_rot($op_max) "handle swings back (deg)" hand_rot($op_max)
print "spindle travel past dead centre (mm)" $squeeze
print "shown: link" $o_now "arm" arm_rot($o_now) "handle" hand_rot($o_now)
$out = if $view == "assembled" then $assembled else $plate
$out