← Commit history
Merge PR #680: 0.2.148: adopt adom-fields 0.10.24, the boost converter (fields-0-10-24 -> main) merge
Showing changes introduced by the merge (against its first parent).
8 files changed
+155−23
Cargo.lock+11−11@@ -4,7 +4,7 @@ version = 4 [[package]] name = "adom-aiflow"-version = "0.2.147"+version = "0.2.148" dependencies = [ "aiflow-analyze", "aiflow-board",@@ -28,7 +28,7 @@ dependencies = [ [[package]] name = "aiflow-analyze"-version = "0.2.147"+version = "0.2.148" dependencies = [ "aiflow-board", "aiflow-sys",@@ -39,7 +39,7 @@ dependencies = [ [[package]] name = "aiflow-board"-version = "0.2.147"+version = "0.2.148" dependencies = [ "aiflow-sys", "roxmltree",@@ -49,7 +49,7 @@ dependencies = [ [[package]] name = "aiflow-bridge"-version = "0.2.147"+version = "0.2.148" dependencies = [ "aiflow-board", "aiflow-sys",@@ -59,7 +59,7 @@ dependencies = [ [[package]] name = "aiflow-copper"-version = "0.2.147"+version = "0.2.148" dependencies = [ "aiflow-board", "aiflow-grid",@@ -70,7 +70,7 @@ dependencies = [ [[package]] name = "aiflow-grid"-version = "0.2.147"+version = "0.2.148" dependencies = [ "aiflow-board", "serde",@@ -79,7 +79,7 @@ dependencies = [ [[package]] name = "aiflow-place"-version = "0.2.147"+version = "0.2.148" dependencies = [ "aiflow-board", "aiflow-sys",@@ -89,7 +89,7 @@ dependencies = [ [[package]] name = "aiflow-pours"-version = "0.2.147"+version = "0.2.148" dependencies = [ "aiflow-board", "aiflow-copper",@@ -100,7 +100,7 @@ dependencies = [ [[package]] name = "aiflow-router"-version = "0.2.147"+version = "0.2.148" dependencies = [ "aiflow-board", "aiflow-grid",@@ -111,7 +111,7 @@ dependencies = [ [[package]] name = "aiflow-run"-version = "0.2.147"+version = "0.2.148" dependencies = [ "aiflow-sys", "serde",@@ -120,7 +120,7 @@ dependencies = [ [[package]] name = "aiflow-sys"-version = "0.2.147"+version = "0.2.148" dependencies = [ "serde_json", ]
Cargo.toml+1−1@@ -15,7 +15,7 @@ members = [ ] [workspace.package]-version = "0.2.147"+version = "0.2.148" edition = "2021" license = "MIT" repository = "https://wiki.adom.inc/adom/adom-aiflow"
crates/adom-aiflow/src/converter.rs+98−9@@ -21,7 +21,19 @@ use serde_json::{json, Value}; /// Numbers calcs.json gives for the block: input and output volts, switching frequency (Hz), topology. #[derive(Debug, Default, Clone, PartialEq)]-pub struct Calcs { pub vin: Option<f64>, pub vout: Option<f64>, pub fsw_hz: Option<f64>, pub topology: Option<String> }+pub struct Calcs { pub vin: Option<f64>, pub vout: Option<f64>, pub fsw_hz: Option<f64>, pub topology: Option<String>,+ /// adom-fields 0.10.24: the chosen inductance (uH) and the efficiency (0 to 1), when calcs.json states them+ pub l_uh: Option<f64>, pub efficiency: Option<f64> }++/// An inductance key in uH: l_uh, inductance_uh, l_chosen_uh, l_selected_uh, inductor_uh ({"name": "L", "unit": "uH"} too).+fn inductance_key(k: &str) -> bool {+ matches!(norm_key(k).as_str(), "l_uh" | "inductance_uh" | "l_chosen_uh" | "l_selected_uh" | "l_sel_uh" | "inductor_uh" | "l_nom_uh" | "l_actual_uh")+}++/// An efficiency key: efficiency, eta, eff (a fraction, or a percent above 1).+fn efficiency_key(k: &str) -> bool { matches!(norm_key(k).as_str(), "efficiency" | "eta" | "eff" | "efficiency_est" | "eta_est" | "efficiency_pct" | "eta_pct") }++fn fraction(x: f64) -> Option<f64> { let f = if x > 1.0 && x <= 100.0 { x / 100.0 } else { x }; (f > 0.0 && f <= 1.0).then_some(f) } const TOPOLOGIES: &[&str] = &["buck-boost", "buck", "boost", "sepic", "cuk", "flyback", "forward", "inverting"]; @@ -56,6 +68,9 @@ fn walk(v: &Value, c: &mut Calcs, vin_rank: &mut usize, vout_rank: &mut usize) { let mul = m.get("unit").and_then(|u| u.as_str()).and_then(unit_mul).unwrap_or(mul); if c.fsw_hz.is_none() { c.fsw_hz = Some(scale_freq(x, mul)); } }+ let unit = m.get("unit").and_then(|u| u.as_str()).map(|u| u.trim().to_ascii_lowercase());+ if c.l_uh.is_none() && (inductance_key(n) || (matches!(norm_key(n).as_str(), "l" | "inductance" | "l_chosen" | "l_selected") && matches!(unit.as_deref(), Some("uh" | "\u{b5}h" | "\u{3bc}h")))) && x > 0.0 { c.l_uh = Some(x); }+ if c.efficiency.is_none() && efficiency_key(n) { c.efficiency = fraction(x); } for (which, rank, slot) in [("vin", &mut *vin_rank, &mut c.vin), ("vout", &mut *vout_rank, &mut c.vout)] { if let Some(p) = volts_key(n, which) { if p < *rank { *rank = p; *slot = Some(x); } } }@@ -66,6 +81,8 @@ fn walk(v: &Value, c: &mut Calcs, vin_rank: &mut usize, vout_rank: &mut usize) { } if let Some(n) = x.as_f64() { if let Some(mul) = freq_key(k) { if c.fsw_hz.is_none() { c.fsw_hz = Some(scale_freq(n, mul)); } }+ if c.l_uh.is_none() && inductance_key(k) && n > 0.0 { c.l_uh = Some(n); }+ if c.efficiency.is_none() && efficiency_key(k) { c.efficiency = fraction(n); } if let Some(p) = volts_key(k, "vin") { if p < *vin_rank { *vin_rank = p; c.vin = Some(n); } } if let Some(p) = volts_key(k, "vout") { if p < *vout_rank { *vout_rank = p; c.vout = Some(n); } } }@@ -120,6 +137,38 @@ fn trim(x: f64) -> String { let s = format!("{:.3}", x); s.trim_end_matches('0') /// The spec block to add, filled from the spec, calcs.json and the board where they say; `<...>` where nothing does. /// `refs` is (switch net, switch part, inductor, output net, input net) when the board tells them. pub fn hint_block(spec: &Value, c: &Calcs, refs: Option<(String, Option<String>, Option<String>, Option<String>, Option<String>)>) -> String {+ hint_block_full(spec, c, refs, None)+}++/// The board's asynchronous boost, as adom-fields 0.10.24 reads it: a diode from the switch node to a rail other than+/// ground and the inductor's far side. (diode, its cathode net: the output, the inductor's far side: the input)+#[derive(Debug, Clone, PartialEq)]+pub struct Boost { pub diode: String, pub out_net: String, pub in_net: String }++pub fn boost_diode(spec: &Value, b: &aiflow_board::Board) -> Option<Boost> {+ let sw = crate::switchnode::nets(spec, b).into_iter().next()?;+ let ground = |n: &str| { let u = n.to_ascii_uppercase(); u.contains("GND") || u == "VSS" };+ let nets_of = |r: &str| -> Vec<String> { let mut v: Vec<String> = b.pads.iter().filter(|p| p.reference == r && !p.net.is_empty()).map(|p| p.net.clone()).collect(); v.sort(); v.dedup(); v };+ let mut on_sw: Vec<String> = b.pads.iter().filter(|p| p.net == sw).map(|p| p.reference.clone()).collect();+ on_sw.sort(); on_sw.dedup();+ let l = on_sw.iter().find(|r| r.starts_with('L'))?;+ let far = nets_of(l).into_iter().find(|n| *n != sw && !ground(n))?;+ on_sw.iter().filter(|r| r.starts_with('D') && r[1..].chars().next().is_some_and(|c| c.is_ascii_digit())).find_map(|d| {+ let other: Vec<String> = nets_of(d).into_iter().filter(|n| *n != sw).collect();+ (other.len() == 1 && !ground(&other[0]) && other[0] != far).then(|| Boost { diode: d.clone(), out_net: other[0].clone(), in_net: far.clone() })+ })+}++/// `hint_block` with the board's boost (adom-fields 0.10.24): a boost's input is the inductor's far side, its output the+/// diode's cathode net, its switch node swings to the output; the `converter` block names the topology, the output and+/// what calcs.json states of the inductance and the efficiency (never a guess).+pub fn hint_block_full(spec: &Value, c: &Calcs, refs: Option<(String, Option<String>, Option<String>, Option<String>, Option<String>)>, boost: Option<&Boost>) -> String {+ let is_boost = boost.is_some() || c.topology.as_deref() == Some("boost");+ let refs = match (refs, boost) {+ (Some((sw, u, l, _, _)), Some(bd)) => Some((sw, u, l, Some(bd.out_net.clone()), Some(bd.in_net.clone()))),+ (Some((sw, u, l, far, uin)), None) if is_boost => Some((sw, u, l, None, uin.or(far))),+ (r, _) => r,+ }; let sw = refs.as_ref().map(|r| r.0.clone()) .or_else(|| spec["switchNodes"].as_array().and_then(|a| a.first()).and_then(|x| x.as_str()).map(str::to_string)) .or_else(|| spec["switching"].as_object().and_then(|o| o.keys().next().cloned()))@@ -133,17 +182,27 @@ pub fn hint_block(spec: &Value, c: &Calcs, refs: Option<(String, Option<String>, let vin = spec["voltages"][&in_net].as_f64().or(c.vin); let vout = spec["voltages"][&out_net].as_f64().or(c.vout); // a buck's switch node swings between the input and ground; a boost's between the output and ground- let high = if c.topology.as_deref() == Some("boost") { vout } else { vin };+ let high = if is_boost { vout } else { vin };+ // a buck's output is fed by its inductor; a boost's by its diode (or the switch, synchronous)+ let feeder = if is_boost { boost.map(|b| b.diode.clone()).or(uref.clone()) } else { lref.clone() }; let fsw = spec["switching"][&sw]["freqHz"].as_f64().or(c.fsw_hz); let q = |s: &str| json!(s).to_string(); let block = format!("\"voltages\": {{{}: {}, {}: {}}},\n\"sources\": {{{}: [{}], {}: [{}]}},\n\"switching\": {{{}: {{\"highV\": {}, \"lowV\": 0, \"freqHz\": {}, \"riseNs\": 8}}}}", q(&in_net), num(vin, "VIN volts"), q(&out_net), num(vout, "VOUT volts"),- q(&out_net), q(lref.as_deref().unwrap_or("<the inductor, e.g. L1>")), q(&sw), q(uref.as_deref().unwrap_or("<the switch or regulator, e.g. U1>")),+ q(&out_net), q(feeder.as_deref().unwrap_or(if is_boost { "<the boost diode or switch, e.g. D1>" } else { "<the inductor, e.g. L1>" })), q(&sw), q(uref.as_deref().unwrap_or("<the switch or regulator, e.g. U1>")), q(&sw), num(high, "input volts"), fsw.map(|f| format!("{}", f.round() as i64)).unwrap_or_else(|| "\"<fsw in Hz>\"".into()));- match known_in.filter(|_| spec["converter"]["inNet"].is_null()) {- Some(n) => format!("{block},\n\"converter\": {{\"inNet\": {}}}", q(&n)),- None => block,- }+ // the converter block: only what the spec does not say yet+ let mut conv = serde_json::Map::new();+ let free = |k: &str| spec["converter"][k].is_null();+ if let Some(n) = boost.map(|b| b.in_net.clone()).or(known_in).filter(|_| free("inNet")) { conv.insert("inNet".into(), json!(n)); }+ if let Some(bd) = boost.filter(|_| free("outNet")) { conv.insert("outNet".into(), json!(bd.out_net)); }+ // adom-fields 0.10.24: a synchronous boost reads as a buck from the board alone, so the topology is written for every boost+ if is_boost && free("topology") { conv.insert("topology".into(), json!("boost")); }+ if let Some(l) = c.l_uh.filter(|_| free("inductanceUh")) { conv.insert("inductanceUh".into(), json!(l)); }+ if let Some(e) = c.efficiency.filter(|_| free("efficiency")) { conv.insert("efficiency".into(), json!(e)); }+ if conv.is_empty() { return block; }+ let body = conv.iter().map(|(k, v)| format!("{}: {v}", json!(k))).collect::<Vec<_>>().join(", ");+ format!("{block},\n\"converter\": {{{body}}}") } pub const RISE_NOTE: &str = "riseNs 8 is adom-fields' default edge time, an estimate: replace it with the switch's rise time from the regulator's datasheet (it sets the EMC harmonics). Values in <...> were not in the spec or calcs.json: fill them from the design.";@@ -189,7 +248,8 @@ pub fn check(spec: &Value, calcs_v: Option<&Value>, fields: Option<&Value>, boar if !gaps.is_empty() { parts.push(format!("the spec lacks {}", gaps.join(", "))); } parts.extend(rep); let c = calcs_v.map(calcs).unwrap_or_default();- let block = hint_block(spec, &c, board.and_then(|b| board_refs(spec, b)));+ let boost = board.and_then(|b| boost_diode(spec, b));+ let block = hint_block_full(spec, &c, board.and_then(|b| board_refs(spec, b)), boost.as_ref()); Some((format!("this is a switching converter ({why}) but {}", parts.join("; ")), vec![ format!("Add to the spec (top level), then solve again (`adom-fields analyze --board <current board> --spec <spec> --out <run>/fields`):\n{block}"), RISE_NOTE.into(),@@ -221,7 +281,7 @@ mod tests { #[test] fn calcs_give_rails_frequency_and_topology() { let c = calcs(&calcs_fixture());- assert_eq!(c, Calcs { vin: Some(12.0), vout: Some(5.0), fsw_hz: Some(500e3), topology: Some("buck".into()) });+ assert_eq!(c, Calcs { vin: Some(12.0), vout: Some(5.0), fsw_hz: Some(500e3), topology: Some("buck".into()), l_uh: Some(15.0), efficiency: None }); let c = calcs(&json!([{"name": "fsw", "value": 1.2, "unit": "MHz"}, {"name": "Vin", "value": 5}])); assert_eq!((c.fsw_hz, c.vin), (Some(1.2e6), Some(5.0))); assert_eq!(calcs(&json!({"fsw": 400})).fsw_hz, Some(400e3));@@ -285,4 +345,33 @@ mod tests { assert!(b.contains("\"voltages\": {\"VIN\": 12, \"+5V\": 5}"), "{b}"); assert!(b.contains("\"sources\": {\"+5V\": [\"L1\"], \"SW\": [\"U1\"]}"), "{b}"); }++ /// adom-fields 0.10.24 (issue 47, King Silver): an asynchronous boost on the board, with calcs.json naming L and eta+ #[test]+ fn a_boost_gets_its_input_output_topology_inductance_and_efficiency() {+ let b = aiflow_board::Board::from_text("t.kicad_pcb", r#"(kicad_pcb (net 0 "") (net 1 "SW") (net 2 "VBAT") (net 3 "+12V") (net 4 "GND")+ (gr_rect (start 0 0) (end 40 20) (layer "Edge.Cuts"))+ (footprint "Inductor_SMD:L_Bourns_SRP4020" (layer "F.Cu") (at 10 10) (property "Reference" "L1")+ (pad "1" smd rect (at -1 0) (size 1 1) (layers "F.Cu") (net 2 "VBAT")) (pad "2" smd rect (at 1 0) (size 1 1) (layers "F.Cu") (net 1 "SW")))+ (footprint "Diode_SMD:D_SOD-123" (layer "F.Cu") (at 16 10) (property "Reference" "D1")+ (pad "1" smd rect (at -1 0) (size 1 1) (layers "F.Cu") (net 3 "+12V")) (pad "2" smd rect (at 1 0) (size 1 1) (layers "F.Cu") (net 1 "SW")))+ (footprint "Package_TO_SOT_SMD:SOT-23-5" (layer "F.Cu") (at 22 10) (property "Reference" "U1")+ (pad "1" smd rect (at -1 0) (size 1 1) (layers "F.Cu") (net 1 "SW") (pinfunction "SW")) (pad "2" smd rect (at 1 0) (size 1 1) (layers "F.Cu") (net 4 "GND"))))"#.to_string()).unwrap();+ let spec = json!({"switchNodes": ["SW"]});+ let bd = boost_diode(&spec, &b).unwrap();+ assert_eq!(bd, Boost { diode: "D1".into(), out_net: "+12V".into(), in_net: "VBAT".into() });+ let c = calcs(&json!({"topology": "Asynchronous boost", "vin": 3.7, "vout": 12, "fsw_kHz": 1200, "L_uH": 6.8, "efficiency": 88}));+ assert_eq!((c.l_uh, c.efficiency), (Some(6.8), Some(0.88)));+ let h = hint_block_full(&spec, &c, board_refs(&spec, &b), Some(&bd));+ assert!(h.contains("\"voltages\": {\"VBAT\": 3.7, \"+12V\": 12}"), "{h}");+ assert!(h.contains("\"sources\": {\"+12V\": [\"D1\"]"), "{h}");+ assert!(h.contains("\"highV\": 12,"), "the switch node swings to the output: {h}");+ assert!(h.contains(r#""converter": {"efficiency": 0.88, "inNet": "VBAT", "inductanceUh": 6.8, "outNet": "+12V", "topology": "boost"}"#), "{h}");+ // a buck's catch diode goes to ground: not a boost+ let buck = aiflow_board::Board::from_text("t.kicad_pcb", b.text.replace("(net 3 \"+12V\")) (pad \"2\" smd rect (at 1 0) (size 1 1) (layers \"F.Cu\") (net 1 \"SW\")))\n (footprint \"Package", "(net 4 \"GND\")) (pad \"2\" smd rect (at 1 0) (size 1 1) (layers \"F.Cu\") (net 1 \"SW\")))\n (footprint \"Package")).unwrap();+ assert!(boost_diode(&spec, &buck).is_none());+ // what the spec already says is not repeated+ let said = hint_block_full(&json!({"switchNodes": ["SW"], "converter": {"topology": "boost", "inNet": "VBAT", "outNet": "+12V", "inductanceUh": 6.8, "efficiency": 0.88}}), &c, board_refs(&spec, &b), Some(&bd));+ assert!(!said.contains("\"converter\""), "{said}");+ } }
crates/adom-aiflow/src/fields_versions.rs+33@@ -20,6 +20,9 @@ //! - 0.10.23 (adom/adom-fields#46, Jinwon Kim): a converter's input network (filter ladder, line-side bulk, damping legs, //! upstream TVS) is in the conducted, input-filter stability and hot-plug models. Before it those three were //! pessimistic on such boards (a 48 V case: conducted 109 -> 71 dBuV, Middlebrook -4 -> +28 dB, hot plug 91.6 -> 48.5 V).+//! - 0.10.24 (adom/adom-fields#47, King Silver): the converter review models a boost. Before it an asynchronous boost (a+//! diode from the switch node to a rail other than ground and the inductor's far side) was taken as a buck fed from Vout:+//! its duty, input current, hot loop and the findings built on them were a buck's. //! - 0.10.21 (adom/adom-fields#43, Fredrik Angell Moe): spec `planes` counts as a return plane (and return-named nets and a //! converter's power-stage ground without it), decoupling no longer judges pins typed as signals (an EN pin on a supply //! net), and the hot-loop capacitor is the smallest one near the switch, not the smallest on the rail. Before it, such@@ -97,6 +100,15 @@ pub fn stale_notes(fields: &Value, spec: &Value, board: &Path) -> Vec<String> { version_text(solver), kinds.join(", "), if network { "this board has an input filter, line-side bulk, a damping leg or an upstream TVS, so " } else { "on a board with an input filter, line-side bulk, a damping leg or an upstream TVS " })); } }+ // 0.10.24: a boost was modelled as a buck fed from its output+ if solver < (0, 10, 24) && !fields["review"]["converter"].is_null() {+ let said = spec["converter"]["topology"].as_str().is_some_and(|t| t.to_ascii_lowercase().contains("boost"));+ let found = plan_board(board, &text).and_then(|b| crate::converter::boost_diode(spec, &b));+ if said || found.is_some() {+ out.push(format!("this Fields solve is adom-fields {}, before 0.10.24, which modelled every converter as a buck: this board's converter is a boost{}, so its duty, input current, hot loop and the findings built on them were a buck's fed from the output. Update adom-fields (adom-wiki pkg install adom/adom-fields) and analyze again; spec converter.topology \"boost\" is needed for a synchronous boost, and converter.inductanceUh and converter.efficiency from calcs.json sharpen it",+ version_text(solver), found.map(|b| format!(" ({} from the switch node to {}, input {})", b.diode, b.out_net, b.in_net)).unwrap_or_else(|| " (spec converter.topology)".into())));+ }+ } // 0.10.21: decoupling on signal pins, return planes in spec planes, the hot-loop capacitor near the switch if solver < (0, 10, 21) { let mut kinds: Vec<String> = fields["issues"].as_array().into_iter().flatten().filter_map(|i| i["kind"].as_str().or(i["type"].as_str()))@@ -400,6 +412,27 @@ mod tests { } + /// adom-fields 0.10.24: a boost on the board (a diode from SW to a rail other than ground and the inductor's far side)+ /// solved before 0.10.24 was a buck from Vout; a buck board is not told+ #[test]+ fn a_boost_solved_as_a_buck_is_told_to_solve_again() {+ let board = |diode_net: &str| format!(r#"(kicad_pcb (net 0 "") (net 1 "SW") (net 2 "VBAT") (net 3 "+12V") (net 4 "GND")+ (gr_rect (start 0 0) (end 40 20) (layer "Edge.Cuts"))+ (footprint "Inductor_SMD:L_1210" (layer "F.Cu") (at 10 10) (property "Reference" "L1")+ (pad "1" smd rect (at -1 0) (size 1 1) (layers "F.Cu") (net 2 "VBAT")) (pad "2" smd rect (at 1 0) (size 1 1) (layers "F.Cu") (net 1 "SW")))+ (footprint "Diode_SMD:D_SOD-123" (layer "F.Cu") (at 16 10) (property "Reference" "D1")+ (pad "1" smd rect (at -1 0) (size 1 1) (layers "F.Cu") {diode_net}) (pad "2" smd rect (at 1 0) (size 1 1) (layers "F.Cu") (net 1 "SW"))))"#);+ let spec = json!({"switchNodes": ["SW"]});+ let old = json!({"inputIdentity": {"solverVersion": "0.10.23"}, "review": {"converter": {"topology": "buck"}}});+ let boost = tmp("boost24.kicad_pcb", &board(r#"(net 3 "+12V")"#));+ let n = stale_notes(&old, &spec, &boost);+ assert!(n.iter().any(|x| x.contains("before 0.10.24") && x.contains("D1 from the switch node to +12V, input VBAT")), "{n:?}");+ let buck = tmp("buck24.kicad_pcb", &board(r#"(net 4 "GND")"#));+ assert!(!stale_notes(&old, &spec, &buck).iter().any(|x| x.contains("0.10.24")));+ let new = json!({"inputIdentity": {"solverVersion": "0.10.24"}, "review": {"converter": {"topology": "boost (asynchronous)"}}});+ assert!(!stale_notes(&new, &spec, &boost).iter().any(|x| x.contains("0.10.24")));+ }+ /// adom-fields 0.10.23: conducted, stability and hot-plug findings with an input network are named; without one they are not #[test] fn input_network_findings_are_told_to_solve_again() {
docs/release-0.2.148.mdadded+8@@ -0,0 +1,8 @@+# adom-aiflow 0.2.148++Adopts adom-fields 0.10.24 (adom/adom-fields#47, King Silver): the converter review models a boost.++- **The converter hint knows a boost.** When the board shows an asynchronous boost (a diode from the switch node to a rail other than ground and the inductor's far side, as Fields reads it), or calcs.json says boost, the spec block the gate and finish suggest takes the input from the inductor's far side and the output from the diode's cathode net. It names the diode as the output's source, sets the switch node's `highV` to Vout, and writes `converter.topology "boost"` (needed for a synchronous boost) and `converter.outNet`. Before, a boost got a buck's block.+- **Inductance and efficiency from calcs.json.** `converter.inductanceUh` and `converter.efficiency` are written when calcs.json states them (`L_uH`, `inductance_uH`, `{"name": "L", "unit": "uH"}`; `efficiency` or `eta`, a fraction or a percent), never guessed. Keys the spec already has are not repeated.+- **Re-solve note:** `analyze` names a solve before 0.10.24 that modelled a converter on a boost board (or a spec that says boost): it was modelled as a buck fed from its output.+- Skill: aiflow-power-layout describes the boost spec.
package.json+1−1@@ -1,7 +1,7 @@ { "slug": "adom-aiflow", "type": "app",- "version": "0.2.147",+ "version": "0.2.148", "title": "AI Flow", "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad, Fusion 360 and Altium Designer today (the same steps and gates through each tool's bridge); Adom's own web apps next.", "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",
page.json+1−1@@ -1,7 +1,7 @@ { "slug": "adom-aiflow", "type": "app",- "version": "0.2.147",+ "version": "0.2.148", "title": "AI Flow", "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad, Fusion 360 and Altium Designer today (the same steps and gates through each tool's bridge); Adom's own web apps next.", "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",
skills/aiflow-power-layout/SKILL.md+2@@ -32,6 +32,8 @@ Write `aiflow/spec.json` from the schematic before `start`, with a note on every `highV` is the input rail for a buck (the output for a boost), `freqHz` the switching frequency from calcs.json, `riseNs` the switch's edge time from the regulator datasheet (8 ns is adom-fields' default, an estimate to replace). Without `switchNodes`, the switch nodes are the nets of `switching`, else a net shared by an inductor pad and a SW, LX or PH pin; a net only named like one (SW_DAY1, an analogue switch's control line) is not taken when the board's structure is known, and when names alone decide, the gate prints the nets and the `"switchNodes": [...]` override first. A run is a converter when the spec declares `switchNodes` or `switching`, or the calcs evidence carries a switching frequency (`fsw`, `fsw_kHz`, ...) or a `topology` (buck, boost, ...). Then `start` and `evidence add --kind calcs` warn when the block is missing, and `tour fields` and `finish` refuse it, printing the block filled from calcs.json and the board. + **A boost (adom-fields 0.10.24).** Fields models a boost: its input is the inductor's far side, its output the diode's cathode (or the synchronous switch's) net, and its switch node swings to the output (`highV` is Vout). Name the output's source as the diode (`"sources": {"+12V": ["D1"]}`), not the inductor. Add `"converter": {"topology": "boost", "inNet": ..., "outNet": ...}`; `topology` is required for a synchronous boost, which the board alone reads as a buck. Also add `inductanceUh` and `efficiency` (0 to 1) when calcs.json has them: a boost otherwise assumes 0.9 and a buck lossless. When the board shows the boost, the gate's hint fills these from the board and calcs.json.+ ## 2. Placement: the hot loop first, chains in one rotation - Input caps, IC VIN and IC GND form the hot loop: smallest possible loop on F.Cu, the high-frequency cap closest to the pins.