Sign in with STEVE

steve/linear-guide

Profile linear guide envelope: HGR15, 20, 25 and MGN rails of any length, HGH and HGW blocks.

v1.0.0 Latest STEVE MIT 0

Not affiliated with or endorsed by HIWIN.

Isometric
part.py 66 lines · Python · STEVE runtime · checked
Download
1"""Profile linear guide, HIWIN sizes: a rail of any length (HGR, MGNR) or a block (HGH CA/HA, HGW CC/HC) as an envelope for
2assemblies. The rail: a WR x HR bar along X, centred on the origin, base on the XY plane, with counterbored mounting
3holes at pitch P centred along the length. A block: a W x L body from H1 (its underside above the rail's base) to H, the rail's
4WR x HR section as the channel through it, and four mounting holes at B (across) x C (along), threads drawn at nominal diameter.
5Ball tracks, end seals and lubrication fittings are not modelled."""
6from steve import Model
7
8size = "HGR20" # Rail size
9component = "rail" # Rail or block type
10rail_length = 300 # mm Rail length (rail only)
11
12# rail: (WR, HR, D counterbore, h counterbore depth, d through hole, P pitch, E smallest end distance)
13# HGR: HIWIN Linear Guideway Technical Information as in the HIWIN catalogue PDF (mirror https://www.tuli.si/files/HIWIN_celotni_katalog.pdf),
14# Table 1.17, p. 20. MGN: HIWIN FORM G99TE24-2410, 2-4-19 (1), printed p. 88.
15RAILS = {
16 "HGR15": (15, 15.0, 7.5, 5.3, 4.5, 60, 6), "HGR20": (20, 17.5, 9.5, 8.5, 6.0, 60, 7), "HGR25": (23, 22.0, 11.0, 9.0, 7.0, 60, 8),
17 "MGN7": (7, 4.8, 4.2, 2.3, 2.4, 15, 5), "MGN9": (9, 6.5, 6, 3.5, 3.5, 20, 7.5),
18 "MGN12": (12, 8, 6, 4.5, 3.5, 25, 10), "MGN15": (15, 10, 6, 4.5, 3.5, 40, 15),
19}
20# (rail, block type): (H, H1, W, B, C, L, thread M, depth l). HGH: Table 1.14, p. 17; HGW: Table 1.16, p. 19; MGN: as above.
21BLOCKS = {
22 ("HGR15", "HGH-CA"): (28, 4.3, 34, 26, 26, 61.4, 4, 5), ("HGR20", "HGH-CA"): (30, 4.6, 44, 32, 36, 77.5, 5, 6),
23 ("HGR20", "HGH-HA"): (30, 4.6, 44, 32, 50, 92.2, 5, 6), ("HGR25", "HGH-CA"): (40, 5.5, 48, 35, 35, 84.0, 6, 8),
24 ("HGR25", "HGH-HA"): (40, 5.5, 48, 35, 50, 104.6, 6, 8), ("HGR15", "HGW-CC"): (24, 4.3, 47, 38, 30, 61.4, 5, 6),
25 ("HGR20", "HGW-CC"): (30, 4.6, 63, 53, 40, 77.5, 6, 8), ("HGR20", "HGW-HC"): (30, 4.6, 63, 53, 40, 92.2, 6, 8),
26 ("HGR25", "HGW-CC"): (36, 5.5, 70, 57, 45, 84.0, 8, 8), ("HGR25", "HGW-HC"): (36, 5.5, 70, 57, 45, 104.6, 8, 8),
27}
28
29WR, HR, D, h, d, P, E = RAILS[size]
30model = Model()
31if component == "rail":
32 if rail_length < 2 * E:
33 raise ValueError(f"The rail must be at least 2 E = {2 * E} mm long.")
34 holes = int((rail_length - 2 * E) // P) + 1
35 x0 = -(holes - 1) * P / 2
36 with model.sketch("rail_sketch", on="XY", name="Rail") as sk:
37 sk.rect("outline", (-rail_length / 2, -WR / 2), (rail_length / 2, WR / 2))
38 model.extrude("rail", "rail_sketch", distance=HR, name="Rail")
39 with model.sketch("holes_sketch", on="XY", name="Mounting holes") as sk:
40 for i in range(holes):
41 sk.circle(f"hole_{i + 1}", (x0 + i * P, 0), d / 2)
42 model.extrude("holes", "holes_sketch", distance=HR, op="cut", name="Mounting holes")
43 model.plane("cbore_plane", on="XY", offset=HR - h, name="Counterbore floor")
44 with model.sketch("cbore_sketch", on="cbore_plane", name="Counterbores") as sk:
45 for i in range(holes):
46 sk.circle(f"cbore_{i + 1}", (x0 + i * P, 0), D / 2)
47 model.extrude("cbores", "cbore_sketch", distance=h, op="cut", name="Counterbores")
48else:
49 if (size, component) not in BLOCKS:
50 raise ValueError(f"{size}: no block {component} in the source.")
51 H, H1, W, B, C, L, M, l = BLOCKS[(size, component)]
52 model.plane("base_plane", on="XY", offset=H1, name="Block underside")
53 with model.sketch("block_sketch", on="base_plane", name="Block") as sk:
54 sk.rect("outline", (-L / 2, -W / 2), (L / 2, W / 2))
55 model.extrude("block", "block_sketch", distance=H - H1, name="Block")
56 with model.sketch("channel_sketch", on="base_plane", name="Rail channel") as sk:
57 sk.rect("channel", (-L / 2, -WR / 2), (L / 2, WR / 2))
58 model.extrude("channel", "channel_sketch", distance=HR - H1, op="cut", name="Rail channel")
59 model.plane("thread_plane", on="XY", offset=H - l, name="Thread bottom")
60 with model.sketch("thread_sketch", on="thread_plane", name="Mounting threads") as sk:
61 for i, (x, y) in enumerate([(-C / 2, -B / 2), (C / 2, -B / 2), (C / 2, B / 2), (-C / 2, B / 2)]):
62 sk.circle(f"thread_{i + 1}", (x, y), M / 2)
63 model.extrude("threads", "thread_sketch", distance=l, op="cut", name="Mounting threads")
64model.material("steel-generic", color="#9da2a8")
65result = model.result()
66

Profile linear guide in HIWIN's public sizes, as an envelope for assemblies: a rail of any length with its mounting holes, or a block with the rail's channel and four mounting holes. Ball tracks, seals and fittings are not modelled. Length along X, base on the XY plane. See the README; not affiliated with HIWIN.

Linear guide (HGR, MGN)

A rail of any length, or a block, in HIWIN's public sizes, as an envelope for assemblies. The MGN blocks are in the miniature-linear-guide part.

Geometry

  • Rail: a WR × HR bar along X, centred on the origin, base on the XY plane, with counterbored mounting holes at pitch P centred along the length (at least E from each end).
  • Block: a W × L body from H1 above the rail's base up to H, with the rail's section as its channel and four mounting holes at B × C (threads drawn at nominal diameter).

Ball tracks, end seals and lubrication fittings aren't modelled.

Source

  • HG rails and blocks: HIWIN Linear Guideways catalogue (the copy at https://www.tuli.si/files/HIWIN_celotni_katalog.pdf), Table 1.14 Dimensions of the block HGH (p. 17), Table 1.16 HGW (p. 19), Table 1.17 Dimensions of the rail HGR_R (p. 20).
  • MGN rails: HIWIN Linear Guideway Technical Information, FORM G99TE24-2410, section 2-4-19 (1), printed p. 88.
Rail WR HR D h d P E min
HGR15 15 15 7.5 5.3 4.5 60 6
HGR20 20 17.5 9.5 8.5 6 60 7
HGR25 23 22 11 9 7 60 8
MGN7 7 4.8 4.2 2.3 2.4 15 5
MGN9 9 6.5 6 3.5 3.5 20 7.5
MGN12 12 8 6 4.5 3.5 25 10
MGN15 15 10 6 4.5 3.5 40 15

Every block row is in part.py (BLOCKS). The HIWIN name identifies the source; this part isn't made by or affiliated with HIWIN. Preset lengths: step.parts catalogue metadata (MIT, library/NOTICE.md).

  1. 1.0.0 Latest
More #linear-guide
STEVEMIT

steve/miniature-linear-guide

HIWIN MGN miniature linear guideway, sizes 7, 9, 12 and 15: rail (MGNR) or block (MGN-C / MGN-H).

0 9 sizes 0 3 days ago v1.0.0
STEVEMIT

steve/precision-shaft

Precision round shaft for linear bearings: any diameter and length, with the common sizes as presets.

0 117 sizes 0 2 hours ago v1.0.0
STEVEMIT

steve/lead-screw

Trapezoidal lead screw envelope: Tr8, Tr10, Tr12 and Tr16, leads 2 to 8 mm, any length.

0 84 sizes 0 2 hours ago v1.0.0
STEVEMIT

steve/damper-envelope

Dashpot / gas strut envelope: Ø10 body and Ø5 piston rod as two bodies, any stroke.

0 5 sizes 0 3 days ago v1.0.0