galvan_core 1.1.1
galvan_core: ^1.1.1 copied to clipboard
Electroplating and electroforming calculations: metal constants, alloy derivation, layer thickness, multi-piece run planning and reminder schedules.
galvan_core #
Calculation core for electroplating and electroforming workshop software. Pure Dart, no Flutter dependency, fully unit tested.
Magyar leírás lentebb.
The rule the design rests on #
Current density is held constant. Every piece in a tank therefore receives the same A/dm², and a piece's finish time depends only on its target thickness, not on its area.
Two consequences follow, and both matter in a real workshop:
- Pieces with the same target thickness finish at the same time, however large or small they are.
- Pieces with different target thicknesses finish at different times. When the first one is removed, the total current must be reduced — otherwise the piece left in the tank receives a higher current density and burns.
Modules #
| Module | Responsibility |
|---|---|
metals.dart |
Metal constants, electrochemical equivalents, alloy derivation |
deposition.dart |
Charge ↔ thickness ↔ time conversion |
run_plan.dart |
A tank of work: several pieces sharing one current |
reminders.dart |
Reminder schedule for a run |
start_time.dart |
Start time suggestion avoiding quiet hours |
Example #
import 'package:galvan_core/galvan_core.dart';
final run = RunPlan(
metal: copper,
efficiency: 0.98,
currentDensity: 1.33,
pieces: const [
PiecePlan(id: 'leaf', nameHu: 'Leaf', areaDm2: 0.18, targetMicrons: 500),
PiecePlan(id: 'cone', nameHu: 'Cone', areaDm2: 0.12, targetMicrons: 300),
],
);
run.totalCurrent; // 0.399 A — set this on the supply
run.completionFor('cone'); // 17 h 23 m
run.currentDensityIfCurrentUnchanged('cone'); // 2.22 A/dm² — the burn warning
run.withoutPiece('cone').totalCurrent; // 0.239 A — reduce to this
Units #
| Quantity | Unit |
|---|---|
k (metal constant) |
µm per A·h/dm², at 100 % cathode efficiency |
| Area | dm² |
| Thickness | µm |
| Current density | A/dm² |
| Charge | A·h |
Accuracy and limits #
k values assume 100 % cathode efficiency. Real efficiency is lower and varies by
bath — for hexavalent chrome it is 10–25 %, which changes the time by a factor of
seven. The caller must supply the real figure; MetalComponent.typicalEfficiency is
an informative starting point, not a substitute for the supplier's data sheet.
Current sharing between pieces is estimated proportionally to area. Real
distribution also depends on geometry, distance from the anode and contact quality.
When piece areas differ by more than fivefold, RunPlan.shouldSplit reports that two
separate runs would be more accurate than a better algorithm.
Safety #
This package computes numbers. It does not make electroplating safe. Electroplating uses strong acids and alkalis, heavy metal salts and electric current in a wet environment. Follow the safety rules of your bath's data sheet, use local exhaust ventilation, and never work alone.
Tests #
dart test
Magyarul #
Galvanizálási és elektroformázási műhely-alkalmazások számítási magja. Tiszta Dart, Fluttertől független, teljes körű unit tesztekkel.
A központi szabály: az áramsűrűséget állandón tartjuk, ezért minden darab ugyanazt az A/dm²-t kapja, és egy darab elkészülési ideje csak a célvastagságától függ, a felületétől nem. Ebből következik, hogy azonos célvastagságú darabok egyszerre készülnek el, akármekkorák — és hogy eltérő célvastagság esetén az elsőként elkészülő darab kivételekor csökkenteni kell az áramot, különben a bent maradó darab túlhajtást kap és megég.
A k értékek 100 %-os katódhatásfokra vonatkoznak; a valós hatásfokot a hívónak kell
megadnia. Az áram darabok közti elosztása területarányos becslés — nagyon eltérő
méreteknél a RunPlan.shouldSplit két külön futást javasol.
A kód dokumentációja magyarul van.