component
TMCS1123B1AQDVGR - Isolated Hall-Effect Current Sensor
Public Made by Adomby adom
Texas Instruments TMCS1123B1AQDVGR: isolated Hall-effect current sensor, 25 mV/A with a 1.65 V zero-current output (linear +-62 A at 3.3 V), 80 A RMS continuous, 250 kHz, overcurrent detection, reinforced isolation, SOIC-10 wide body (DVG). KiCad, Fusion and Altium libraries, 3D model and datasheet.
main
John Lauer
Add symbol, footprint, Fusion and Altium libraries, viewers, provenance, README
ab389b2
6h ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
#!/usr/bin/env python3
"""Overlay proof: blend orthographic silhouettes of the model GLB over TI's DVG0010A package drawing
(SBOSA24D p.45 rendered at 300 dpi). Calibration: the drawing's blue outline in each view is found by colour; the
top view's lead-tip span (E) and molded length (D) set the scale (px/mm) and the centre. Views: top (x right,
y up), front (x right, z up, seen along +y), end (y up, z to the left, the +x pin row seen from +x).
usage: overlay_proof.py model.glb page45-300dpi.png out.png out.json"""
import sys, json
import numpy as np
from PIL import Image, ImageDraw
from pygltflib import GLTF2
glb, page, out, outj = sys.argv[1:5]
g = GLTF2().load(glb); blob = g.binary_blob()
CT = {5126: np.float32, 5125: np.uint32, 5123: np.uint16}
def acc(i):
x = g.accessors[i]; bv = g.bufferViews[x.bufferView]; n = {"SCALAR": 1, "VEC3": 3}[x.type]
a = np.frombuffer(blob, CT[x.componentType], x.count * n, (bv.byteOffset or 0) + (x.byteOffset or 0))
return a.reshape(-1, n) if n > 1 else a
def mat(n):
if n.matrix: return np.array(n.matrix).reshape(4, 4).T
M = np.eye(4)
if n.scale: M = M @ np.diag(list(n.scale) + [1])
return M
parts = {}
def walk(ni, M):
n = g.nodes[ni]; M = M @ mat(n)
if n.mesh is not None:
for p in g.meshes[n.mesh].primitives:
P = acc(p.attributes.POSITION).astype(float) * 1000; P = (np.c_[P, np.ones(len(P))] @ M.T)[:, :3]
parts.setdefault(n.name, []).append(P[acc(p.indices).reshape(-1, 3)])
for c in n.children or []: walk(c, M)
for r in g.scenes[g.scene or 0].nodes: walk(r, np.eye(4))
T = {k: np.concatenate(v) for k, v in parts.items()}
im = Image.open(page).convert("RGB"); A = np.array(im).astype(int)
H, W = A.shape[:2]
blue = (A[..., 2] > 150) & (A[..., 0] < 80) & (A[..., 1] < 170) & (A[..., 1] > 60)
def bbox(x0, x1, y0, y1):
m = blue[int(y0 * H):int(y1 * H), int(x0 * W):int(x1 * W)]; yy, xx = np.nonzero(m)
return [xx.min() + int(x0 * W), xx.max() + int(x0 * W), yy.min() + int(y0 * H), yy.max() + int(y0 * H)]
top = bbox(0, .55, .15, .45); side = bbox(.7, .9, .15, .45); front = bbox(.1, .55, .48, .6)
E_nom, D_nom = 10.30, 10.30
kx = (top[1] - top[0]) / E_nom; ky = (top[3] - top[2]) / D_nom; k = (kx + ky) / 2
cx, cy = (top[0] + top[1]) / 2, (top[2] + top[3]) / 2
lay = Image.new("RGBA", im.size, (0, 0, 0, 0)); d = ImageDraw.Draw(lay)
COL = {"body": (230, 40, 40, 70), "pins": (0, 200, 120, 90)}
def draw(proj):
for name in ("body", "pins"):
for tri in T[name]:
d.polygon([tuple(p) for p in proj(tri)], fill=COL[name])
draw(lambda t: np.c_[cx + k * t[:, 0], cy - k * t[:, 1]]) # top
fx0 = (front[0] + front[1]) / 2; fz0 = front[3] # front: seat at the lowest blue
draw(lambda t: np.c_[fx0 + k * t[:, 0], fz0 - k * t[:, 2]])
sz0 = side[1]; sy0 = (side[2] + side[3]) / 2 # end view: seat plane = rightmost blue
draw(lambda t: np.c_[sz0 - k * t[:, 2], sy0 - k * t[:, 1]])
res = Image.alpha_composite(im.convert("RGBA"), lay).convert("RGB")
x0, x1 = int(0.05 * W), int(0.97 * W); y0, y1 = int(0.13 * H), int(0.62 * H)
res.crop((x0, y0, x1, y1)).resize(((x1 - x0) // 2, (y1 - y0) // 2), Image.LANCZOS).save(out)
mm = lambda px: round(px / k, 3)
rep = {"page": "SBOSA24D p.45 at 300 dpi", "px_per_mm": round(k, 3), "kx": round(kx, 3), "ky": round(ky, 3),
"calibration": "top-view lead-tip span = E 10.30 (9.97..10.63 TYP mid) and molded length = D 10.30 (10.1..10.5 mid)",
"drawing_measured_mm": {"front_view_height": mm(front[3] - front[2]), "end_view_height": mm(side[1] - side[0]),
"front_view_span": mm(front[1] - front[0])},
"model_mm": {k2: [round(float(v), 3) for v in np.r_[T[k2].reshape(-1, 3).min(0), T[k2].reshape(-1, 3).max(0)]] for k2 in T}}
json.dump(rep, open(outj, "w"), indent=1); print(json.dumps(rep))