first commit: 机械设计/机械原理考研笔记(齿轮、轮系知识点 + 配图 + 练习 + 考纲对照)
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 318 KiB |
|
After Width: | Height: | Size: 186 KiB |
|
After Width: | Height: | Size: 204 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 203 KiB |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 160 KiB |
|
After Width: | Height: | Size: 174 KiB |
|
After Width: | Height: | Size: 126 KiB |
|
After Width: | Height: | Size: 137 KiB |
|
After Width: | Height: | Size: 194 KiB |
|
After Width: | Height: | Size: 259 KiB |
|
After Width: | Height: | Size: 333 KiB |
|
After Width: | Height: | Size: 257 KiB |
|
After Width: | Height: | Size: 355 KiB |
|
After Width: | Height: | Size: 272 KiB |
|
After Width: | Height: | Size: 306 KiB |
|
After Width: | Height: | Size: 323 KiB |
|
After Width: | Height: | Size: 212 KiB |
|
After Width: | Height: | Size: 391 KiB |
|
After Width: | Height: | Size: 349 KiB |
@@ -0,0 +1,754 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
《知识点-齿轮》配图生成脚本
|
||||
- 全部为**几何/数学作图**(渐开线方程、齿廓展成、摆线包络、受力分解…),非生成式 AI。
|
||||
- 参照 matplotlib skill:OO 接口、300 dpi、留白构图、注释框避让、引线标注。
|
||||
运行:python gen_figures.py → 同目录输出 figXX_*.png
|
||||
"""
|
||||
import os
|
||||
import numpy as np
|
||||
import matplotlib
|
||||
matplotlib.use("Agg")
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib.patches import Polygon, Arc
|
||||
|
||||
for fp in [r"C:/Windows/Fonts/simhei.ttf", r"C:/Windows/Fonts/msyh.ttc"]:
|
||||
if os.path.exists(fp):
|
||||
try:
|
||||
matplotlib.font_manager.fontManager.addfont(fp)
|
||||
except Exception:
|
||||
pass
|
||||
plt.rcParams.update({
|
||||
"font.sans-serif": ["SimHei", "Microsoft YaHei"],
|
||||
"axes.unicode_minus": False,
|
||||
"savefig.bbox": "tight",
|
||||
"figure.facecolor": "white",
|
||||
"savefig.facecolor": "white",
|
||||
})
|
||||
|
||||
OUT = os.path.dirname(os.path.abspath(__file__))
|
||||
DPI = 300
|
||||
|
||||
C_MAIN = "#1a1a1a"
|
||||
C_BLUE = "#1f6fb2"
|
||||
C_RED = "#d62728"
|
||||
C_GREEN = "#2ca02c"
|
||||
C_ORANGE = "#e6791b"
|
||||
C_PURPLE = "#8e44ad"
|
||||
C_GRAY = "#9a9a9a"
|
||||
|
||||
|
||||
def inv(a):
|
||||
return np.tan(a) - a
|
||||
|
||||
|
||||
def new_ax(w=7.6, h=5.6):
|
||||
fig, ax = plt.subplots(figsize=(w, h))
|
||||
ax.set_aspect("equal")
|
||||
ax.axis("off")
|
||||
return fig, ax
|
||||
|
||||
|
||||
def save(fig, name):
|
||||
fig.savefig(os.path.join(OUT, name), dpi=DPI)
|
||||
plt.close(fig)
|
||||
print("saved:", name)
|
||||
|
||||
|
||||
def arc(cx, cy, r, a0, a1, n=240):
|
||||
t = np.radians(np.linspace(a0, a1, n))
|
||||
return cx + r * np.cos(t), cy + r * np.sin(t)
|
||||
|
||||
|
||||
def note(ax, x, y, s, fs=11, ha="left", va="top", ec="#d5d5d5", fc="white"):
|
||||
ax.text(x, y, s, fontsize=fs, ha=ha, va=va, zorder=10, linespacing=1.6,
|
||||
bbox=dict(boxstyle="round,pad=0.45", fc=fc, ec=ec, alpha=0.96))
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 渐开线 / 齿廓 生成
|
||||
# =====================================================================
|
||||
def gear_profile(z, m, alpha_deg=20.0, x=0.0, ha_star=1.0, c_star=0.25,
|
||||
nf=60, one_tooth=None):
|
||||
"""渐开线直齿圆柱齿轮齿廓点集。one_tooth 指定则只生成单个齿。"""
|
||||
z = int(round(z))
|
||||
a = np.radians(alpha_deg)
|
||||
r = m * z / 2.0
|
||||
rb = r * np.cos(a)
|
||||
ra = r + (ha_star + x) * m
|
||||
rf = r - (ha_star + c_star - x) * m
|
||||
s = np.pi * m / 2 + 2 * x * m * np.tan(a)
|
||||
inva = inv(a)
|
||||
hp = s / (2 * r)
|
||||
|
||||
def half_ang(rk):
|
||||
rk = np.maximum(rk, rb)
|
||||
ak = np.arccos(np.clip(rb / rk, -1, 1))
|
||||
return hp - (inv(ak) - inva)
|
||||
|
||||
r0 = max(rb, rf)
|
||||
h0 = float(np.asarray(half_ang(r0)).reshape(()))
|
||||
hA = float(np.asarray(half_ang(ra)).reshape(()))
|
||||
idxs = range(z) if one_tooth is None else [one_tooth]
|
||||
pts = []
|
||||
for i in idxs:
|
||||
phi = 2 * np.pi * i / z
|
||||
pts.append((rf * np.cos(phi - h0), rf * np.sin(phi - h0)))
|
||||
rk = np.linspace(r0, ra, nf)
|
||||
ang = phi - half_ang(rk)
|
||||
pts += list(zip(rk * np.cos(ang), rk * np.sin(ang)))
|
||||
for aa in np.linspace(phi - hA, phi + hA, 12)[1:]:
|
||||
pts.append((ra * np.cos(aa), ra * np.sin(aa)))
|
||||
rk = np.linspace(ra, r0, nf)
|
||||
ang = phi + half_ang(rk)
|
||||
pts += list(zip(rk * np.cos(ang), rk * np.sin(ang)))
|
||||
phin = 2 * np.pi * (i + 1) / z
|
||||
for aa in np.linspace(phi + h0, phin - h0, 12)[1:]:
|
||||
pts.append((rf * np.cos(aa), rf * np.sin(aa)))
|
||||
return np.array(pts)
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图1 渐开线的形成
|
||||
# =====================================================================
|
||||
def fig01():
|
||||
rb = 1.0
|
||||
ts = np.linspace(0, 1.25, 600)
|
||||
x = rb * (np.cos(ts) + ts * np.sin(ts))
|
||||
y = rb * (np.sin(ts) - ts * np.cos(ts))
|
||||
fig, ax = new_ax(7.6, 5.8)
|
||||
ax.plot(*arc(0, 0, rb, 0, 360), color=C_MAIN, lw=1.8)
|
||||
ax.plot(x, y, color=C_BLUE, lw=2.6)
|
||||
ax.plot(0, 0, "ko", ms=5)
|
||||
ax.text(0.03, -0.16, "O", fontsize=13)
|
||||
ax.plot([0, rb], [0, 0], "k--", lw=1.0)
|
||||
ax.text(rb * 0.45, -0.16, r"$r_b$", fontsize=14)
|
||||
ax.plot(rb, 0, "o", color=C_RED, ms=6)
|
||||
ax.text(rb + 0.04, -0.06, "A", color=C_RED, fontsize=13)
|
||||
|
||||
t0 = 0.95
|
||||
Bx, By = rb * np.cos(t0), rb * np.sin(t0)
|
||||
Kx = rb * (np.cos(t0) + t0 * np.sin(t0))
|
||||
Ky = rb * (np.sin(t0) - t0 * np.cos(t0))
|
||||
ax.plot([Bx, Kx], [By, Ky], color=C_GREEN, lw=2.2)
|
||||
ax.plot([0, Bx], [0, By], "k--", lw=0.9)
|
||||
ax.plot([0, Kx], [0, Ky], color=C_MAIN, lw=1.0)
|
||||
ax.plot(Bx, By, "o", color=C_GREEN, ms=6)
|
||||
ax.text(Bx - 0.02, By + 0.09, "B", color=C_GREEN, fontsize=13)
|
||||
ax.plot(Kx, Ky, "o", color=C_RED, ms=6)
|
||||
ax.text(Kx + 0.04, Ky + 0.03, "K", color=C_RED, fontsize=13)
|
||||
ax.text(Kx * 0.5 + 0.05, Ky * 0.5 + 0.06, r"$r_K$", fontsize=13)
|
||||
|
||||
angK = np.degrees(np.arctan2(Ky, Kx))
|
||||
ax.add_patch(Arc((0, 0), 0.66, 0.66, theta1=0, theta2=angK,
|
||||
color=C_PURPLE, lw=1.6))
|
||||
ax.text(0.37, 0.07, r"$\theta_K$", color=C_PURPLE, fontsize=14)
|
||||
n_ang = np.degrees(np.arctan2(By - Ky, Bx - Kx))
|
||||
v_ang = np.degrees(np.arctan2(Kx, -Ky))
|
||||
ax.add_patch(Arc((Kx, Ky), 0.46, 0.46, theta1=min(n_ang, v_ang),
|
||||
theta2=max(n_ang, v_ang), color=C_ORANGE, lw=1.6))
|
||||
ax.text(Kx - 0.16, Ky + 0.10, r"$\alpha_K$", color=C_ORANGE, fontsize=14)
|
||||
|
||||
ax.text(1.22, 1.18, "渐开线", color=C_BLUE, fontsize=13)
|
||||
ax.text(0.60, 0.60, "发生线", color=C_GREEN, fontsize=13, rotation=38)
|
||||
ax.text(-0.98, 0.30, "基圆", color=C_MAIN, fontsize=13)
|
||||
note(ax, -1.15, -0.55,
|
||||
"发生线沿基圆纯滚动时,\n其上一点的轨迹即为该基圆的渐开线\n"
|
||||
r"$\theta_K=\tan\alpha_K-\alpha_K=\mathrm{inv}\,\alpha_K$", fs=10.5)
|
||||
ax.set_xlim(-1.25, 2.25)
|
||||
ax.set_ylim(-1.35, 1.75)
|
||||
save(fig, "fig01_involute_form.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图2 压力角随半径变化
|
||||
# =====================================================================
|
||||
def fig02():
|
||||
rb = 1.0
|
||||
ts = np.linspace(0, 1.0, 500)
|
||||
x = rb * (np.cos(ts) + ts * np.sin(ts))
|
||||
y = rb * (np.sin(ts) - ts * np.cos(ts))
|
||||
fig, ax = new_ax(7.6, 5.6)
|
||||
ax.plot(*arc(0, 0, rb, 0, 360), color=C_MAIN, lw=1.8)
|
||||
ax.plot(x, y, color=C_BLUE, lw=2.6)
|
||||
ax.plot(0, 0, "ko", ms=5)
|
||||
ax.text(0.04, -0.17, "O", fontsize=13)
|
||||
labs = [(0.35, r"$\alpha=19^\circ$", -0.62),
|
||||
(0.60, r"$\alpha=31^\circ$", 0.0),
|
||||
(0.85, r"$\alpha=40^\circ$", 0.62)]
|
||||
for tt, lab, dy in labs:
|
||||
Bx, By = rb * np.cos(tt), rb * np.sin(tt)
|
||||
Kx = rb * (np.cos(tt) + tt * np.sin(tt))
|
||||
Ky = rb * (np.sin(tt) - tt * np.cos(tt))
|
||||
ax.plot([Bx, Kx], [By, Ky], color=C_GRAY, lw=1.0, ls=":")
|
||||
ax.plot([0, Kx], [0, Ky], color=C_GRAY, lw=0.8)
|
||||
ax.plot(Kx, Ky, "o", color=C_RED, ms=5, zorder=5)
|
||||
ax.annotate(lab, xy=(Kx, Ky), xytext=(1.98, 0.05 + dy), fontsize=11.5,
|
||||
color=C_ORANGE, va="center",
|
||||
arrowprops=dict(arrowstyle="-", color=C_ORANGE, lw=0.8, ls=":"))
|
||||
note(ax, -1.28, 1.62, "齿廓上各点压力角不同:\n"
|
||||
"基圆上 $\\alpha_b=0$,越远离基圆压力角越大", fs=10.5)
|
||||
ax.text(-1.05, -0.30, "基圆", color=C_MAIN, fontsize=13)
|
||||
ax.text(-1.05, -0.50, r"$\alpha_b=0$", color=C_MAIN, fontsize=12)
|
||||
ax.set_xlim(-1.35, 2.75)
|
||||
ax.set_ylim(-1.05, 1.95)
|
||||
save(fig, "fig02_pressure_angle.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图3 齿轮各部分名称(四圆三高)
|
||||
# =====================================================================
|
||||
def fig03():
|
||||
z, m = 18, 1.0
|
||||
al = np.radians(20)
|
||||
r = m * z / 2
|
||||
rb = r * np.cos(al)
|
||||
ra = r + m
|
||||
rf = r - 1.25 * m
|
||||
fig, ax = new_ax(8.2, 6.6)
|
||||
ax.add_patch(Polygon(gear_profile(z, m), closed=True, facecolor="#eef3f8",
|
||||
edgecolor=C_MAIN, lw=1.2, zorder=2))
|
||||
ax.plot(*arc(0, 0, ra, 0, 360), color=C_GREEN, lw=1.5, zorder=3)
|
||||
ax.plot(*arc(0, 0, r, 0, 360), color=C_ORANGE, lw=1.7, ls="-.", zorder=3)
|
||||
ax.plot(*arc(0, 0, rb, 0, 360), color=C_BLUE, lw=1.3, zorder=3)
|
||||
ax.plot(*arc(0, 0, rf, 0, 360), color=C_RED, lw=1.3, ls="--", zorder=3)
|
||||
ax.plot(0, 0, "k+", ms=9)
|
||||
# 全齿高 h
|
||||
ang = np.radians(82)
|
||||
ce, se = np.cos(ang), np.sin(ang)
|
||||
ax.annotate("", xy=(ra * ce, ra * se), xytext=(rf * ce, rf * se),
|
||||
arrowprops=dict(arrowstyle="<->", color=C_MAIN, lw=1.2))
|
||||
ax.text(ra * ce + 0.55, (ra + rf) / 2 * se - 0.1, r"$h$", fontsize=14)
|
||||
# 四圆数值
|
||||
tags = [(ra, C_GREEN, r"$d_a=20$", 90),
|
||||
(r, C_ORANGE, r"$d=18$", 145),
|
||||
(rb, C_BLUE, r"$d_b=16.91$", 178),
|
||||
(rf, C_RED, r"$d_f=15.5$", 212)]
|
||||
for rad, col, lab, deg in tags:
|
||||
aa = np.radians(deg)
|
||||
p0 = np.array([rad * np.cos(aa), rad * np.sin(aa)])
|
||||
p1 = np.array([(rad + 2.4) * np.cos(aa), (rad + 2.4) * np.sin(aa)])
|
||||
ax.plot(*p0, "o", color=col, ms=4)
|
||||
ax.plot([p0[0], p1[0]], [p0[1], p1[1]], color=col, lw=0.9, ls=":")
|
||||
if abs(deg - 90) < 1:
|
||||
ax.text(p1[0], p1[1] + 0.35, lab, color=col, fontsize=12, ha="center")
|
||||
elif deg in (178, 212):
|
||||
ax.text(p1[0] - 0.25, p1[1], lab, color=col, fontsize=12, ha="right")
|
||||
else:
|
||||
ax.text(p1[0] + 0.25, p1[1] + 0.2, lab, color=col, fontsize=12, ha="left")
|
||||
note(ax, -ra - 3.2, -ra - 0.3,
|
||||
"四圆:齿顶圆 $d_a$、分度圆 $d$、基圆 $d_b$、齿根圆 $d_f$\n"
|
||||
"三高:齿顶高 $h_a$、齿根高 $h_f$、全齿高 $h=h_a+h_f$\n"
|
||||
"齿距 $p=\\pi m$;齿厚 $s=\\pi m/2$;齿槽宽 $e=\\pi m/2$", fs=11.5)
|
||||
ax.set_xlim(-ra - 3.4, ra + 3.4)
|
||||
ax.set_ylim(-ra - 3.6, ra + 2.2)
|
||||
save(fig, "fig03_gear_parts.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图4 齿廓啮合基本定律
|
||||
# =====================================================================
|
||||
def mesh_geom(z1, z2, m, alpha_deg=20.0, ha_star=1.0, top=False):
|
||||
a = np.radians(alpha_deg)
|
||||
r1, r2 = m * z1 / 2, m * z2 / 2
|
||||
A = r1 + r2
|
||||
rb1, rb2 = r1 * np.cos(a), r2 * np.cos(a)
|
||||
ra1, ra2 = r1 + ha_star * m, r2 + ha_star * m
|
||||
O1 = np.array([0.0, 0.0])
|
||||
O2 = np.array([A, 0.0])
|
||||
P = np.array([r1, 0.0])
|
||||
d = np.array([np.sin(a), np.cos(a)])
|
||||
N1 = P + np.dot(O1 - P, d) * d
|
||||
N2 = P + np.dot(O2 - P, d) * d
|
||||
sN1, sN2 = np.dot(O1 - P, d), np.dot(O2 - P, d)
|
||||
|
||||
def line_circle(c, R):
|
||||
f = P - c
|
||||
B = 2 * np.dot(f, d)
|
||||
C = np.dot(f, f) - R * R
|
||||
disc = B * B - 4 * C
|
||||
if disc < 0:
|
||||
return []
|
||||
return [(-B - np.sqrt(disc)) / 2, (-B + np.sqrt(disc)) / 2]
|
||||
|
||||
def pick(c, R):
|
||||
cand = [s for s in line_circle(c, R) if min(sN1, sN2) - 1e-9 <= s <= max(sN1, sN2) + 1e-9]
|
||||
s = cand[0] if cand else line_circle(c, R)[0]
|
||||
return P + s * d
|
||||
|
||||
B1 = pick(O1, ra1)
|
||||
B2 = pick(O2, ra2)
|
||||
return dict(r1=r1, r2=r2, A=A, rb1=rb1, rb2=rb2, ra1=ra1, ra2=ra2, O1=O1,
|
||||
O2=O2, P=P, d=d, N1=N1, N2=N2, B1=B1, B2=B2)
|
||||
|
||||
|
||||
def fig04():
|
||||
g = mesh_geom(20, 30, 1.0)
|
||||
r1, r2, A, d = g["r1"], g["r2"], g["A"], g["d"]
|
||||
fig, ax = new_ax(8.4, 5.8)
|
||||
ax.plot([-4, A + 4], [0, 0], color=C_MAIN, lw=1.1, ls="--", zorder=1)
|
||||
ax.plot(*arc(0, 0, r1, -150, 150), color=C_ORANGE, lw=1.5, ls="-.", zorder=2)
|
||||
ax.plot(*arc(A, 0, r2, 30, 330), color=C_ORANGE, lw=1.5, ls="-.", zorder=2)
|
||||
ax.plot(*arc(0, 0, g["rb1"], -150, 150), color=C_BLUE, lw=1.2, zorder=2)
|
||||
ax.plot(*arc(A, 0, g["rb2"], 30, 330), color=C_BLUE, lw=1.2, zorder=2)
|
||||
L = np.linspace(-4.0, 6.5, 2)
|
||||
ax.plot(g["N1"][0] + L * d[0], g["N1"][1] + L * d[1], color=C_GREEN, lw=1.9, zorder=3)
|
||||
for O, N, lab in [(g["O1"], g["N1"], "$N_1$"), (g["O2"], g["N2"], "$N_2$")]:
|
||||
ax.plot([O[0], N[0]], [O[1], N[1]], color=C_BLUE, lw=0.9, ls=":", zorder=2)
|
||||
ax.plot(*N, "o", color=C_BLUE, ms=6, zorder=4)
|
||||
ax.text(g["N1"][0] - 0.4, g["N1"][1] - 1.3, "$N_1$", color=C_BLUE, fontsize=14)
|
||||
ax.text(g["N2"][0] + 0.3, g["N2"][1] + 0.3, "$N_2$", color=C_BLUE, fontsize=14)
|
||||
ax.plot(*g["P"], "o", color=C_RED, ms=8, zorder=4)
|
||||
ax.text(g["P"][0] + 0.3, g["P"][1] - 1.4, "P", color=C_RED, fontsize=15)
|
||||
for O, lab in [(g["O1"], "$O_1$"), (g["O2"], "$O_2$")]:
|
||||
ax.plot(*O, "ko", ms=5, zorder=4)
|
||||
ax.text(O[0] - 0.1, O[1] - 1.4, lab, fontsize=14)
|
||||
ax.add_patch(Arc((g["P"][0], g["P"][1]), 3.4, 3.4, theta1=90,
|
||||
theta2=np.degrees(np.arctan2(d[1], d[0])),
|
||||
color=C_PURPLE, lw=1.6))
|
||||
ax.text(g["P"][0] - 0.2, g["P"][1] + 2.6, r"$\alpha'$", color=C_PURPLE, fontsize=15)
|
||||
ax.text(r1 / 2 - 0.2, -2.9, r"$O_1P$", fontsize=13)
|
||||
ax.text(r1 + r2 / 2 - 0.3, -2.9, r"$O_2P$", fontsize=13)
|
||||
ax.text(11.6, 1.6, "啮合线 $N_1N_2$", color=C_GREEN, fontsize=12)
|
||||
ax.text(A / 2 - 3.4, -6.0, "节圆", color=C_ORANGE, fontsize=12)
|
||||
note(ax, -4.2, 12.4,
|
||||
"齿廓啮合基本定律\n"
|
||||
r"$i_{12}=\dfrac{\omega_1}{\omega_2}=\dfrac{O_2P}{O_1P}=$ 常数" "\n"
|
||||
"过接触点的公法线 $N_1N_2$ 必与连心线交于定点 $P$", fs=11)
|
||||
ax.set_xlim(-4.5, A + 4.5)
|
||||
ax.set_ylim(-7.5, 12.8)
|
||||
save(fig, "fig04_pitch_law.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图5 一对轮齿的啮合过程(实际啮合线 B1B2)
|
||||
# =====================================================================
|
||||
def fig05():
|
||||
g = mesh_geom(20, 30, 1.0)
|
||||
A, d = g["A"], g["d"]
|
||||
fig, ax = new_ax(8.6, 7.4)
|
||||
ax.plot([4, A + 4], [0, 0], color=C_MAIN, lw=1.1, ls="--", zorder=1)
|
||||
# 齿轮1 弧
|
||||
ax.plot(*arc(0, 0, g["ra1"], -58, 58), color=C_GREEN, lw=1.3, zorder=2)
|
||||
ax.plot(*arc(0, 0, g["r1"], -58, 58), color=C_ORANGE, lw=1.3, ls="-.", zorder=2)
|
||||
ax.plot(*arc(0, 0, g["rb1"], -58, 58), color=C_BLUE, lw=1.1, zorder=2)
|
||||
# 齿轮2 弧
|
||||
ax.plot(*arc(A, 0, g["ra2"], 122, 238), color=C_GREEN, lw=1.3, zorder=2)
|
||||
ax.plot(*arc(A, 0, g["r2"], 122, 238), color=C_ORANGE, lw=1.3, ls="-.", zorder=2)
|
||||
ax.plot(*arc(A, 0, g["rb2"], 122, 238), color=C_BLUE, lw=1.1, zorder=2)
|
||||
# 理论啮合线
|
||||
L = np.linspace(-4.4, 6.6, 2)
|
||||
ax.plot(g["N1"][0] + L * d[0], g["N1"][1] + L * d[1], color=C_GRAY, lw=1.2,
|
||||
ls=":", zorder=2)
|
||||
# 实际啮合线
|
||||
ax.plot([g["B2"][0], g["B1"][0]], [g["B2"][1], g["B1"][1]], color=C_RED, lw=3.6,
|
||||
zorder=4, solid_capstyle="round")
|
||||
for p, lab, dx, dy in [(g["B1"], "$B_1$", 0.25, 0.35),
|
||||
(g["B2"], "$B_2$", -0.9, -0.2),
|
||||
(g["N1"], "$N_1$", -0.15, -1.0),
|
||||
(g["N2"], "$N_2$", 0.25, 0.25)]:
|
||||
ax.plot(*p, "o", color=C_RED if lab.startswith("$B") else C_BLUE, ms=6, zorder=5)
|
||||
ax.text(p[0] + dx, p[1] + dy, lab,
|
||||
color=C_RED if lab.startswith("$B") else C_BLUE, fontsize=14)
|
||||
ax.plot(*g["P"], "o", color=C_MAIN, ms=6, zorder=5)
|
||||
ax.text(g["P"][0] + 0.25, g["P"][1] - 0.2, "P", fontsize=14)
|
||||
ax.text(g["P"][0] - 0.3, -6.2, "节圆", color=C_ORANGE, fontsize=12)
|
||||
ax.text(12.1, 4.4, "实际啮合线 $B_1B_2$", color=C_RED, fontsize=12.5)
|
||||
ax.text(g["P"][0] - 0.6, -6.3, "节圆", color=C_ORANGE, fontsize=12)
|
||||
note(ax, 5.7, 12.7,
|
||||
"理论啮合线 $N_1N_2$(灰虚线)\n"
|
||||
"实际啮合线 $B_1B_2\\subset N_1N_2$(红粗线)\n"
|
||||
"连续传动条件:$B_1B_2\\geq p_b$", fs=11)
|
||||
ax.set_xlim(5.4, 14.6)
|
||||
ax.set_ylim(-7.4, 13.1)
|
||||
save(fig, "fig05_mesh_line.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图6 重合度与单/双齿啮合区
|
||||
# =====================================================================
|
||||
def fig06():
|
||||
eps = 1.45
|
||||
pb = 1.0
|
||||
L = eps * pb
|
||||
x0 = 0.0
|
||||
xB2, xB1 = x0, x0 + L
|
||||
xB3, xB4 = x0 + (eps - 1) * pb, x0 + pb
|
||||
y = 0.0
|
||||
fig, ax = new_ax(8.6, 3.4)
|
||||
ax.add_patch(plt.Rectangle((xB2, y - 0.16), xB3 - xB2, 0.32,
|
||||
facecolor="#fde3d6", edgecolor="none"))
|
||||
ax.add_patch(plt.Rectangle((xB4, y - 0.16), xB1 - xB4, 0.32,
|
||||
facecolor="#fde3d6", edgecolor="none"))
|
||||
ax.add_patch(plt.Rectangle((xB3, y - 0.16), xB4 - xB3, 0.32,
|
||||
facecolor="#d9ecf7", edgecolor="none"))
|
||||
ax.plot([xB2, xB1], [y, y], color=C_MAIN, lw=2.0)
|
||||
for xp, lab in [(xB2, "$B_2$"), (xB3, "$B_3$"), (xB4, "$B_4$"), (xB1, "$B_1$")]:
|
||||
ax.plot([xp, xp], [-0.5, 0.5], color=C_MAIN, lw=1.4)
|
||||
ax.text(xp, 0.62, lab, ha="center", fontsize=14)
|
||||
for xm, sym in [((xB2 + xB3) / 2, "①"), ((xB3 + xB4) / 2, "②"),
|
||||
((xB4 + xB1) / 2, "③")]:
|
||||
ax.text(xm, -0.40, sym, ha="center", va="top", fontsize=13)
|
||||
ax.annotate("", xy=(xB2 + pb, 1.0), xytext=(xB2, 1.0),
|
||||
arrowprops=dict(arrowstyle="<->", color=C_GREEN, lw=1.3))
|
||||
ax.text(xB2 + pb / 2, 1.08, "$p_b$", ha="center", color=C_GREEN, fontsize=13)
|
||||
ax.annotate("", xy=(xB2, 1.6), xytext=(xB1, 1.6),
|
||||
arrowprops=dict(arrowstyle="<->", color=C_RED, lw=1.5))
|
||||
ax.text((xB2 + xB1) / 2, 1.70,
|
||||
r"$B_1B_2=\varepsilon_\alpha p_b=%.2fp_b$" % eps, ha="center",
|
||||
color=C_RED, fontsize=13)
|
||||
note(ax, xB2 - 0.15, -1.30,
|
||||
r"①③ 双齿区:$L_2=2(\varepsilon_\alpha-1)p_b=%.2fp_b$" % (2 * (eps - 1))
|
||||
+ "\n" + r"② 单齿区:$L_1=(2-\varepsilon_\alpha)p_b=%.2fp_b$" % (2 - eps),
|
||||
fs=11)
|
||||
ax.set_xlim(xB2 - 0.7, xB1 + 0.7)
|
||||
ax.set_ylim(-2.6, 2.2)
|
||||
save(fig, "fig06_contact_ratio.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图7 根切(齿条刀具展成 + 摆线包络)
|
||||
# =====================================================================
|
||||
def fig07():
|
||||
m, z = 1.0, 10
|
||||
ad = np.radians(20)
|
||||
ha, c = 1.0, 0.25
|
||||
r = m * z / 2
|
||||
rb = r * np.cos(ad)
|
||||
ra = r + ha * m
|
||||
rf = r - (ha + c) * m
|
||||
ha_t = (ha + c) * m
|
||||
w_pitch = np.pi * m / 4
|
||||
w_tip = w_pitch - ha_t * np.tan(ad)
|
||||
fig, ax = new_ax(7.8, 6.2)
|
||||
ax.add_patch(Polygon(gear_profile(z, m), closed=True, facecolor="#f7f7f7",
|
||||
edgecolor=C_MAIN, lw=1.3, zorder=2))
|
||||
ax.plot(*arc(0, 0, rb, 0, 360), color=C_BLUE, lw=1.2, zorder=3)
|
||||
ax.plot(*arc(0, 0, r, 0, 360), color=C_ORANGE, lw=1.1, ls="-.", zorder=3)
|
||||
# 滚刀齿条(齿顶朝下):仅画两个刀齿
|
||||
top = r + ha
|
||||
for xoff in (0.0, np.pi):
|
||||
tooth = np.array([(xoff - w_pitch - ha * np.tan(ad), top),
|
||||
(xoff + w_pitch + ha * np.tan(ad), top),
|
||||
(xoff + w_tip, r - ha_t),
|
||||
(xoff - w_tip, r - ha_t)])
|
||||
ax.add_patch(Polygon(tooth, closed=True, facecolor="#eaeaea",
|
||||
edgecolor=C_GRAY, lw=1.2, zorder=5))
|
||||
# 摆线包络(齿顶圆角切出的齿根过渡曲线)
|
||||
phis = np.linspace(-0.62, 0.62, 600)
|
||||
for k in (-1, 0, 1):
|
||||
for sgn in (+1, -1):
|
||||
xi0 = sgn * w_tip + k * np.pi * m
|
||||
Gx = np.cos(phis) * (xi0 - r * phis) + np.sin(phis) * (r - ha_t)
|
||||
Gy = -np.sin(phis) * (xi0 - r * phis) + np.cos(phis) * (r - ha_t)
|
||||
ax.plot(Gx, Gy, color=C_RED, lw=1.3, ls="--", zorder=6)
|
||||
# 啮合线、N1、B2
|
||||
u = np.array([np.cos(ad), -np.sin(ad)])
|
||||
P = np.array([0.0, r])
|
||||
sN1 = np.dot(-P, u)
|
||||
N1 = P + sN1 * u
|
||||
sB2 = (rf - r) / u[1]
|
||||
B2 = P + sB2 * u
|
||||
L = np.linspace(-1.5, 6.0, 2)
|
||||
ax.plot(P[0] + L * u[0], P[1] + L * u[1], color=C_GREEN, lw=1.6, ls=":", zorder=4)
|
||||
ax.plot(*N1, "o", color=C_BLUE, ms=6, zorder=7)
|
||||
ax.text(N1[0] + 0.05, N1[1] + 0.55, "$N_1$", color=C_BLUE, fontsize=13)
|
||||
ax.plot(*B2, "o", color=C_RED, ms=6, zorder=7)
|
||||
ax.text(B2[0] + 0.28, B2[1] + 0.15, "$B_2$", color=C_RED, fontsize=13)
|
||||
ax.plot(*P, "o", color=C_MAIN, ms=6, zorder=7)
|
||||
ax.text(P[0] - 0.7, P[1] - 0.1, "$P$", fontsize=13)
|
||||
ax.plot(0, 0, "k+", ms=8)
|
||||
note(ax, -6.6, 11.7,
|
||||
"红色虚线:齿条刀齿顶圆角切出的齿根过渡曲线\n"
|
||||
r"$z=10<z_{\min}=17$,刀具齿顶越过极限点 $N_1$" "\n"
|
||||
r"($PB_2>PN_1$)→ 齿根被多切去一块 = 根切", fs=10.5)
|
||||
ax.text(4.3, 6.3, "齿条刀具", color=C_GRAY, fontsize=11.5)
|
||||
ax.set_xlim(-6.8, 6.8)
|
||||
ax.set_ylim(-6.6, 12.1)
|
||||
save(fig, "fig07_undercut.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图8 变位齿轮齿形对比(同一齿位叠加)
|
||||
# =====================================================================
|
||||
def fig08():
|
||||
z, m = 18, 1.0
|
||||
al = np.radians(20)
|
||||
r = m * z / 2
|
||||
rb = r * np.cos(al)
|
||||
fig, ax = new_ax(7.8, 5.6)
|
||||
ax.plot(*arc(0, 0, rb, -60, 60), color=C_BLUE, lw=1.3, ls="--", zorder=2)
|
||||
ax.plot(*arc(0, 0, r, -45, 45), color=C_ORANGE, lw=1.5, ls="-.", zorder=2)
|
||||
specs = [(-0.6, C_GREEN, "负变位 $x=-0.6$"), (0.0, C_MAIN, "标准 $x=0$"),
|
||||
(0.6, C_RED, "正变位 $x=+0.6$")]
|
||||
for x, col, lab in specs:
|
||||
p = gear_profile(z, m, x=x, one_tooth=0)
|
||||
ax.plot(p[:, 0], p[:, 1], color=col, lw=1.9, label=lab, zorder=3)
|
||||
ax.plot(0, 0, "k+", ms=9)
|
||||
ax.annotate("", xy=(r * np.cos(np.radians(6)), r * np.sin(np.radians(6))),
|
||||
xytext=(r * np.cos(np.radians(-6)), r * np.sin(np.radians(-6))),
|
||||
arrowprops=dict(arrowstyle="<->", color=C_PURPLE, lw=1.3))
|
||||
ax.text(9.3, -2.7, "分度圆齿厚 $s$", color=C_PURPLE, fontsize=11.5)
|
||||
note(ax, -6.6, 5.2,
|
||||
"同一个基圆 → 同一条渐开线的不同段\n"
|
||||
r"$s=\dfrac{\pi m}{2}+2xm\tan\alpha$" "\n"
|
||||
"正变位:齿厚增宽、齿槽变窄、齿顶高增大\n"
|
||||
"负变位:齿厚变窄、齿槽变宽、齿顶高减小", fs=11)
|
||||
ax.legend(loc="lower left", fontsize=11, framealpha=0.95)
|
||||
ax.set_xlim(-6.8, 11.8)
|
||||
ax.set_ylim(-4.2, 5.6)
|
||||
save(fig, "fig08_modification.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图9 斜齿轮:螺旋角与法面/端面参数
|
||||
# =====================================================================
|
||||
def fig09():
|
||||
fig, axes = plt.subplots(1, 2, figsize=(9.8, 4.6))
|
||||
ax1, ax2 = axes
|
||||
for ax in axes:
|
||||
ax.set_aspect("equal")
|
||||
ax.axis("off")
|
||||
R, H = 1.0, 2.4
|
||||
ax1.plot(R * np.cos(np.linspace(0, 2 * np.pi, 240)),
|
||||
0.22 * np.sin(np.linspace(0, 2 * np.pi, 240)) + H / 2,
|
||||
color=C_MAIN, lw=1.2)
|
||||
ax1.plot(R * np.cos(np.linspace(0, 2 * np.pi, 240)),
|
||||
0.22 * np.sin(np.linspace(0, 2 * np.pi, 240)) - H / 2,
|
||||
color=C_MAIN, lw=1.2)
|
||||
ax1.plot([R, R], [-H / 2, H / 2], color=C_MAIN, lw=1.2)
|
||||
ax1.plot([-R, -R], [-H / 2, H / 2], color=C_MAIN, lw=1.2)
|
||||
tt = np.linspace(-np.pi / 2, 3 * np.pi / 2, 400)
|
||||
hx = R * np.cos(tt)
|
||||
hy = -H / 2 + H * (tt + np.pi / 2) / (2 * np.pi)
|
||||
msk = (hy >= -H / 2 - 1e-9) & (hy <= H / 2 + 1e-9)
|
||||
ax1.plot(hx[msk], hy[msk], color=C_BLUE, lw=2.4)
|
||||
ax1.plot([0, 0], [-H / 2, H / 2], color=C_GRAY, lw=1.0, ls="--")
|
||||
ax1.text(0.12, H / 2 + 0.18, "分度圆柱", fontsize=11)
|
||||
ax1.text(-0.15, -H / 2 - 0.45, "螺旋线", color=C_BLUE, fontsize=11)
|
||||
ax1.set_title("(a) 分度圆柱面上的螺旋线", fontsize=11.5)
|
||||
ax1.set_xlim(-1.8, 1.9)
|
||||
ax1.set_ylim(-H / 2 - 0.8, H / 2 + 0.7)
|
||||
|
||||
beta = np.radians(20)
|
||||
pd = 3.2
|
||||
H2 = pd / np.tan(beta)
|
||||
ax2.plot([0, pd, pd, 0, 0], [0, 0, H2, H2, 0], color=C_MAIN, lw=1.4)
|
||||
ax.plot([0, pd], [0, H2], color=C_BLUE, lw=2.4)
|
||||
ax.text(pd * 0.5, -0.55, r"$\pi d$", color=C_MAIN, fontsize=13, ha="center")
|
||||
ax.text(pd * 0.5, H2 + 0.16, r"$l$", color=C_MAIN, fontsize=13, ha="center")
|
||||
ax2.add_patch(Arc((0, 0), 2.4, 2.4, theta1=0, theta2=np.degrees(beta),
|
||||
color=C_PURPLE, lw=1.6))
|
||||
ax2.text(1.28, 0.52, r"$\beta$", color=C_PURPLE, fontsize=14)
|
||||
Pn = np.array([0.7, 0.7 * np.tan(beta)])
|
||||
ax2.plot([Pn[0], Pn[0] + 0.85 * np.cos(beta + np.pi / 2)],
|
||||
[Pn[1], Pn[1] + 0.85 * np.sin(beta + np.pi / 2)], color=C_RED, lw=3.2)
|
||||
ax2.text(0.28, 1.16, r"$p_n$", color=C_RED, fontsize=13)
|
||||
ax2.plot([Pn[0], Pn[0] + 0.95], [Pn[1], Pn[1]], color=C_GREEN, lw=3.2)
|
||||
ax2.text(Pn[0] + 0.40, Pn[1] - 0.42, r"$p_t$", color=C_GREEN, fontsize=13)
|
||||
ax2.text(1.05, H2 * 0.62,
|
||||
r"$p_n=p_t\cos\beta$" "\n"
|
||||
r"$m_n=m_t\cos\beta$" "\n"
|
||||
r"$\tan\alpha_n=\tan\alpha_t\cos\beta$",
|
||||
fontsize=12.5, va="center")
|
||||
ax2.set_title("(b) 分度圆柱展开图(法面 / 端面参数)", fontsize=11.5)
|
||||
ax2.set_xlim(-0.5, pd + 1.8)
|
||||
ax2.set_ylim(-0.95, H2 + 0.9)
|
||||
fig.tight_layout()
|
||||
save(fig, "fig09_helical.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图10 直齿锥齿轮:分度圆锥 / 背锥 / 当量齿轮
|
||||
# =====================================================================
|
||||
def fig10():
|
||||
fig, axes = plt.subplots(1, 2, figsize=(10.0, 4.8))
|
||||
ax1, ax2 = axes
|
||||
for ax in axes:
|
||||
ax.set_aspect("equal")
|
||||
ax.axis("off")
|
||||
d1, d2 = np.radians(35), np.radians(55)
|
||||
R = 4.0
|
||||
C = R * np.array([np.cos(d1), np.sin(d1)])
|
||||
ax1.plot([0, R + 0.6], [0, 0], color=C_MAIN, lw=1.1, ls="--")
|
||||
ax1.plot([0, 0], [0, R + 0.6], color=C_MAIN, lw=1.1, ls="--")
|
||||
ax1.add_patch(Polygon(np.array([[0, 0], [R * np.cos(d1), R * np.sin(d1)],
|
||||
[R * np.cos(d1), -R * np.sin(d1)]]),
|
||||
closed=True, facecolor="#eaf2fb", edgecolor=C_BLUE, lw=1.5))
|
||||
ax1.add_patch(Polygon(np.array([[0, 0], [R * np.sin(d2), R * np.cos(d2)],
|
||||
[-R * np.sin(d2), R * np.cos(d2)]]),
|
||||
closed=True, facecolor="#fdeee6", edgecolor=C_ORANGE, lw=1.5))
|
||||
ax1.plot([0, C[0]], [0, C[1]], color=C_RED, lw=2.2)
|
||||
ax1.text(2.05, 1.0, r"$R$", color=C_RED, fontsize=13)
|
||||
ax1.add_patch(Arc((0, 0), 2.2, 2.2, theta1=0, theta2=35, color=C_BLUE, lw=1.4))
|
||||
ax1.text(1.30, 0.20, r"$\delta_1$", color=C_BLUE, fontsize=13)
|
||||
ax1.add_patch(Arc((0, 0), 3.2, 3.2, theta1=35, theta2=90, color=C_ORANGE, lw=1.4))
|
||||
ax1.text(0.42, 1.55, r"$\delta_2$", color=C_ORANGE, fontsize=13)
|
||||
ax1.text(4.55, 0.30, r"$\Sigma=\delta_1+\delta_2=90^\circ$", fontsize=12)
|
||||
ax1.text(2.35, -2.35, "分度圆锥", color=C_BLUE, fontsize=11)
|
||||
ax1.set_title("(a) 轴交角 90° 的分度圆锥", fontsize=11.5)
|
||||
ax1.set_xlim(-2.6, 6.9)
|
||||
ax1.set_ylim(-3.2, 5.0)
|
||||
|
||||
# (b) 背锥 → 当量齿轮
|
||||
L = 4.0
|
||||
Cp = L * np.array([np.cos(d1), np.sin(d1)])
|
||||
Ov = np.array([L / np.cos(d1), 0.0])
|
||||
rv = np.linalg.norm(Cp - Ov)
|
||||
ax2.plot([0, L + 1.2], [0, 0], color=C_MAIN, lw=1.1, ls="--")
|
||||
ax2.plot([0, Cp[0]], [0, Cp[1]], color=C_RED, lw=1.8)
|
||||
ax2.text(1.35, 1.15, "分度圆锥", color=C_RED, fontsize=11)
|
||||
ax2.add_patch(Arc((0, 0), 2.4, 2.4, theta1=0, theta2=35, color=C_BLUE, lw=1.3))
|
||||
ax2.text(1.40, 0.22, r"$\delta$", color=C_BLUE, fontsize=13)
|
||||
ax2.plot([Cp[0], Ov[0]], [Cp[1], 0], color=C_PURPLE, lw=2.0)
|
||||
ax2.text(Ov[0] - 0.1, -0.62, "$O_v$", color=C_PURPLE, fontsize=12, ha="right")
|
||||
ax2.text((Cp[0] + Ov[0]) / 2 + 0.1, Cp[1] / 2 + 0.25, "背锥", color=C_PURPLE,
|
||||
fontsize=11, rotation=-33)
|
||||
ax2.add_patch(Arc(Ov, 2 * rv, 2 * rv, theta1=120, theta2=168,
|
||||
color=C_BLUE, lw=1.6, ls="--"))
|
||||
ax2.plot(*Cp, "o", color=C_MAIN, ms=5)
|
||||
ax2.text(Ov[0] - rv - 0.2, rv * 0.72, r"$r_v$", color=C_BLUE, fontsize=13)
|
||||
note(ax2, -0.3, 4.9,
|
||||
"把球面齿形向背锥投影并展直\n→ 当量齿轮(齿形相当)\n"
|
||||
r"$z_v=\dfrac{z}{\cos\delta}$", fs=11)
|
||||
ax2.set_title("(b) 背锥与当量齿轮", fontsize=11.5)
|
||||
ax2.set_xlim(-1.6, 7.2)
|
||||
ax2.set_ylim(-1.6, 5.6)
|
||||
fig.tight_layout()
|
||||
save(fig, "fig10_bevel.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图11 蜗杆机构
|
||||
# =====================================================================
|
||||
def fig11():
|
||||
fig, ax = new_ax(9.4, 5.0)
|
||||
x0, x1, Rw = -3.0, 3.8, 0.75
|
||||
ax.plot([x0, x1], [Rw, Rw], color=C_MAIN, lw=1.2)
|
||||
ax.plot([x0, x1], [-Rw, -Rw], color=C_MAIN, lw=1.2)
|
||||
for xe in [x0, x1]:
|
||||
ell = np.linspace(-np.pi / 2, np.pi / 2, 120)
|
||||
ax.plot(np.full_like(ell, xe), Rw * np.sin(ell), color=C_MAIN, lw=1.1)
|
||||
tt = np.linspace(0, 4 * np.pi, 500)
|
||||
hx = np.linspace(x0, x1, 500)
|
||||
ax.plot(hx, Rw * np.cos(tt), color=C_BLUE, lw=1.9)
|
||||
ax.plot([x0, x1], [0, 0], color=C_GRAY, lw=0.8, ls="--")
|
||||
cx, cy, rw = 1.5, 0.0, 1.95
|
||||
ax.plot(*arc(cx, cy, rw, 0, 360), color=C_ORANGE, lw=1.6, ls="--")
|
||||
for i in range(24):
|
||||
a = 2 * np.pi * i / 24
|
||||
ax.plot([cx + rw * np.cos(a), cx + (rw + 0.22) * np.cos(a)],
|
||||
[cy + rw * np.sin(a), cy + (rw + 0.22) * np.sin(a)],
|
||||
color=C_ORANGE, lw=1.2)
|
||||
ax.plot([cx, cx], [cy - rw - 0.7, cy + rw + 0.7], color=C_MAIN, lw=1.1, ls="--")
|
||||
ax.text(cx + 0.95, cy + rw + 0.35, "蜗轮", color=C_ORANGE, fontsize=12,
|
||||
ha="center")
|
||||
ax.text(x0, Rw + 0.75, "蜗杆", color=C_BLUE, fontsize=12)
|
||||
ax.annotate("", xy=(x1 + 1.0, 0), xytext=(x1 + 0.15, 0),
|
||||
arrowprops=dict(arrowstyle="->", color=C_MAIN, lw=1.4))
|
||||
ax.text(x1 + 0.25, 0.18, r"$\omega_1$", fontsize=12)
|
||||
ax.annotate("", xy=(cx, cy - rw - 1.05), xytext=(cx, cy - rw + 0.05),
|
||||
arrowprops=dict(arrowstyle="->", color=C_MAIN, lw=1.4))
|
||||
ax.text(cx + 0.18, cy - rw - 1.35, r"$\omega_2$", fontsize=12)
|
||||
# 导程角 γ1 小图
|
||||
bx, by, s = -5.2, 0.9, 1.15
|
||||
ax.plot([bx, bx + s], [by, by], color=C_MAIN, lw=1.1)
|
||||
ax.plot([bx, bx + s * np.cos(np.radians(-54))],
|
||||
[by, by + s * np.sin(np.radians(-54))], color=C_PURPLE, lw=1.5)
|
||||
ax.add_patch(Arc((bx, by), 1.3, 1.3, theta1=-54, theta2=0, color=C_PURPLE, lw=1.2))
|
||||
ax.text(bx + 0.80, by - 0.08, r"$\gamma_1$", color=C_PURPLE, fontsize=12)
|
||||
ax.text(bx, by + 0.60, "导程角", color=C_PURPLE, fontsize=10.5)
|
||||
note(ax, -5.4, 4.3,
|
||||
"交错角 $\\Sigma=90^\\circ$;传动比 "
|
||||
r"$i=\dfrac{\omega_1}{\omega_2}=\dfrac{z_2}{z_1}$($z_1$=蜗杆头数)", fs=11)
|
||||
note(ax, -5.4, -3.7,
|
||||
"正确啮合:$m_{x1}=m_{t2}=m$,$\\alpha_{x1}=\\alpha_{t2}=\\alpha$,"
|
||||
r"$\gamma_1=\beta_2$" "\n"
|
||||
"阿基米德蜗杆:轴面内齿形为标准齿条\n(主平面内啮合=齿轮齿条啮合)", fs=10.5)
|
||||
ax.set_xlim(-5.6, 5.4)
|
||||
ax.set_ylim(-7.6, 4.7)
|
||||
save(fig, "fig11_worm.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 图12 轮齿受力分析
|
||||
# =====================================================================
|
||||
def fig12():
|
||||
fig, axes = plt.subplots(1, 2, figsize=(10.2, 4.8))
|
||||
ax1, ax2 = axes
|
||||
for ax in axes:
|
||||
ax.set_aspect("equal")
|
||||
ax.axis("off")
|
||||
# (a) 直齿
|
||||
r = 2.4
|
||||
al = np.radians(20)
|
||||
ax1.plot(*arc(0, 0, r, -55, 55), color=C_ORANGE, lw=1.5, ls="-.")
|
||||
ax1.plot(0, 0, "ko", ms=5)
|
||||
ax1.text(0.08, -0.38, "$O_1$", fontsize=13)
|
||||
ax1.plot([0, r], [0, 0], color=C_MAIN, lw=1.0, ls="--")
|
||||
ax1.text(r / 2 - 0.35, -0.38, r"$d_1/2$", fontsize=12)
|
||||
P = np.array([r, 0])
|
||||
Ftv = 3.0 * np.array([0, 1])
|
||||
Frv = 3.0 * np.tan(al) * np.array([1, 0])
|
||||
Fnvec = Ftv + Frv
|
||||
ax1.annotate("", xy=P + Ftv, xytext=P,
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_BLUE, lw=2.2))
|
||||
ax1.annotate("", xy=P + Frv, xytext=P,
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_GREEN, lw=2.2))
|
||||
ax1.annotate("", xy=P + Fnvec, xytext=P,
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_RED, lw=2.4))
|
||||
ax1.plot([P[0] + Ftv[0], P[0] + Fnvec[0]], [P[1] + Ftv[1], P[1] + Fnvec[1]],
|
||||
color=C_GRAY, lw=0.9, ls=":")
|
||||
ax1.plot([P[0] + Frv[0], P[0] + Fnvec[0]], [P[1] + Frv[1], P[1] + Fnvec[1]],
|
||||
color=C_GRAY, lw=0.9, ls=":")
|
||||
ax1.text(*(P + Ftv + np.array([-0.15, 0.05])), "$F_t$", color=C_BLUE, fontsize=14)
|
||||
ax1.text(*(P + Frv + np.array([0.08, -0.35])), "$F_r$", color=C_GREEN, fontsize=14)
|
||||
ax1.text(*(P + Fnvec + np.array([0.06, 0.08])), "$F_n$", color=C_RED, fontsize=14)
|
||||
ax1.add_patch(Arc(P, 1.5, 1.5, theta1=70, theta2=90, color=C_PURPLE, lw=1.4))
|
||||
ax1.text(P[0] - 0.55, P[1] + 0.78, r"$\alpha$", color=C_PURPLE, fontsize=13)
|
||||
ax1.text(-2.9, 4.0,
|
||||
r"$F_t=\dfrac{2T_1}{d_1}$" "\n" r"$F_r=F_t\tan\alpha$" "\n"
|
||||
r"$F_n=\dfrac{F_t}{\cos\alpha}$", fontsize=12.5, va="top")
|
||||
ax1.set_title("(a) 直齿圆柱齿轮", fontsize=11.5)
|
||||
ax1.set_xlim(-3.2, 4.8)
|
||||
ax1.set_ylim(-1.6, 4.4)
|
||||
# (b) 斜齿
|
||||
bet = np.radians(18)
|
||||
Ft = np.array([3.0, 0.0])
|
||||
Fa = np.array([0.0, -3.0 * np.tan(bet)])
|
||||
Fp = Ft + Fa
|
||||
ax2.annotate("", xy=Ft, xytext=(0, 0),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_BLUE, lw=2.2))
|
||||
ax2.annotate("", xy=Fa, xytext=(0, 0),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_ORANGE, lw=2.2))
|
||||
ax2.annotate("", xy=Fp, xytext=(0, 0),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_RED, lw=2.4))
|
||||
ax2.plot([Ft[0], Fp[0]], [Ft[1], Fp[1]], color=C_GRAY, lw=0.9, ls=":")
|
||||
ax2.plot([Fa[0], Fp[0]], [Fa[1], Fp[1]], color=C_GRAY, lw=0.9, ls=":")
|
||||
ax2.text(Ft[0] + 0.06, Ft[1] - 0.4, "$F_t$", color=C_BLUE, fontsize=14)
|
||||
ax2.text(Fa[0] + 0.12, Fa[1] + 0.05, "$F_a$", color=C_ORANGE, fontsize=14)
|
||||
ax2.text(Fp[0] - 0.05, Fp[1] + 0.12, "$F'$", color=C_RED, fontsize=14)
|
||||
ax2.add_patch(Arc((0, 0), 2.2, 2.2, theta1=-np.degrees(bet), theta2=0,
|
||||
color=C_PURPLE, lw=1.3))
|
||||
ax2.text(1.25, -0.28, r"$\beta$", color=C_PURPLE, fontsize=13)
|
||||
ax2.text(0.05, 2.45,
|
||||
r"$F'=\dfrac{F_t}{\cos\beta}$" "\n" r"$F_a=F_t\tan\beta$" "\n"
|
||||
r"$F_r=F'\tan\alpha_n=\dfrac{F_t\tan\alpha_n}{\cos\beta}$",
|
||||
fontsize=12, va="top")
|
||||
ax2.set_title("(b) 斜齿圆柱齿轮(法向力分解)", fontsize=11.5)
|
||||
ax2.set_xlim(-0.7, 5.2)
|
||||
ax2.set_ylim(-1.5, 2.95)
|
||||
fig.tight_layout()
|
||||
save(fig, "fig12_force.png")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
for f in [fig01, fig02, fig03, fig04, fig05, fig06, fig07, fig08,
|
||||
fig09, fig10, fig11, fig12]:
|
||||
try:
|
||||
f()
|
||||
except Exception as e:
|
||||
import traceback
|
||||
print("FAILED", f.__name__, "->", repr(e))
|
||||
traceback.print_exc()
|
||||
print("done")
|
||||
@@ -0,0 +1,821 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
《知识点-齿轮系(轮系)》配图生成脚本
|
||||
- 全部为**几何/数学作图**(啮合圆几何、转化轮系、差速器运动分解、配齿几何…),非生成式 AI。
|
||||
- 复用 gen_figures.py 的绘图工具(配色 / 留白 / 注释框 / 300 dpi)。
|
||||
运行:python gen_figures_geartrain.py → 同目录输出 figGXX_*.png
|
||||
"""
|
||||
import numpy as np
|
||||
import matplotlib
|
||||
matplotlib.use("Agg")
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib.patches import Circle, Arc, Rectangle, FancyBboxPatch
|
||||
|
||||
from gen_figures import (OUT, DPI, C_MAIN, C_BLUE, C_RED, C_GREEN,
|
||||
C_ORANGE, C_PURPLE, C_GRAY, arc, save, note)
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# 基础工具
|
||||
# =====================================================================
|
||||
def new_ax(w=7.4, h=5.6):
|
||||
fig, ax = plt.subplots(figsize=(w, h))
|
||||
ax.set_aspect("equal")
|
||||
ax.axis("off")
|
||||
return fig, ax
|
||||
|
||||
|
||||
def free_ax(w=9.6, h=5.4, xlim=(0, 10), ylim=(0, 5.6)):
|
||||
fig, ax = plt.subplots(figsize=(w, h))
|
||||
ax.set_xlim(*xlim)
|
||||
ax.set_ylim(*ylim)
|
||||
ax.axis("off")
|
||||
return fig, ax
|
||||
|
||||
|
||||
def grid(nr, nc, w, h):
|
||||
fig, axes = plt.subplots(nr, nc, figsize=(w, h))
|
||||
axes = np.atleast_1d(axes).ravel()
|
||||
for ax in axes:
|
||||
ax.set_aspect("equal")
|
||||
ax.axis("off")
|
||||
return fig, axes
|
||||
|
||||
|
||||
def box(ax, x, y, w, h, s, fc="#eef4fb", ec=C_BLUE, fs=10.5, tc=None, lw=1.2,
|
||||
va="center"):
|
||||
ax.add_patch(FancyBboxPatch((x - w / 2, y - h / 2), w, h,
|
||||
boxstyle="round,pad=0.02,rounding_size=0.06",
|
||||
fc=fc, ec=ec, lw=lw, zorder=3))
|
||||
ax.text(x, y, s, ha="center", va=va, fontsize=fs, zorder=4,
|
||||
color=tc or C_MAIN, linespacing=1.55)
|
||||
|
||||
|
||||
def line(ax, p, q, color=C_GRAY, lw=1.1, ls="-", zorder=1):
|
||||
ax.plot([p[0], q[0]], [p[1], q[1]], color=color, lw=lw, ls=ls, zorder=zorder)
|
||||
|
||||
|
||||
def gear(ax, cx, cy, r, color=C_MAIN, lw=1.7, teeth=0, tin=False, ls="-",
|
||||
fc="none", zorder=3, alpha=1.0, tlen=0.13):
|
||||
"""齿轮简图:节圆 + 可选轮齿短线。tin=True 表示内齿轮(齿朝内)。"""
|
||||
if fc != "none":
|
||||
ax.add_patch(Circle((cx, cy), r, fc=fc, ec="none", alpha=alpha,
|
||||
zorder=zorder - 1))
|
||||
ax.add_patch(Circle((cx, cy), r, fc="none", ec=color, lw=lw, ls=ls,
|
||||
alpha=alpha, zorder=zorder))
|
||||
if teeth:
|
||||
for a in np.linspace(0, 2 * np.pi, teeth, endpoint=False):
|
||||
r0 = r - tlen if tin else r
|
||||
r1 = r if tin else r + tlen
|
||||
ax.plot([cx + r0 * np.cos(a), cx + r1 * np.cos(a)],
|
||||
[cy + r0 * np.sin(a), cy + r1 * np.sin(a)],
|
||||
color=color, lw=0.85, alpha=alpha, zorder=zorder)
|
||||
|
||||
|
||||
def rot_arrow(ax, cx, cy, r, a0, a1, color=C_RED, lw=1.7, zorder=6):
|
||||
"""绕 (cx,cy) 的转向箭头;a1>a0 为逆时针。"""
|
||||
lo, hi = min(a0, a1), max(a0, a1)
|
||||
ax.add_patch(Arc((cx, cy), 2 * r, 2 * r, theta1=lo, theta2=hi,
|
||||
color=color, lw=lw, zorder=zorder))
|
||||
t = np.radians(a1)
|
||||
px, py = cx + r * np.cos(t), cy + r * np.sin(t)
|
||||
d = 1.0 if a1 > a0 else -1.0
|
||||
tx, ty = -np.sin(t) * d, np.cos(t) * d
|
||||
ax.annotate("", xy=(px, py), xytext=(px - 0.40 * tx, py - 0.40 * ty),
|
||||
arrowprops=dict(arrowstyle="-|>", color=color, lw=lw,
|
||||
mutation_scale=15), zorder=zorder + 1)
|
||||
|
||||
|
||||
def shaft(ax, x, y0, y1, color=C_MAIN, lw=2.2, zorder=2):
|
||||
ax.plot([x, x], [y0, y1], color=color, lw=lw, solid_capstyle="round",
|
||||
zorder=zorder)
|
||||
|
||||
|
||||
def dot(ax, x, y, color=C_RED, ms=5.5, zorder=8):
|
||||
ax.plot(x, y, "o", color=color, ms=ms, zorder=zorder)
|
||||
|
||||
|
||||
def lead(ax, p, q, color=C_GRAY, lw=0.9, ls=":"):
|
||||
line(ax, p, q, color=color, lw=lw, ls=ls, zorder=5)
|
||||
|
||||
|
||||
def ground(ax, x, y, w=0.8, color=C_MAIN, lw=1.3, up=True):
|
||||
s = 1 if up else -1
|
||||
edge = y + s * 0.30
|
||||
ax.plot([x - w / 2, x + w / 2], [edge, edge], color=color, lw=lw, zorder=6)
|
||||
for i in range(5):
|
||||
xx = x - w / 2 + w * i / 4.0
|
||||
ax.plot([xx, xx - 0.16], [edge, edge + s * 0.20], color=color, lw=0.95,
|
||||
zorder=6)
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# figG01 轮系分类
|
||||
# =====================================================================
|
||||
def figG01():
|
||||
fig, ax = free_ax(9.8, 5.6, (-1.0, 11.0), (0, 5.6))
|
||||
box(ax, 5.0, 5.05, 4.9, 0.70, "轮 系\n(由一系列齿轮组成的传动系统)",
|
||||
fs=11.5, fc="#eaf1f8", ec=C_BLUE)
|
||||
|
||||
box(ax, 1.65, 3.90, 2.85, 0.66, "定轴轮系\n(各轮轴线固定)",
|
||||
fs=10.5, fc="#eaf7ea", ec=C_GREEN)
|
||||
box(ax, 5.00, 3.90, 2.85, 0.66, "周转轮系\n(轴线有公转)",
|
||||
fs=10.5, fc="#fdf2e5", ec=C_ORANGE)
|
||||
box(ax, 8.35, 3.90, 2.85, 0.66, "复合轮系\n(两者混合)",
|
||||
fs=10.5, fc="#f4ecfa", ec=C_PURPLE)
|
||||
|
||||
box(ax, 0.90, 2.52, 1.90, 0.58, "平面定轴轮系", fs=9.8, fc="white", ec=C_GRAY)
|
||||
box(ax, 2.95, 2.52, 1.90, 0.58, "空间定轴轮系", fs=9.8, fc="white", ec=C_GRAY)
|
||||
box(ax, 4.50, 2.52, 1.75, 0.58, "差动轮系\nF = 2", fs=9.6, fc="white", ec=C_GRAY)
|
||||
box(ax, 6.45, 2.52, 1.85, 0.58, "行星轮系\nF = 1", fs=9.6, fc="white", ec=C_GRAY)
|
||||
|
||||
line(ax, (5, 4.70), (5, 4.58), C_GRAY, 1.2)
|
||||
line(ax, (1.65, 4.58), (8.35, 4.58), C_GRAY, 1.2)
|
||||
for x in (1.65, 5.0, 8.35):
|
||||
line(ax, (x, 4.58), (x, 4.23), C_GRAY, 1.2)
|
||||
line(ax, (1.65, 3.57), (1.65, 3.42), C_GRAY, 1.2)
|
||||
line(ax, (5.00, 3.57), (5.00, 3.42), C_GRAY, 1.2)
|
||||
line(ax, (0.90, 3.42), (2.95, 3.42), C_GRAY, 1.2)
|
||||
line(ax, (4.50, 3.42), (6.45, 3.42), C_GRAY, 1.2)
|
||||
for x in (0.90, 2.95, 4.50, 6.45):
|
||||
line(ax, (x, 3.42), (x, 2.81), C_GRAY, 1.2)
|
||||
|
||||
box(ax, 5.0, 1.28, 9.6, 1.30,
|
||||
"本章两大问题:① 轮系传动比 $i$ 的计算 ② 从动轮转向的判断\n"
|
||||
"重点:定轴轮系、周转轮系、复合轮系传动比的计算方法\n"
|
||||
"行星轮系配齿公式、少齿差行星轮系 —— 一般了解",
|
||||
fs=10.5, fc="#fbfbf6", ec="#d9d2c2")
|
||||
save(fig, "figG01_geartrain_class.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# figG02 定轴轮系传动比(惰轮)
|
||||
# =====================================================================
|
||||
def figG02():
|
||||
fig, ax = new_ax(9.6, 8.0)
|
||||
G = { # r = z/10,几何精确相切
|
||||
"1": (0.0, 10.0, 2.0),
|
||||
"2": (6.0, 10.0, 4.0),
|
||||
"2'": (6.0, 3.5, 2.0),
|
||||
"3": (13.0, 3.5, 5.0),
|
||||
"3'": (13.0, -3.5, 2.0),
|
||||
"4": (19.0, -3.5, 4.0),
|
||||
}
|
||||
for (x, y, r) in G.values():
|
||||
gear(ax, x, y, r, lw=1.8)
|
||||
shaft(ax, 0.0, 5.6, 14.0) # 轴Ⅰ
|
||||
shaft(ax, 6.0, -0.2, 14.6) # 轴Ⅱ
|
||||
shaft(ax, 13.0, -7.2, 9.0) # 轴Ⅲ
|
||||
shaft(ax, 19.0, -8.6, 0.6) # 轴Ⅳ
|
||||
|
||||
for p in [(3.0, 10.0), (9.5, 3.5), (16.0, -3.5)]:
|
||||
ax.plot(p[0], p[1], "o", mfc="white", mec=C_RED, ms=10, mew=1.5, zorder=9)
|
||||
|
||||
# 转向:1顺 → 2逆 → 2′逆 → 3顺 → 3′顺 → 4逆
|
||||
rot_arrow(ax, 0.0, 10.0, 2.55, 110, -40, C_RED)
|
||||
rot_arrow(ax, 6.0, 10.0, 4.55, -40, 110, C_BLUE)
|
||||
rot_arrow(ax, 6.0, 3.5, 2.55, -40, 110, C_BLUE)
|
||||
rot_arrow(ax, 13.0, 3.5, 5.55, 110, -40, C_RED)
|
||||
rot_arrow(ax, 13.0, -3.5, 2.55, 110, -40, C_RED)
|
||||
rot_arrow(ax, 19.0, -3.5, 4.55, -40, 110, C_BLUE)
|
||||
|
||||
ax.text(-3.1, 10.0, "1\n$z_1$=20", ha="right", va="center", fontsize=10.5)
|
||||
ax.text(6.0, 15.35, "2\n$z_2$=40", ha="center", va="bottom", fontsize=10.5)
|
||||
ax.text(3.65, 2.45, "2′\n$z_{2'}$=20", ha="right", va="center", fontsize=10.5)
|
||||
ax.text(13.0, 9.35, "3\n$z_3$=50", ha="center", va="bottom", fontsize=10.5)
|
||||
ax.text(11.55, -5.0, "3′\n$z_{3'}$=20", ha="right", va="center", fontsize=10.5)
|
||||
ax.text(19.0, 1.35, "4\n$z_4$=40", ha="center", va="bottom", fontsize=10.5)
|
||||
|
||||
ax.text(-5.2, 21.0, "定轴轮系传动比", fontsize=14, ha="left", va="center")
|
||||
note(ax, -5.2, 19.7,
|
||||
"$i_{14}=\\dfrac{\\omega_1}{\\omega_4}"
|
||||
"=\\dfrac{z_2\\,z_3\\,z_4}{z_1\\,z_{2'}\\,z_{3'}}"
|
||||
"=(-1)^3\\dfrac{40\\times50\\times40}{20\\times20\\times20}=-10$",
|
||||
fs=12.5)
|
||||
note(ax, -5.2, -10.2,
|
||||
"大小:所有从动轮齿数连乘积 ÷ 所有主动轮齿数连乘积\n"
|
||||
"转向:平面定轴轮系用 $(-1)^m$($m$=外啮合次数,本例 3 次 → 负号)\n"
|
||||
"惰轮(过轮):齿数在分子、分母同时出现,只改变转向、不影响 $i$ 的大小",
|
||||
fs=10.5)
|
||||
ax.set_xlim(-5.6, 26.5)
|
||||
ax.set_ylim(-14.0, 22.2)
|
||||
save(fig, "figG02_fixed_train.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# figG03 定轴轮系转向判定
|
||||
# =====================================================================
|
||||
def figG03():
|
||||
fig, axes = grid(2, 2, 9.8, 8.0)
|
||||
a, b, c, d = axes
|
||||
|
||||
# (a) 平面:外啮合
|
||||
a.set_title("(a) 平面定轴轮系 · 外啮合 → 转向相反($i_{12}$ 取负)",
|
||||
fontsize=10.5)
|
||||
gear(a, -1.0, 0, 1.0)
|
||||
gear(a, 1.0, 0, 1.0)
|
||||
dot(a, 0, 0, C_RED, ms=6)
|
||||
rot_arrow(a, -1.0, 0, 1.55, 110, -40, C_RED)
|
||||
rot_arrow(a, 1.0, 0, 1.55, -40, 110, C_BLUE)
|
||||
a.text(-1.0, 2.05, "1", ha="center", fontsize=11)
|
||||
a.text(1.0, 2.05, "2", ha="center", fontsize=11)
|
||||
a.text(0, -2.25, "两箭头反向:$i_{12}=-z_2/z_1$", ha="center", fontsize=10)
|
||||
a.set_xlim(-3.0, 3.0)
|
||||
a.set_ylim(-2.9, 2.9)
|
||||
|
||||
# (b) 平面:内啮合
|
||||
b.set_title("(b) 平面定轴轮系 · 内啮合 → 转向相同($i_{12}$ 取正)",
|
||||
fontsize=10.5)
|
||||
gear(b, 0, 0, 1.85, lw=2.0, teeth=44, tin=True)
|
||||
gear(b, 0.85, 0, 1.00)
|
||||
dot(b, 1.85, 0, C_RED, ms=6)
|
||||
rot_arrow(b, 0, 0, 2.35, -40, 110, C_RED, lw=1.5)
|
||||
rot_arrow(b, 0.85, 0, 1.45, -40, 110, C_RED, lw=1.5)
|
||||
b.text(-1.85, 1.95, "内齿轮 1", ha="center", fontsize=10)
|
||||
b.text(0.85, -0.06, "2", ha="center", fontsize=11)
|
||||
b.text(0, -2.70, "两箭头同向:$i_{12}=+z_2/z_1$", ha="center", fontsize=10)
|
||||
b.set_xlim(-3.0, 3.0)
|
||||
b.set_ylim(-2.9, 2.9)
|
||||
|
||||
# (c) 空间:锥齿轮
|
||||
c.set_title("(c) 锥齿轮:两箭头同时指向\n(或同时背离)啮合点", fontsize=10.2)
|
||||
c.plot([-2.6, 0], [0, 0], color=C_MAIN, lw=1.4)
|
||||
c.plot([0, 0], [0, -2.6], color=C_MAIN, lw=1.4)
|
||||
c.add_patch(plt.Polygon([(0, 0), (-1.5, 0.62), (-1.5, -0.62)], closed=True,
|
||||
fc="#dbe8f5", ec=C_BLUE, lw=1.5, zorder=3))
|
||||
c.add_patch(plt.Polygon([(0, 0), (-0.62, -1.5), (0.62, -1.5)], closed=True,
|
||||
fc="#fdeada", ec=C_ORANGE, lw=1.5, zorder=3))
|
||||
dot(c, 0, 0, C_RED, ms=6)
|
||||
c.annotate("", xy=(-0.18, 0.12), xytext=(-1.35, 0.12),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_BLUE, lw=1.8))
|
||||
c.annotate("", xy=(0.12, -0.18), xytext=(0.12, -1.35),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_ORANGE, lw=1.8))
|
||||
c.text(-1.95, 1.00, "齿轮1", color=C_BLUE, fontsize=10, ha="center")
|
||||
c.text(1.35, -1.55, "齿轮2", color=C_ORANGE, fontsize=10, ha="center")
|
||||
c.text(0.15, 0.32, "啮合点", fontsize=9.5, color=C_RED)
|
||||
c.set_xlim(-3.0, 3.2)
|
||||
c.set_ylim(-3.0, 2.9)
|
||||
|
||||
# (d) 空间:蜗杆蜗轮
|
||||
d.set_title("(d) 蜗杆蜗轮:左旋左手、右旋右手", fontsize=10.2)
|
||||
d.add_patch(Rectangle((-2.2, -0.42), 3.6, 0.84, fc="#dbe8f5",
|
||||
ec=C_BLUE, lw=1.5, zorder=3))
|
||||
for x in np.linspace(-2.05, 1.25, 9):
|
||||
d.plot([x, x + 0.32], [-0.42, 0.42], color=C_BLUE, lw=1.0, zorder=4)
|
||||
d.plot([-2.6, 1.9], [0, 0], color=C_MAIN, lw=1.2, ls="-.", zorder=2)
|
||||
gear(d, 0.0, -1.75, 1.35, lw=1.8, teeth=30)
|
||||
d.plot([0.0, 0.0], [-1.75, -0.40], color=C_MAIN, lw=1.2, ls="-.", zorder=2)
|
||||
dot(d, 0.0, -0.42, C_RED, ms=6)
|
||||
d.annotate("", xy=(0.9, 0.95), xytext=(-2.1, 0.95),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_BLUE, lw=1.8))
|
||||
rot_arrow(d, 0.0, -1.75, 1.80, 110, -40, C_ORANGE)
|
||||
d.text(-2.3, 1.30, "蜗杆(右旋)", color=C_BLUE, fontsize=10, ha="left")
|
||||
d.text(1.95, -2.55, "蜗轮", color=C_ORANGE, fontsize=10, ha="left")
|
||||
d.text(0.0, -3.55,
|
||||
"四指弯曲方向=蜗杆转向,拇指反向=蜗轮节点线速度方向",
|
||||
fontsize=9.5, ha="center")
|
||||
d.set_xlim(-3.0, 3.6)
|
||||
d.set_ylim(-4.0, 2.9)
|
||||
|
||||
fig.tight_layout()
|
||||
save(fig, "figG03_direction.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# figG04 2K-H 周转轮系的组成
|
||||
# =====================================================================
|
||||
def figG04():
|
||||
fig, ax = new_ax(8.6, 7.2)
|
||||
r1, r2, r3 = 1.2, 0.9, 3.0
|
||||
dO = r1 + r2
|
||||
assert abs((r3 - r2) - dO) < 1e-9
|
||||
gear(ax, 0, 0, r3, lw=1.9, teeth=54, tin=True)
|
||||
gear(ax, 0, 0, r1, lw=1.9, teeth=28)
|
||||
for a in (90, 210, 330):
|
||||
t = np.radians(a)
|
||||
px, py = dO * np.cos(t), dO * np.sin(t)
|
||||
gear(ax, px, py, r2, lw=1.7, teeth=22)
|
||||
line(ax, (0, 0), (px, py), color=C_ORANGE, lw=2.0, zorder=2)
|
||||
gear(ax, 0, 0, 0.34, fc=C_ORANGE, lw=1.4, zorder=5)
|
||||
ax.plot(0, 0, "k+", ms=8)
|
||||
|
||||
lead(ax, (0.80, 0.80), (4.05, 2.55))
|
||||
ax.text(4.20, 2.55, "1 太阳轮(中心轮)", fontsize=10.5, va="center")
|
||||
lead(ax, (-dO * 0.866, -dO * 0.5), (-5.10, -3.60))
|
||||
ax.text(-5.25, -3.60, "2 行星轮", fontsize=10.5, ha="left", va="center")
|
||||
lead(ax, (-2.12, 2.12), (-6.20, 3.55))
|
||||
ax.text(-6.35, 3.55, "3 内齿圈(中心轮,固定)", fontsize=10.5,
|
||||
ha="left", va="center")
|
||||
lead(ax, (dO * 0.55, -dO * 0.05), (2.75, -2.15))
|
||||
ax.text(2.90, -2.15, "H 系杆(行星架)", fontsize=10.5, ha="left",
|
||||
va="center", color=C_ORANGE)
|
||||
rot_arrow(ax, 0, 0, r1 + 0.45, 110, -40, C_RED)
|
||||
rot_arrow(ax, 0, 0, r3 + 0.45, -40, 110, C_BLUE, lw=1.4)
|
||||
|
||||
note(ax, -7.6, -4.60,
|
||||
"基本构件:太阳轮(中心轮)、系杆(行星架);行星轮既自转又绕中心轮公转\n"
|
||||
"一个基本周转轮系中:至少 1 个行星轮,最多 2 个中心轮,"
|
||||
"且两中心轮与系杆的轴线必须重合\n"
|
||||
"差动轮系 $F=2$(两中心轮都不固定);行星轮系 $F=1$(一个中心轮固定)",
|
||||
fs=10.5)
|
||||
ax.set_xlim(-7.9, 7.9)
|
||||
ax.set_ylim(-7.4, 5.2)
|
||||
save(fig, "figG04_epicyclic.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# figG05 反转原理(转化轮系)
|
||||
# =====================================================================
|
||||
def figG05():
|
||||
fig, axes = grid(1, 2, 10.6, 5.4)
|
||||
r1, r2, r3 = 2.0, 1.5, 5.0
|
||||
dO = r1 + r2
|
||||
|
||||
titles = (r"原周转轮系:$\omega_1,\ \omega_3,\ \omega_H$ 均不为 0",
|
||||
r"施加 $-\omega_H$ 后:系杆成机架 → 转化轮系(定轴轮系)")
|
||||
for ax, ttl, inv in zip(axes, titles, (False, True)):
|
||||
ax.set_title(ttl, fontsize=11)
|
||||
gear(ax, 0, 0, r3, lw=1.8, teeth=48, tin=True)
|
||||
gear(ax, 0, 0, r1, lw=1.8, teeth=26)
|
||||
gear(ax, dO, 0, r2, lw=1.6, teeth=18)
|
||||
line(ax, (0, 0), (dO, 0), color=C_ORANGE, lw=2.0, zorder=2)
|
||||
gear(ax, 0, 0, 0.4, fc=C_MAIN if inv else C_ORANGE, lw=1.4, zorder=5)
|
||||
ax.plot(0, 0, "k+", ms=7)
|
||||
rot_arrow(ax, 0, 0, r1 + 0.45, 110, -40, C_RED)
|
||||
rot_arrow(ax, 0, 0, r3 + 0.40, -40, 110, C_BLUE, lw=1.3)
|
||||
rot_arrow(ax, 0, 0, dO - 0.32, -40, 110, C_ORANGE, lw=1.5)
|
||||
ax.text(-r3 - 0.05, r3 + 0.55, "3", fontsize=11, ha="center")
|
||||
ax.text(-0.16, r1 - 0.30, "1", fontsize=11, ha="right")
|
||||
ax.text(dO + 0.25, r2 + 0.55, "2", fontsize=11, ha="left")
|
||||
ax.text(0.55, 0.95, "H", fontsize=12, color=C_ORANGE)
|
||||
ax.set_xlim(-r3 - 1.9, r3 + 2.1)
|
||||
ax.set_ylim(-r3 - 2.5, r3 + 2.1)
|
||||
if inv:
|
||||
ax.text(0.65, -0.85, "H 为机架", fontsize=10.6, color=C_MAIN,
|
||||
zorder=9,
|
||||
bbox=dict(boxstyle="round,pad=0.30", fc="white",
|
||||
ec=C_MAIN, lw=1.0, alpha=0.97))
|
||||
ax.text(0, -r3 - 1.55,
|
||||
r"$\omega_H^{H}=\omega_H-\omega_H=0$", ha="center",
|
||||
fontsize=10.5, color=C_ORANGE)
|
||||
ax.text(0, -r3 - 2.15,
|
||||
"各构件角速度:$\\omega_i^{H}=\\omega_i-\\omega_H$",
|
||||
ha="center", fontsize=10)
|
||||
else:
|
||||
ax.text(0, -r3 - 1.55,
|
||||
r"$\omega_1,\ \omega_3,\ \omega_2$(2 既有自转又有公转)",
|
||||
ha="center", fontsize=10)
|
||||
ax.text(0, -r3 - 2.15, "不能直接求传动比", ha="center",
|
||||
fontsize=10, color="#555555")
|
||||
|
||||
fig.tight_layout(rect=(0, 0.20, 1, 1))
|
||||
fig.text(0.5, 0.03,
|
||||
"反转原理:给整个周转轮系施加公共角速度 $-\\omega_H$,"
|
||||
"各构件之间的相对运动不变,但系杆变为“静止”,\n"
|
||||
"原周转轮系 → 转化轮系(定轴轮系),可直接套用定轴轮系的公式。",
|
||||
ha="center", va="bottom", fontsize=10.8, linespacing=1.7,
|
||||
bbox=dict(boxstyle="round,pad=0.5", fc="#fbfbf6", ec="#d9d2c2"))
|
||||
save(fig, "figG05_inversion.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# figG06 周转轮系传动比通用公式 + 注意事项
|
||||
# =====================================================================
|
||||
def figG06():
|
||||
fig, ax = free_ax(9.8, 5.4, (0, 10), (0, 5.4))
|
||||
box(ax, 5.0, 4.82, 9.3, 0.80,
|
||||
"$i_{GK}^{H}=\\dfrac{\\omega_G-\\omega_H}{\\omega_K-\\omega_H}"
|
||||
"=\\pm\\dfrac{z_{\\mathrm{driven}}}{z_{\\mathrm{driver}}}$",
|
||||
fs=15, fc="#eaf1f8", ec=C_BLUE)
|
||||
box(ax, 5.0, 3.92, 9.3, 0.76,
|
||||
"分子 = 转化轮系中 G→K 间所有从动轮齿数的连乘积;分母 = 所有主动轮齿数的连乘积\n"
|
||||
"G=主动轮(通常为中心轮),K=从动轮,H=系杆;"
|
||||
"$\\omega_G,\\omega_K,\\omega_H$ 为各构件的绝对角速度",
|
||||
fs=10.3, fc="white", ec=C_GRAY)
|
||||
|
||||
items = [
|
||||
"① 符号必须带正负号:转向相同取同号,转向相反取异号 —— "
|
||||
"$\\omega$ 与 $n$ 可互换,但 $n$ 同样要带符号。",
|
||||
"② 齿数比前的 $\\pm$ 由转化轮系中 $G\\to K$ 的外啮合次数 $m$ 决定,"
|
||||
"取 $(-1)^m$;它只表示转化轮系中的转向,不代表两轮的实际转向。",
|
||||
"③ 公式要求 $G$、$K$ 与系杆 $H$ 的轴线互相平行;空间(锥齿轮)周转轮系"
|
||||
"也可用它求两中心轮与系杆之间的转速关系。",
|
||||
"④ 若为行星轮系,$\\omega_G$、$\\omega_K$ 中必有一个为 0"
|
||||
"(设 $\\omega_K=0$,则 $i_{GK}^{H}=\\dfrac{\\omega_G-\\omega_H}{-\\omega_H}$)。",
|
||||
"⑤ 两齿轮轴线不平行时 $\\omega_2^{H}\\neq\\omega_2-\\omega_H$,"
|
||||
"不能直接对行星轮本身套用此式,否则会得出错误结论。",
|
||||
]
|
||||
y = 3.03
|
||||
for txt in items:
|
||||
ax.text(0.20, y, txt, fontsize=10.3, ha="left", va="top", linespacing=1.6)
|
||||
y -= 0.60
|
||||
save(fig, "figG06_formula.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# figG07 复合轮系:划分基本轮系
|
||||
# =====================================================================
|
||||
def figG07():
|
||||
fig, axes = grid(1, 2, 10.6, 5.6)
|
||||
a, b = axes
|
||||
|
||||
# (a) 周转轮系 1-2-3-H
|
||||
r1, r2, r3 = 1.2, 1.8, 4.8
|
||||
dO = r1 + r2
|
||||
assert abs((r3 - r2) - dO) < 1e-9
|
||||
a.set_title("(a) 周转轮系 1–2–3–H(内齿圈 3 固定)", fontsize=10.8)
|
||||
gear(a, 0, 0, r3, lw=1.8, teeth=60, tin=True)
|
||||
gear(a, 0, 0, r1, lw=1.8, teeth=24)
|
||||
gear(a, 0, dO, r2, lw=1.6, teeth=28)
|
||||
line(a, (0, 0), (0, dO), color=C_ORANGE, lw=2.0, zorder=2)
|
||||
gear(a, 0, 0, 0.32, fc=C_ORANGE, lw=1.3, zorder=5)
|
||||
ground(a, 0, -r3 - 0.05, w=1.2, up=False)
|
||||
rot_arrow(a, 0, 0, r1 + 0.42, 110, -40, C_RED)
|
||||
rot_arrow(a, 0, 0, dO - 0.30, -40, 110, C_ORANGE, lw=1.6)
|
||||
a.text(0.18, r1 - 0.35, "1", fontsize=11)
|
||||
a.text(0.30, dO - 0.35, "2", fontsize=11)
|
||||
a.text(-r3 - 0.15, r3 - 0.55, "3", fontsize=11, ha="right")
|
||||
a.text(0.42, 1.30, "H", fontsize=12, color=C_ORANGE)
|
||||
a.text(0, -r3 - 1.15, "输出 $\\omega_H$", ha="center", fontsize=10.5,
|
||||
color=C_ORANGE)
|
||||
a.text(0, -r3 - 1.95, "$z_1$=20,$z_2$=40,$z_3$=100", ha="center",
|
||||
fontsize=10.2)
|
||||
a.set_xlim(-r3 - 1.8, r3 + 1.8)
|
||||
a.set_ylim(-r3 - 2.9, r3 + 1.5)
|
||||
|
||||
# (b) 定轴轮系 0-1
|
||||
b.set_title("(b) 定轴轮系 0–1(与左图共用齿轮 1)", fontsize=10.8)
|
||||
g0r, g1r = 1.5, 1.0
|
||||
gear(b, -g1r, 0, g0r, lw=1.8, teeth=30)
|
||||
gear(b, g0r, 0, g1r, lw=1.8, teeth=20)
|
||||
shaft(b, -g1r, -g0r - 1.0, g0r + 1.0, lw=2.0)
|
||||
shaft(b, g0r, -g1r - 1.0, g1r + 1.0, lw=2.0)
|
||||
dot(b, 0.0, 0.0, C_RED, ms=6)
|
||||
rot_arrow(b, -g1r, 0, g0r + 0.5, 110, -40, C_BLUE)
|
||||
rot_arrow(b, g0r, 0, g1r + 0.5, -40, 110, C_RED, lw=1.5)
|
||||
b.text(-g1r, g0r + 1.35, "0\n$z_0$=30", ha="center", va="bottom", fontsize=10.5)
|
||||
b.text(g0r, g1r + 1.35, "1\n$z_1$=20", ha="center", va="bottom", fontsize=10.5)
|
||||
b.annotate("", xy=(-3.55, 0.0), xytext=(-2.30, 0.0),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_BLUE, lw=1.8))
|
||||
b.text(-3.70, 0.0, "输入\n$\\omega_0$", ha="right", va="center",
|
||||
fontsize=10.5, color=C_BLUE)
|
||||
b.text(0, -g0r - 1.75,
|
||||
"$i_{01}=\\dfrac{\\omega_0}{\\omega_1}=-\\dfrac{z_1}{z_0}"
|
||||
"=-\\dfrac{20}{30}=-\\dfrac{2}{3}$",
|
||||
ha="center", fontsize=11)
|
||||
b.set_xlim(-5.6, 4.4)
|
||||
b.set_ylim(-g0r - 2.7, g0r + 2.2)
|
||||
|
||||
fig.tight_layout(rect=(0, 0.24, 1, 1))
|
||||
fig.text(0.5, 0.185,
|
||||
"① 划分基本轮系:先找轴线不固定的行星轮 → 再找支承它的系杆 → "
|
||||
"再找与行星轮啮合的太阳轮,剩下的就是定轴轮系",
|
||||
ha="center", va="top", fontsize=10.5)
|
||||
fig.text(0.5, 0.03,
|
||||
"② 分别列式 ③ 用公共构件的转速联立:\n"
|
||||
"$i_{1H}=1+\\dfrac{z_3}{z_1}=1+\\dfrac{100}{20}=6$"
|
||||
" → $i_{0H}=i_{01}\\cdot i_{1H}"
|
||||
"=\\left(-\\dfrac{2}{3}\\right)\\times6=-4$",
|
||||
ha="center", va="bottom", fontsize=11, linespacing=1.9,
|
||||
bbox=dict(boxstyle="round,pad=0.5", fc="#fbfbf6", ec="#d9d2c2"))
|
||||
save(fig, "figG07_composite.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# figG08 轮系的功用
|
||||
# =====================================================================
|
||||
def _ic_gears(ax, x, y, s=0.34):
|
||||
ax.add_patch(Circle((x - s * 0.9, y), s * 0.80, fc="#eaf1f8", ec=C_BLUE,
|
||||
lw=1.5, zorder=3))
|
||||
ax.add_patch(Circle((x + s * 1.0, y), s * 1.35, fc="#fdf2e5", ec=C_ORANGE,
|
||||
lw=1.5, zorder=3))
|
||||
|
||||
|
||||
def _ic_split(ax, x, y, s=0.46, n=3):
|
||||
ax.annotate("", xy=(x + s * 0.4, y), xytext=(x - s * 1.1, y),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_MAIN, lw=1.3))
|
||||
for dy in np.linspace(s * 0.9, -s * 0.9, n):
|
||||
ax.annotate("", xy=(x + s * 1.5, y + dy), xytext=(x + s * 0.45, y),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_BLUE, lw=1.1))
|
||||
|
||||
|
||||
def _ic_reverse(ax, x, y, s=0.46):
|
||||
ax.annotate("", xy=(x + s * 1.3, y + s * 0.45),
|
||||
xytext=(x - s * 0.2, y + s * 0.45),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_BLUE, lw=1.5))
|
||||
ax.annotate("", xy=(x - s * 0.2, y - s * 0.45),
|
||||
xytext=(x + s * 1.3, y - s * 0.45),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_ORANGE, lw=1.5))
|
||||
|
||||
|
||||
def _ic_shift(ax, x, y, s=0.42):
|
||||
ax.add_patch(Circle((x - s * 0.9, y - 0.10), s * 0.62, fc="#eaf1f8",
|
||||
ec=C_BLUE, lw=1.5, zorder=3))
|
||||
ax.add_patch(Circle((x + s * 0.85, y + 0.18), s * 0.95, fc="#fdf2e5",
|
||||
ec=C_ORANGE, lw=1.5, zorder=3))
|
||||
ax.annotate("", xy=(x + s * 0.85, y - s * 1.30),
|
||||
xytext=(x - s * 0.9, y - s * 1.30),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_PURPLE, lw=1.2))
|
||||
|
||||
|
||||
def _ic_merge(ax, x, y, s=0.46):
|
||||
for dy in (s * 0.85, -s * 0.85):
|
||||
ax.annotate("", xy=(x + s * 0.6, y), xytext=(x - s * 1.1, y + dy),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_BLUE, lw=1.1))
|
||||
ax.annotate("", xy=(x + s * 1.7, y), xytext=(x + s * 0.65, y),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_RED, lw=1.6))
|
||||
|
||||
|
||||
def _ic_power(ax, x, y, s=0.42):
|
||||
ax.add_patch(Rectangle((x - s * 1.25, y - s * 0.85), s * 2.5, s * 1.7,
|
||||
fc="#f4ecfa", ec=C_PURPLE, lw=1.4, zorder=3))
|
||||
ax.text(x, y, "kW", fontsize=8.0, ha="center", va="center", color=C_PURPLE,
|
||||
zorder=4)
|
||||
|
||||
|
||||
def figG08():
|
||||
fig, ax = free_ax(10.2, 6.8, (0, 12), (-0.55, 7.5))
|
||||
cards = [
|
||||
("①", "获得很大的传动比,结构紧凑",
|
||||
"一对齿轮 $i<5\\sim7$;轮系 $i$ 可达 10000", _ic_gears),
|
||||
("②", "实现分路传动", "钟表的时、分、秒针等(1 路输入 → 多路输出)", _ic_split),
|
||||
("③", "实现换向传动", "改变从动轴的转向", _ic_reverse),
|
||||
("④", "实现变速传动", "移动双联齿轮,改变输出轴转速", _ic_shift),
|
||||
("⑤", "运动的合成(加减法运算)",
|
||||
"差动轮系 $n_H=(n_1+n_3)/2$($z_1=z_2=z_3$)", _ic_merge),
|
||||
("⑥", "运动的分解", "汽车差速器自动分配两后轮转速", _ic_split),
|
||||
("⑦", "尺寸、重量较小时实现大功率传动",
|
||||
"航空发动机主减 $\\phi$430 mm,2850 kW", _ic_power),
|
||||
]
|
||||
W, H = 5.85, 1.60
|
||||
xs = [3.05, 8.95]
|
||||
ys = [6.10, 4.34, 2.58, 0.82]
|
||||
for i, (tag, title, desc, icon) in enumerate(cards):
|
||||
cx, cy = xs[i % 2], ys[i // 2]
|
||||
ax.add_patch(FancyBboxPatch((cx - W / 2, cy - H / 2), W, H,
|
||||
boxstyle="round,pad=0.02,rounding_size=0.12",
|
||||
fc="#fbfbf8", ec="#cfd6dd", lw=1.1, zorder=2))
|
||||
ax.add_patch(Circle((cx - W / 2 + 0.42, cy + 0.42), 0.25,
|
||||
fc="#eaf1f8", ec=C_BLUE, lw=1.0, zorder=3))
|
||||
ax.text(cx - W / 2 + 0.42, cy + 0.42, tag, fontsize=10, ha="center",
|
||||
va="center", zorder=4, color=C_BLUE)
|
||||
icon(ax, cx - W / 2 + 1.32, cy - 0.02)
|
||||
ax.text(cx - W / 2 + 2.22, cy + 0.38, title, fontsize=10.4, ha="left",
|
||||
va="center", zorder=4)
|
||||
ax.text(cx - W / 2 + 2.22, cy - 0.40, desc, fontsize=9.2, ha="left",
|
||||
va="center", color="#555555", zorder=4)
|
||||
ax.text(6.0, 7.24, "轮系的功用(共七个方面)", fontsize=13.5, ha="center",
|
||||
va="center")
|
||||
ax.text(6.0, -0.32, "轮系的用途:减速器、增速器、变速器、换向机构",
|
||||
fontsize=10.2, ha="center", va="center", color="#555555")
|
||||
save(fig, "figG08_functions.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# figG09 汽车差速器(运动分解)
|
||||
# =====================================================================
|
||||
def figG09():
|
||||
fig, ax = new_ax(9.4, 6.6)
|
||||
L = 3.0
|
||||
P = (0.0, -7.0)
|
||||
xl, xr = -L, L
|
||||
|
||||
for xx, col in ((xl, C_BLUE), (xr, C_ORANGE)):
|
||||
line(ax, P, (xx, 0), color=col, lw=1.0, ls=":", zorder=1)
|
||||
ax.add_patch(Arc(P, 2 * 2.2, 2 * 2.2, theta1=72, theta2=108,
|
||||
color=C_MAIN, lw=1.3, zorder=2))
|
||||
ax.text(0.55, -4.55, "$\\omega$", fontsize=13)
|
||||
dot(ax, *P, C_MAIN, ms=6)
|
||||
ax.text(0.45, -6.80, "$P$(转弯中心)", fontsize=10.5)
|
||||
|
||||
for xx, col in ((xl, C_BLUE), (xr, C_ORANGE)):
|
||||
ax.add_patch(Rectangle((xx - 0.22, -0.95), 0.44, 1.90, fc="#e6e6e6",
|
||||
ec=C_MAIN, lw=1.6, zorder=4))
|
||||
ax.text(xl, 1.25, "轮1", color=C_BLUE, fontsize=11, ha="center")
|
||||
ax.text(xr, 1.25, "轮3", color=C_ORANGE, fontsize=11, ha="center")
|
||||
line(ax, (xl, 0), (xr, 0), C_MAIN, 2.0)
|
||||
ax.add_patch(Rectangle((-0.95, -0.75), 1.90, 1.50, fc="#fdf2e5",
|
||||
ec=C_ORANGE, lw=1.6, zorder=3))
|
||||
ax.text(0, 0, "差速器", fontsize=9.5, ha="center", va="center", zorder=5,
|
||||
color=C_ORANGE)
|
||||
ax.text(0, 1.95, "$H$(行星架,由发动机驱动)", fontsize=10.2, ha="center",
|
||||
color=C_ORANGE)
|
||||
|
||||
ax.annotate("", xy=(xl, -1.95), xytext=(xl, -0.95),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_BLUE, lw=2.0))
|
||||
ax.text(xl, -2.35, "$v_1=(r-L)\\,\\omega$", color=C_BLUE, fontsize=11,
|
||||
ha="center")
|
||||
ax.annotate("", xy=(xr, -1.95), xytext=(xr, -0.95),
|
||||
arrowprops=dict(arrowstyle="-|>", color=C_ORANGE, lw=2.6))
|
||||
ax.text(xr, -2.35, "$v_3=(r+L)\\,\\omega$", color=C_ORANGE, fontsize=11,
|
||||
ha="center")
|
||||
|
||||
ax.set_xlim(-4.3, 4.3)
|
||||
ax.set_ylim(-8.5, 3.0)
|
||||
fig.tight_layout(rect=(0, 0.30, 1, 1))
|
||||
fig.text(0.5, 0.155,
|
||||
"$z_1=z_3$(两半轴齿轮相同),$n_H=n_4$(行星架与壳体同速);"
|
||||
"$n_H=\\dfrac{n_1+n_3}{2}$ → 行星架转速是两轮的“中间值”\n"
|
||||
"该式只有 2 个方程、3 个未知数:直线行驶时还需 $n_1=n_3$ 才能求解",
|
||||
ha="center", va="bottom", fontsize=10.3, linespacing=1.8,
|
||||
bbox=dict(boxstyle="round,pad=0.5", fc="#fbfbf6", ec="#d9d2c2"))
|
||||
fig.text(0.5, 0.02,
|
||||
"转弯时车体绕 $P$ 点转动:$n_1/n_3=v_1/v_3=(r-L)/(r+L)$;"
|
||||
"轮系按转弯半径自动把 $n_H$ 分解为 $n_1$、$n_3$\n"
|
||||
"(内侧轮慢、外侧轮快),使车轮始终作纯滚动",
|
||||
ha="center", va="bottom", fontsize=10.3, linespacing=1.8,
|
||||
bbox=dict(boxstyle="round,pad=0.5", fc="#fbfbf6", ec="#d9d2c2"))
|
||||
save(fig, "figG09_differential.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# figG10 行星轮系配齿四条件
|
||||
# =====================================================================
|
||||
def figG10():
|
||||
fig, axes = grid(2, 2, 10.0, 7.8)
|
||||
a, b, c, d = axes
|
||||
r1, r2, r3 = 1.1, 0.85, 2.8
|
||||
dO = r1 + r2
|
||||
|
||||
a.set_title("(a) 同心条件:$r_3=r_1+2r_2$ ($z_3=z_1+2z_2$)", fontsize=10.8)
|
||||
gear(a, 0, 0, r3, lw=1.7, teeth=48, tin=True)
|
||||
gear(a, 0, 0, r1, lw=1.7, teeth=24)
|
||||
gear(a, dO, 0, r2, lw=1.6, teeth=18)
|
||||
line(a, (0, 0), (0, -r3 - 0.55), C_GRAY, 1.0)
|
||||
line(a, (0, 0), (dO, 0), C_GRAY, 0.9)
|
||||
a.annotate("", xy=(0, 0.28), xytext=(0, 1.38),
|
||||
arrowprops=dict(arrowstyle="<->", color=C_BLUE, lw=1.3))
|
||||
a.text(0.16, 0.83, "$r_1$", color=C_BLUE, fontsize=11)
|
||||
a.annotate("", xy=(dO, 0.28), xytext=(dO, 1.95),
|
||||
arrowprops=dict(arrowstyle="<->", color=C_GREEN, lw=1.3))
|
||||
a.text(dO + 0.16, 1.11, "$r_2$", color=C_GREEN, fontsize=11)
|
||||
a.annotate("", xy=(-0.55, -r3 + 0.05), xytext=(-0.55, -r3 - 0.55),
|
||||
arrowprops=dict(arrowstyle="<->", color=C_ORANGE, lw=1.3))
|
||||
a.text(-0.42, -r3 - 0.25, "$r_3$", color=C_ORANGE, fontsize=11)
|
||||
a.text(0, r3 + 0.95, "两中心轮齿数应同时为偶数或奇数", fontsize=9.8,
|
||||
ha="center")
|
||||
a.set_xlim(-3.4, 4.6)
|
||||
a.set_ylim(-r3 - 1.3, r3 + 1.5)
|
||||
|
||||
b.set_title("(b) 装配条件:$(z_1+z_3)/N$ 必须为整数", fontsize=10.8)
|
||||
gear(b, 0, 0, r3, lw=1.6, teeth=40, tin=True)
|
||||
gear(b, 0, 0, r1, lw=1.7, teeth=24)
|
||||
for ang in (0, 120, 240):
|
||||
t = np.radians(ang)
|
||||
px, py = dO * np.cos(t), dO * np.sin(t)
|
||||
gear(b, px, py, r2, lw=1.5, teeth=16)
|
||||
line(b, (0, 0), (px, py), C_ORANGE, 1.6, zorder=2)
|
||||
b.add_patch(Arc((0, 0), 2 * 1.72, 2 * 1.72, theta1=0, theta2=120,
|
||||
color=C_PURPLE, lw=1.5))
|
||||
b.text(2.30, 2.45, "$\\varphi_H=2\\pi/N$", color=C_PURPLE, fontsize=10.5,
|
||||
ha="left", va="center")
|
||||
lead(b, (0.86, 1.49), (2.20, 2.36), C_PURPLE, 0.9)
|
||||
b.text(0, -r3 - 0.95, "$N$=行星轮个数;$K=z_1 i_{1H}/N$ 须为整数",
|
||||
fontsize=9.8, ha="center")
|
||||
b.set_xlim(-3.4, 4.6)
|
||||
b.set_ylim(-r3 - 1.6, r3 + 1.4)
|
||||
|
||||
c.set_title("(c) 邻接条件:$O_1O_2>2r_{a2}$", fontsize=10.8)
|
||||
rc, r2c, dOc = 0.60, 0.75, 1.35
|
||||
gear(c, 0, 0, rc, lw=1.7, teeth=18, fc="#fdf2e5")
|
||||
t1 = np.radians(105)
|
||||
p1 = (dOc * np.cos(t1), dOc * np.sin(t1))
|
||||
p2 = (dOc * np.cos(t1 + np.radians(120)), dOc * np.sin(t1 + np.radians(120)))
|
||||
for p in (p1, p2):
|
||||
gear(c, p[0], p[1], r2c, lw=1.5, teeth=14)
|
||||
line(c, (0, 0), p, C_ORANGE, 1.3, zorder=2)
|
||||
dot(c, p[0], p[1], C_RED, ms=6)
|
||||
c.add_patch(Arc(p1, 2 * (r2c + 0.20), 2 * (r2c + 0.20),
|
||||
theta1=np.degrees(t1) - 160, theta2=np.degrees(t1) - 30,
|
||||
color=C_GREEN, lw=1.4, ls=":"))
|
||||
line(c, p1, p2, C_RED, 1.8, ls="--", zorder=1)
|
||||
c.text(p1[0] - 0.15, p1[1] + 1.00, "$O_1$", color=C_RED, fontsize=10.5,
|
||||
ha="center")
|
||||
c.text(p2[0] - 1.15, p2[1] - 0.85, "$O_2$", color=C_RED, fontsize=10.5,
|
||||
ha="center")
|
||||
lead(c, p1, (p1[0] - 0.12, p1[1] + 0.92), C_GRAY, 0.9)
|
||||
lead(c, p2, (p2[0] - 1.10, p2[1] - 0.80), C_GRAY, 0.9)
|
||||
c.text(0.92, 0.05, "太阳轮\n(中心轮)", fontsize=9.2, ha="left",
|
||||
va="center", color=C_ORANGE)
|
||||
lead(c, (0.75, 0.02), (0.88, 0.05), C_GRAY, 0.9)
|
||||
c.text(0.62, 1.28, "行星轮", fontsize=9.2, ha="left",
|
||||
va="center", color=C_MAIN)
|
||||
lead(c, (p1[0] + 0.78, p1[1]), (0.58, 1.28), C_GRAY, 0.9)
|
||||
c.text(0.75, -2.15, "$O_1O_2>2r_{a2}=2(r_2+h_a^{*}m)$",
|
||||
fontsize=9.8, ha="left", va="center", color="#555555")
|
||||
c.text(-2.55, -2.15, "$(z_1+z_2)\\sin\\dfrac{\\pi}{N}>z_2+2h_a^{*}$",
|
||||
fontsize=11, ha="left", va="center")
|
||||
c.set_xlim(-2.9, 3.3)
|
||||
c.set_ylim(-2.6, 2.9)
|
||||
|
||||
d.set_title("(d) 配齿公式(前三个条件合并)", fontsize=10.8)
|
||||
d.text(0.55, 0.55,
|
||||
"$z_2=\\dfrac{z_1\\,(i_{1H}-2)}{2}$\n\n"
|
||||
"$z_3=z_1\\,(i_{1H}-1)$\n\n"
|
||||
"$K=\\dfrac{z_1\\,i_{1H}}{N}$",
|
||||
fontsize=13, ha="center", va="center", linespacing=1.6)
|
||||
d.text(0.55, -1.35,
|
||||
"$z_1,z_2,z_3,K$ 均须为正整数,且 $z_1,z_2,z_3>z_{\\min}$",
|
||||
fontsize=9.8, ha="center", va="center", color="#333333",
|
||||
bbox=dict(boxstyle="round,pad=0.40", fc="#fbfbf6", ec="#d9d2c2"))
|
||||
d.set_xlim(-0.75, 1.85)
|
||||
d.set_ylim(-2.1, 1.9)
|
||||
|
||||
fig.tight_layout()
|
||||
save(fig, "figG10_assembly.png")
|
||||
|
||||
|
||||
# =====================================================================
|
||||
# figG11 少齿差行星传动(K-H-V / 孔销式输出机构)
|
||||
# =====================================================================
|
||||
def figG11():
|
||||
fig, axes = grid(1, 2, 10.6, 5.8)
|
||||
a, b = axes
|
||||
|
||||
a.set_title("(a) 渐开线少齿差(K-H-V 型):$z_2-z_1=1\\sim4$", fontsize=10.8)
|
||||
R1, R2 = 6.0, 5.0
|
||||
off = R1 - R2
|
||||
gear(a, 0, 0, R1, lw=1.9, teeth=72, tin=True)
|
||||
gear(a, off, 0, R2, lw=1.9, teeth=60, fc="#eaf1f8")
|
||||
line(a, (0, 0), (off, 0), C_ORANGE, 2.2, zorder=2)
|
||||
gear(a, 0, 0, 0.45, fc=C_ORANGE, lw=1.4, zorder=5)
|
||||
a.plot(0, 0, "k+", ms=8)
|
||||
dot(a, R1, 0, C_RED, ms=6)
|
||||
rot_arrow(a, 0, 0, R1 + 0.50, 110, -40, C_BLUE, lw=1.5)
|
||||
rot_arrow(a, off, 0, 1.30, -40, 110, C_ORANGE, lw=1.8)
|
||||
a.text(0, R1 + 0.95, "1 内齿圈(固定)", fontsize=10.3, ha="center")
|
||||
a.text(off, -1.85, "2 行星轮", fontsize=10.3, ha="center")
|
||||
a.text(off * 0.5 + 0.18, 0.58, "$H$", color=C_ORANGE, fontsize=12)
|
||||
a.text(0, -R1 - 1.30,
|
||||
"$i_{H2}=\\dfrac{\\omega_H}{\\omega_2}=-\\dfrac{z_1}{z_2-z_1}$"
|
||||
" ($z_1$=100,$z_2$=101 时 $i_{H2}=-100$)",
|
||||
fontsize=10.5, ha="center", va="top")
|
||||
a.text(0, -R1 - 2.85,
|
||||
"系杆主动、行星轮作平面运动,须加输出机构 V 引出其自转",
|
||||
fontsize=10.0, ha="center", va="top", color="#555555")
|
||||
a.set_xlim(-R1 - 1.6, R1 + 1.8)
|
||||
a.set_ylim(-R1 - 3.2, R1 + 1.8)
|
||||
|
||||
b.set_title("(b) 孔销式输出机构:$d_h=d_s+2a$", fontsize=10.8)
|
||||
rho, aa = 2.50, 0.85
|
||||
OV = (-3.90, -1.50)
|
||||
O2 = (OV[0] - aa, OV[1])
|
||||
th = np.radians(62)
|
||||
oh = (OV[0] + rho * np.cos(th), OV[1] + rho * np.sin(th))
|
||||
os_ = (O2[0] + rho * np.cos(th), O2[1] + rho * np.sin(th))
|
||||
line(b, OV, oh, C_PURPLE, 1.6, zorder=3)
|
||||
line(b, oh, os_, C_RED, 1.8, ls="--", zorder=4)
|
||||
line(b, os_, O2, C_GREEN, 1.6, zorder=3)
|
||||
line(b, O2, OV, C_RED, 1.8, ls="--", zorder=4)
|
||||
for p, col in ((OV, C_PURPLE), (oh, C_PURPLE), (os_, C_GREEN),
|
||||
(O2, C_GREEN)):
|
||||
dot(b, p[0], p[1], col, ms=6)
|
||||
b.text(OV[0], OV[1] - 0.60, "$O_V$", color=C_PURPLE, fontsize=10.5,
|
||||
ha="center", va="top")
|
||||
b.text(O2[0], O2[1] - 0.60, "$O_2$", color=C_GREEN, fontsize=10.5,
|
||||
ha="center", va="top")
|
||||
b.text(oh[0] + 0.18, oh[1] + 0.10, "$o_h$", color=C_PURPLE, fontsize=10.5,
|
||||
ha="left", va="bottom")
|
||||
b.text(os_[0] - 0.20, os_[1] - 0.55, "$o_s$", color=C_GREEN, fontsize=10.5,
|
||||
ha="center", va="top")
|
||||
b.text(-3.90, -2.70, "四圆心连成平行四边形", fontsize=9.4, ha="center",
|
||||
color="#555555")
|
||||
|
||||
cx0, cy0 = 2.20, 0.60
|
||||
rh, rs = 0.90, 0.55
|
||||
b.add_patch(Circle((cx0, cy0), rh, fc="white", ec=C_PURPLE, lw=1.8, zorder=5))
|
||||
b.add_patch(Circle((cx0 - (rh - rs), cy0), rs, fc="#eaf7ea", ec=C_GREEN,
|
||||
lw=1.8, zorder=6))
|
||||
dot(b, cx0, cy0, C_PURPLE, ms=6)
|
||||
dot(b, cx0 - (rh - rs), cy0, C_GREEN, ms=6)
|
||||
dot(b, cx0 - rh, cy0, C_RED, ms=5)
|
||||
b.text(cx0, cy0 + rh + 0.28, "销孔 $d_h$", color=C_PURPLE,
|
||||
fontsize=9.8, ha="center", va="bottom")
|
||||
b.text(cx0, cy0 - rh - 0.28, "销轴 $d_s$", color=C_GREEN,
|
||||
fontsize=9.8, ha="center", va="top")
|
||||
b.text(cx0 - rh - 0.15, cy0 + 0.22, "始终相切", color=C_RED, fontsize=9.4,
|
||||
ha="right", va="center")
|
||||
b.text(cx0, -1.55, "$d_h=d_s+2a$", fontsize=12.5, ha="center")
|
||||
b.set_xlim(-5.0, 4.4)
|
||||
b.set_ylim(-3.3, 3.1)
|
||||
|
||||
fig.tight_layout(rect=(0, 0.16, 1, 1))
|
||||
fig.text(0.5, 0.02,
|
||||
"四个圆心:输出盘中心 $O_V$、销孔中心 $o_h$、销轴中心 $o_s$、"
|
||||
"行星轮中心 $O_2$ —— 构成平行四边形;\n"
|
||||
"$d_h$=销孔直径,$d_s$=销轴直径,$a$=行星轮与输出盘的中心距(偏心距)",
|
||||
ha="center", va="bottom", fontsize=10.2, linespacing=1.8,
|
||||
bbox=dict(boxstyle="round,pad=0.5", fc="#fbfbf6", ec="#d9d2c2"))
|
||||
save(fig, "figG11_small_diff.png")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
for f in [figG01, figG02, figG03, figG04, figG05, figG06, figG07,
|
||||
figG08, figG09, figG10, figG11]:
|
||||
try:
|
||||
f()
|
||||
except Exception as e:
|
||||
import traceback
|
||||
print("FAILED", f.__name__, "->", repr(e))
|
||||
traceback.print_exc()
|
||||
print("done")
|
||||