Skip to content

Conversation

@ducky64
Copy link
Collaborator

@ducky64 ducky64 commented Mar 22, 2025

SMUv3.1 and associated infrastructural changes. Major improvements to reliability, stability, and (hopefully) resolution (noise floor). Resolves #351

Changes:

  • Change emitter follower to be able to independently control gate on status on high and low sides
    • Refactor to use positive gate voltage instead of power
  • Rename ErrorAmplifier -> GatedSummingAmplifier to better reflect the standard topology
    • Improved docs
    • Add optional fine target input
    • Add optional sense output, upstream of the gating / resistive output element (to detect current limiting mode)
      rails, for headroom on analog switches
    • Make gate clamping voltage (zener) a parameter
  • Add JFET current clamp and simulation
  • Refactor SMU control schematic:
    • for readability
    • to be self-contained
    • change current sense amplifier to use inamps
    • better output protection with a R-C snubber and low-leakage TVS diodes
  • Add S-R inverted latch as SMU only block
  • SMU top changes
    • Use TO-220 for pass FETs, which should allow much better heatsinking
    • Add blowy fuse to the USB input
    • Use buck converter for direct Vbus -> 3.3v digital
    • Add INA219 power sense on Vbus input and Vconv in
    • Run Vcontrol- off analog rail, with ferrite filter
    • Add ramp limiter
    • Add current limit trip sense direct to MCU
    • Use RC for OLED reset, because we're out of MCU pins
    • Add another IO expander for low-speed controls, because we're really out of MCU pins
    • Use SR with priority for converter OVP - should be more robust
    • Add I2S speaker
    • Simplify HDL using some new libraries
    • Add experimental block diagram grouping directive
  • Move SMU schematics into its folder
  • Rebaseline netlists
  • Delete calibration worksheet for old device

Libraries added:

  • Add AnalogCapacitor as a cap to be sprinkled on analog lines. Apparently this is a thing in analog design.
  • Add VoltageComparator, a comparator against a set (absolute) voltage.
  • Add base SeriesPowerFuse, for blowy fuses
  • Add SeriesResistor generator, that breaks a resistor into a series combination, to increase power and voltage ratings. Applies derating for worst-case tolerance stackup for individual voltage and power ratings.
  • Add summing amplifier ratio calculator for n-ported noninverting summing amplifier, with unit test. No block yet.
  • Add differential-RC filter
  • Add more KiCad symbols to analog signal chain parts: voltage dividers
  • Add Nano2 / 154 series fuseholder, with no modeling.
  • Add INA826 in-amp
  • Add SN74LVC2G02 dual NOR gate
  • Add TLP170AM low(er)-cost SSR
  • Add TO-220 FETs
  • Add Sn74lvc1g3157 analog switch, as the NLAS4157 is obsolete. Higher on-state resistance.
  • Add Ws2812c_2020 0808-size Neopixel LED, which is 3v3 logic compatible. Adds decoupling capacitors, which will be standard for Neopixels going forward.

Libraries modified:

  • Add mclkin for MCP3561, so we can overclock those ADCs
  • Add addr lsb selection on INA219
  • Expand Cf target tolerance for Lm2733, to give more flexibility in capacitance
  • Deprecate NLAS4157 (obsoleted part)
  • Change Mcp4728 to use the -T part, which is more common.
  • Shrink courtyards on non-connector footprints, both for optimization and to standardize to KiCad's library guidelines.

Fixes to JlcParts:

  • Fix require_basic_part in default refinements
  • Fix diode parsing
  • Expand diode footprint parsing rules

Core changes:

  • Add range-float subtraction (in addition to existing float-range subtraction). Range-range subtraction is still undefined because the tolerancing is non-intuitive.
  • Add Ratio (like kOhm, and nFarad, but for unitless), which cleans up a lot of cases, resolves Ratio unit type #391
  • Add as_voltage_source adapter for AnalogSource
  • Add KiCad instantiation to SeriesPowerResistor

@ducky64 ducky64 marked this pull request as ready for review November 27, 2025 06:17
@ducky64 ducky64 requested a review from Copilot November 27, 2025 06:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces SMU v3.1, a major revision of the Source Measure Unit (SMU) design with significant improvements to reliability, stability, and noise floor. The changes include substantial refactoring of core analog circuit blocks, addition of new protection mechanisms, and extensive library enhancements to support the new design.

Key Changes:

  • Refactored error amplifier to gated summing amplifier with improved gating control
  • Enhanced emitter follower with independent gate control for high/low sides
  • Added JFET current clamp protection circuit
  • Migrated pass FETs to TO-220 package for better thermal management
  • Added new power management and sensing capabilities

Reviewed changes

Copilot reviewed 52 out of 60 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
SourceMeasureRangingCell.kicad_sch Removed - schematic deleted as part of refactoring
SourceMeasureControl.kicad_sch Removed - schematic deleted as part of refactoring
ErrorAmplifier.kicad_sch Removed - replaced by gated summing amplifier
EmitterFollower.kicad_sch Removed - redesigned with new gate control
jlcpcb_pcba_postprocess.py Updated component rotation corrections and removed SMD e-cap listings
RotaryEncoder_Bourns_PEC11S.kicad_mod Updated footprint format to KiCad 8.0 with improved courtyards
RotaryEncoder_Alps_EC11J15-Switch.kicad_mod Updated footprint format to KiCad 8.0 with improved courtyards
JfetProtect.asc Added new LTSpice simulation for JFET protection circuit
Multimeter.svgpcb.js Added ADC mclkin net to netlist
StepperDriver_A4988.py Removed incorrect BrushedMotorDriver inheritance
JlcDiode.py Expanded diode package footprint mappings
Comments suppressed due to low confidence (1)

examples/jlcpcb_pcba_postprocess.py:1

  • Corrected spelling of 'inconsistent' - the word appears twice in the comment.
import argparse

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

'C3663690': 180, # TMP1075N
'C70285': 180, # SN74LVC1G74DCUR
'C2651906': 0, # DG468
'C2651906': -90, # DG468
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rotation for 'C2651906' (DG468) was changed from 0 to -90 degrees. Ensure this rotation change is validated against the actual PCB layout and component orientation to prevent assembly errors.

Suggested change
'C2651906': -90, # DG468
'C2651906': -90, # DG468 -- TODO: Validate this rotation (-90) against the actual PCB layout and component orientation to prevent assembly errors.

Copilot uses AI. Check for mistakes.
)
self.assign(self.lcsc_part, 'C38437')


Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of 'BrushedMotorDriver' from the base classes should be accompanied by verification that no code depends on A4988 being a BrushedMotorDriver. If this was incorrectly inherited, consider adding a comment explaining why it was removed.

Suggested change
# Note: A4988 is a stepper motor driver, not a brushed motor driver.
# It should NOT inherit from BrushedMotorDriver. If inheritance was removed,
# this is intentional to avoid conceptual confusion and incorrect type usage.

Copilot uses AI. Check for mistakes.
@ducky64 ducky64 merged commit c510ae1 into master Nov 27, 2025
21 checks passed
@ducky64 ducky64 deleted the smuv3.2 branch November 27, 2025 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ratio unit type SMUv3.1 changes

3 participants