/* global React */ /* =========================================================== VOLTLAB · QUADROS & DIAGRAMAS Dimensionamento de quadros de partida WEG (Partida Direta + Estrela-Triângulo) =========================================================== */ const { useState, useMemo } = React; /* =========================================================== DADOS WEG — extraídos do "Guia de Seleção de Partidas" =========================================================== */ // Motores WEG W22 IR3 Premium — 60 Hz (Página 32) const MOTOR_CURRENTS = { "220": { "1": 2.90, "1.5": 4.30, "2": 5.69, "3": 8.25, "4": 11.4, "5": 14.1, "6": 16.5, "7.5": 20.4, "10": 26.0, "12.5": 32.2, "15": 38.4, }, "380": { "1": 1.68, "1.5": 2.49, "2": 3.29, "3": 4.78, "4": 6.60, "5": 8.16, "6": 9.55, "7.5": 11.8, "10": 15.1, "12.5": 18.6, "15": 22.2, }, }; // Tabela Partida Direta (3 componentes) — Página 4 // Faixa motor (A) → Disjuntor / Fusível / Contator / Relé Térmico const TABELA_PARTIDA_DIRETA = [ { min: 1.2, max: 1.6, q1: "MPW18i-3-D016", fus: "FDW-4S", k1: "CWB9-11-30", ft1: "RW27-2D3-D018" }, { min: 1.2, max: 1.8, q1: "MPW18i-3-D025", fus: "FDW-6S", k1: "CWB9-11-30", ft1: "RW27-2D3-D018" }, { min: 1.8, max: 2.5, q1: "MPW18i-3-D025", fus: "FDW-6S", k1: "CWB9-11-30", ft1: "RW27-2D3-D028" }, { min: 1.8, max: 2.8, q1: "MPW18i-3-U004", fus: "FDW-10S", k1: "CWB9-11-30", ft1: "RW27-2D3-D028" }, { min: 2.8, max: 4.0, q1: "MPW18i-3-U004", fus: "FDW-10S", k1: "CWB9-11-30", ft1: "RW27-2D3-U004" }, { min: 4.0, max: 6.3, q1: "MPW18i-3-D063", fus: "FDW-10S", k1: "CWB9-11-30", ft1: "RW27-2D3-D063" }, { min: 5.6, max: 8.0, q1: "MPW18i-3-U010", fus: "FDW-20S", k1: "CWB9-11-30", ft1: "RW27-2D3-U008" }, { min: 7.0, max: 9.0, q1: "MPW18i-3-U010", fus: "FDW-20S", k1: "CWB9-11-30", ft1: "RW27-2D3-U010" }, { min: 7.0, max: 10.0, q1: "MPW18i-3-U010", fus: "FDW-25S", k1: "CWB12-11-30", ft1: "RW27-2D3-U010" }, { min: 8.0, max: 12.0, q1: "MPW18i-3-U016", fus: "FDW-25S", k1: "CWB12-11-30", ft1: "RW27-2D3-D125" }, { min: 10.0, max: 15.0, q1: "MPW18i-3-U016", fus: "FDW-35S", k1: "CWB18-11-30", ft1: "RW27-2D3-U015" }, { min: 11.0, max: 16.0, q1: "MPW18i-3-U016", fus: "FDW-35S", k1: "CWB18-11-30", ft1: "RW27-2D3-U017" }, { min: 11.0, max: 17.0, q1: "MPW18i-3-U018", fus: "FDW-35S", k1: "CWB18-11-30", ft1: "RW27-2D3-U017" }, { min: 15.0, max: 18.0, q1: "MPW18i-3-U018", fus: "FDW-50S", k1: "CWB18-11-30", ft1: "RW27-2D3-U023" }, { min: 15.0, max: 20.0, q1: "MPW40i-3-U020", fus: "FDW-50S", k1: "CWB25-11-30", ft1: "RW27-2D3-U023" }, { min: 15.0, max: 23.0, q1: "MPW40i-3-U025", fus: "FDW-50S", k1: "CWB25-11-30", ft1: "RW27-2D3-U023" }, { min: 22.0, max: 25.0, q1: "MPW40i-3-U025", fus: "FDW-50S", k1: "CWB25-11-30", ft1: "RW27-2D3-U032" }, { min: 22.0, max: 32.0, q1: "MPW40i-3-U032", fus: "FDW-50S", k1: "CWB32-11-30", ft1: "RW27-2D3-U032" }, { min: 32.0, max: 38.0, q1: "MPW40i-3-U040", fus: "FDW-63S", k1: "CWB38-11-30", ft1: "RW27-2D3-U040" }, { min: 25.0, max: 40.0, q1: "MPW80i-3-U040", fus: "FDW-63S", k1: "CWB40-11-30", ft1: "RW67-5D3-U040" }, ]; // Tabela Partida Estrela-Triângulo (5 componentes) — Página 18 // faixa = I_motor / √3 const TABELA_ESTRELA_TRIANGULO = [ { min: 6.9, max: 10.9, q1: "MPW40i-3-U016", fus: "FDW-16S", k12: "CWB9-11-30", k3: "CWB9-11-30", ft1: "RW27-2D3-D063" }, { min: 9.7, max: 13.8, q1: "MPW40i-3-U016", fus: "FDW-20S", k12: "CWB9-11-30", k3: "CWB9-11-30", ft1: "RW27-2D3-U008" }, { min: 12.1, max: 15.6, q1: "MPW40i-3-U016", fus: "FDW-20S", k12: "CWB9-11-30", k3: "CWB9-11-30", ft1: "RW27-2D3-U010" }, { min: 12.1, max: 17.3, q1: "MPW40i-3-U020", fus: "FDW-25S", k12: "CWB12-11-30", k3: "CWB9-11-30", ft1: "RW27-2D3-U010" }, { min: 13.9, max: 20.8, q1: "MPW40i-3-U025", fus: "FDW-35S", k12: "CWB12-11-30", k3: "CWB9-11-30", ft1: "RW27-2D3-D125" }, { min: 17.3, max: 26.0, q1: "MPW40i-3-U032", fus: "FDW-35S", k12: "CWB18-11-30", k3: "CWB9-11-30", ft1: "RW27-2D3-U015" }, { min: 19.1, max: 27.0, q1: "MPW40i-3-U032", fus: "FDW-35S", k12: "CWB18-11-30", k3: "CWB9-11-30", ft1: "RW27-2D3-U017" }, { min: 19.1, max: 29.4, q1: "MPW40i-3-U032", fus: "FDW-50S", k12: "CWB18-11-30", k3: "CWB12-11-30", ft1: "RW27-2D3-U017" }, ]; const POTENCIAS_DISPONIVEIS = ["1","1.5","2","3","4","5","6","7.5","10","12.5","15"]; function lookupPartidaDireta(In) { return TABELA_PARTIDA_DIRETA.find(r => In >= r.min && In <= r.max) || null; } function lookupEstrelaTriangulo(In) { const i = In / Math.sqrt(3); return TABELA_ESTRELA_TRIANGULO.find(r => i >= r.min && i <= r.max) || null; } function dimensionarPartida(potencia, tensao, metodo) { const In = MOTOR_CURRENTS[tensao]?.[potencia]; if (!In) return null; if (metodo === "direta") { const sel = lookupPartidaDireta(In); if (!sel) return { In, error: "Sem componente compatível para " + In + " A" }; return { In, metodo: "Partida Direta", faixa: `${sel.min} … ${sel.max} A`, components: [ { tag: "Q1", type: "Disjuntor-Motor", code: sel.q1, desc: "Proteção magnética + sobrecarga" }, { tag: "F1", type: "Fusível gL/gG", code: sel.fus, desc: "Proteção contra curto-circuito" }, { tag: "K1", type: "Contator", code: sel.k1, desc: "Manobra e comando" }, { tag: "FT1", type: "Relé Térmico", code: sel.ft1, desc: "Proteção térmica do motor" }, ], }; } else { const sel = lookupEstrelaTriangulo(In); if (!sel) return { In, error: "Motor abaixo do mínimo recomendado para estrela-triângulo (≥ 5 cv 220V / 10 cv 380V)" }; return { In, metodo: "Partida Estrela-Triângulo", faixa: `${sel.min} … ${sel.max} A (I/√3)`, components: [ { tag: "Q1", type: "Disjuntor-Motor", code: sel.q1, desc: "Proteção magnética" }, { tag: "F1", type: "Fusível gL/gG", code: sel.fus, desc: "Proteção contra curto-circuito" }, { tag: "K1", type: "Contator linha", code: sel.k12, desc: "Contator principal" }, { tag: "K2", type: "Contator Δ", code: sel.k12, desc: "Contator triângulo" }, { tag: "K3", type: "Contator ✱", code: sel.k3, desc: "Contator estrela" }, { tag: "FT1", type: "Relé Térmico", code: sel.ft1, desc: "Proteção térmica" }, ], }; } } /* =========================================================== ÍCONES (lucide-style) =========================================================== */ const QIcon = ({ name, size = 16 }) => { const p = { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }; const paths = { plus: <>, trash: <>, motor: <>M, box: <>, chevron: , bolt: , cog: <>, download: <>, check: , info: <>, plug: <>, fuse: <>, contactor: <>, relay: <>, breaker: <>, }; return {paths[name]}; }; const COMP_ICON_BY_TAG = { "Q1": "breaker", "F1": "fuse", "K1": "contactor", "K2": "contactor", "K3": "contactor", "FT1": "relay", }; /* =========================================================== SVG: QUADRO + MOTOR (diagrama do dimensionamento) =========================================================== */ const QuadroDiagrama = ({ motor }) => { const dim = motor.dim; const comps = dim?.components || []; // layout: a vertical panel with 3 phases and components stacked const W = 420, H = 360; const railY = 36; // bus top const panelX = 80, panelY = 60, panelW = 260, panelH = 200; const compH = comps.length ? (panelH - 30) / comps.length : 0; return ( {/* 3-phase bus */} L1 L2 L3 {/* drop lines from bus to panel */} {/* panel rectangle */} QUADRO · QGM-{String(motor.id).padStart(2,"0")} {dim?.metodo?.toUpperCase()} {/* components inside panel */} {comps.map((c, i) => { const y = panelY + 22 + i*compH; return ( {c.tag} {c.type} {c.code} ); })} {/* panel → motor lines */} {/* motor */} M 3~ {motor.potencia} cv · {motor.tensao} V · In = {dim?.In} A ); }; /* =========================================================== ITEM DO MOTOR (no canvas) =========================================================== */ const MotorCard = ({ motor, selected, onSelect, onRemove }) => { const empty = !motor.dim; return (
M-{String(motor.id).padStart(2,"0")} {motor.dim?.error ? erro : motor.dim ? dimensionado : configurar }
{motor.dim && !motor.dim.error ? : (
{motor.dim?.error ? motor.dim.error : "Selecione potência, tensão e método para gerar o quadro"}
) }
); }; /* =========================================================== PAINEL DE CONFIGURAÇÃO (direita) =========================================================== */ const ConfigPanel = ({ motor, onChange }) => { if (!motor) { return (

Nenhum motor selecionado

Adicione um motor à área de desenho e clique sobre ele para configurar potência, tensão e método de partida.

); } const D = window.Dropdown_VL; return (
SELECIONADO

Motor M-{String(motor.id).padStart(2,"0")}

onChange({ potencia: v })} options={POTENCIAS_DISPONIVEIS.map(p => ({ value: p, label: `${p} cv` }))}/>
{motor.dim?.error ? (
{motor.dim.error}
) : motor.dim ? ( <>
CORRENTE NOMINAL {motor.dim.In} A
FAIXA ATENDIDA {motor.dim.faixa}
COMPONENTES DIMENSIONADOS · WEG
{motor.dim.components.map((c, i) => (
{c.tag} {c.type}
{c.code}
))}
) : null}
); }; /* =========================================================== ROOT — Quadros & Diagramas =========================================================== */ const QuadrosDiagramas = () => { const [motors, setMotors] = useState([ { id: 1, potencia: "5", tensao: "380", metodo: "direta" }, { id: 2, potencia: "10", tensao: "380", metodo: "estrela" }, ]); const [selectedId, setSelectedId] = useState(1); const nextId = useMemo(() => Math.max(0, ...motors.map(m => m.id)) + 1, [motors]); const enriched = motors.map(m => ({ ...m, dim: dimensionarPartida(m.potencia, m.tensao, m.metodo) })); const selected = enriched.find(m => m.id === selectedId) || null; const addMotor = () => { const m = { id: nextId, potencia: "5", tensao: "380", metodo: "direta" }; setMotors(arr => [...arr, m]); setSelectedId(m.id); }; const updateMotor = (id, patch) => setMotors(arr => arr.map(m => m.id === id ? { ...m, ...patch } : m)); const removeMotor = (id) => { setMotors(arr => arr.filter(m => m.id !== id)); if (selectedId === id) setSelectedId(null); }; // Stats const dimensionados = enriched.filter(m => m.dim && !m.dim.error).length; const totalIn = enriched.reduce((s, m) => s + (m.dim?.In || 0), 0); return (
{/* CANVAS */}
ÁREA DE DESENHO · QUADROS DIMENSIONADOS

Diagrama de partidas WEG

{/* mini KPIs */}
MOTORES{String(motors.length).padStart(2,"0")}
DIMENSIONADOS{String(dimensionados).padStart(2,"0")} / {String(motors.length).padStart(2,"0")}
CORRENTE TOTAL{totalIn.toFixed(1)} A
NORMAWEG · IEC 60947
{/* Canvas grid */} {motors.length === 0 ? (

Comece adicionando um motor

Clique em Adicionar motor acima para começar o dimensionamento de quadros.

) : (
{enriched.map(m => ( setSelectedId(m.id)} onRemove={() => removeMotor(m.id)} /> ))}
)}
{/* CONFIG PANEL */}
{/* Reference: motor current table */}
REFERÊNCIA TÉCNICA · MOTORES WEG W22 IR3 PREMIUM (60 Hz)

Tabela orientativa de corrente nominal

F.S. 1,00 · IV polos
POTÊNCIA CORRENTE 220V CORRENTE 380V PARTIDA DIRETA ESTRELA-Δ
{POTENCIAS_DISPONIVEIS.map(p => { const I220 = MOTOR_CURRENTS["220"][p]; const I380 = MOTOR_CURRENTS["380"][p]; const eStarOk380 = I380 / Math.sqrt(3) >= 6.9; return (
{p} cv {I220.toFixed(2)} A {I380.toFixed(2)} A disponível {eStarOk380 ? "disponível" : "abaixo do mínimo"}
); })}
); }; window.VL_Quadros = QuadrosDiagramas;