#import "lib/unify.typ": qty, qtyrange

= Electrical specifications <electrical-specifications>

== Signal standards <signal-standards>

=== Voltage range <voltage-range>

There are three types of signals used in the SAME format:

+ Bipolar signals, ranging from $qty(-10, "V")$ to $plus qty(10, "V")$.
+ Unipolar signals, ranging from $qty(0, "V")$ to $plus qty(10, "V")$.
+ Gate signals, which are either $qty(0, "V")$ (low) or $plus qty(10, "V")$
  (high). Gates represent momentary states, such as a computation error (e.g.
  input out of bound) or a logic result (a truthful value being represented as a
  high gate). By convention, and to ensure compatibility with other formats,
  gate inputs must have a threshold of $plus qty(2.5, "V")$, determined either
  at the rising edge or at voltage level (the behavior must be specified in
  individual module documentation).

==== Banana format <banana-format>

All IO, except when interfacing with other formats, is done on $qty(4, "mm")$
banana jacks. Banana jacks are stackable and allow passive signal distribution
without the need of dedicated modules. They also allow, when short protection is
strictly enforced (which is the case of SAME format) passive averaging of
outputs: When two short-protected outputs are stacked, the equal output
impedances form a voltage divider, producing the arithmetic mean.

They are standard on a lot of lab equipment such as digital multimeters.
Their standard spacing ($qty(0.75, "inch")$ grid) allows the use of standard
shorting bars. Furthermore, they are sturdy and reliable.

However, being unshielded and ungrounded, banana jacks act as RF antennas. This
effectively limits the SNR of the SAME format to $qty(95, "dB")$. This
$qty(95, "dB")$ limit is above the Metrologic tier target of $qty(90, "dB")$, so
banana jacks do not constrain the achievable SNR.

Users should prefer high quality cables (Pomona or equivalent),
silicone-wrapped, and use the shortest cable length necessary.

Note that the noise floor of the system can be improved beyond the standard
limitations of banana jacks by using shielded cables with single-ended
grounding. However, to maintain compatibility and accessibility, modules must
not require such cables for normal operation.

==== Inputs requirements <inputs-requirements>

All inputs utilize white jacks. They must accept bipolar voltages across the
full $plus.minus qty(10, "V")$ range and the full DC to #qty(20, "kHz")
bandwidth, with precision conforming to the module's declared tier. All inputs
must have an impedance $gt.eq qty(1, "mega ohm")$ (Hi-Z). Inputs must be
protected against RF-induced noise received via the patch cable. RF signals
above 1MHz must be attenuated by at least 40dB at the input.

===== Out-of-domain handling strategies <out-of-domain-handling-strategies>

While all inputs must accept bipolar signals, some mathematical functions do not
accept the full range (e.g. logarithm, division, etc.). In that case, the module
must include an out-of-domain handling strategy, and document it:

#include "tables/out-of-domain-handling-strategies.typ"

When such a case occurs, an error gate must be fired on a dedicated error jack
output. On multiple channels modules, there should be one such error gate per
channel.

==== Output requirements <output-requirements>

Outputs can be either bipolar signals (light blue jack), unipolar signals (light
yellow jack) or gate signals (red jack).

All outputs must have an impedance $lt.eq qty(10, "ohm")$. This ensures that any
output can be patched into any number of inputs without signal degradation or
loss. Outputs must be short-circuit protected, with fault current limited to
$lt.eq qty(10, "mA")$.

===== Loading error <loading-error>

With $Z_"out" lt.eq qty(10, "ohm")$ and $Z_"in" gt.eq qty(1, "mega ohm")$, the
worst-case single-connection loading error is 10ppm, compatible with Metrologic
tier precision. When stacking multiple inputs on a single output via banana
jacks, the parallel input impedance must be considered:

#include "tables/loading-error.typ"

Module designers should document expected fan-out in module specifications. For
typical patches ($lt.eq 10$ connections per output), loading error remains a
small fraction of the Industrial tier budget. For Metrologic patches with a
fan-out $gt 10$, the use of a dedicated buffer module should solve the loading
error issue.

===== Error gates <error-gates>

Modules whose mathematical function can produce out-of-domain or internal error
conditions must provide error gates. Modules that cannot produce such conditions
(e.g., a simple attenuator) are exempt.

Error gates are also considered valid signals and should use $qty(4, "mm")$ red
banana jacks. Modules designers should strive to have one error gate output per
error type per channel. Space constraints may force the module designer to
aggregate multiple error gates (OR operator). In that case, out-of-domain and
internal errors must never be aggregated.

#include "tables/examples-of-error-gates.typ"

=== Bandwidth <bandwidth>

All signal inputs on a SAME system must accept and give mathematically correct
results for a rate of change ranging from DC ($qty(0, "Hz")$) to at least
$qty(20, "kHz")$). Precision specifications apply within this bandwidth. Are
excluded from this requirement only signals coming from the outside, through
interface modules. In that case, the signal must respect the specifications of
the incoming signal format.

==== Signals interpretation <signals-interpretation>

All signals are voltages. Any signal can be used in place of any other signal.
Interpretation of the function of a signal is left to individual module
implementation and computation context (a control voltage in one computation can
be a logic result in another, or a function variable, etc.).

== Precision tiers <precision-tiers>

=== General specification <general-specification>

We define three precision tiers, with varying precision requirements. Those
three precision tiers must target the same signal range of DC to
$qty(20, "kHz")$ as specified in the signal standards.

A change of precision tier must not induce a change of PCB: if needed, the PCB
designs should include multiple footprints (notably for various size capacitors)
or jumpers (if a specific sub circuit can be disabled for a lower precision
tier).

All SAME-compliant designs must at least provide a BOM for the metrologic
precision tier.

==== Precision measurements conditions <precision-measurements-conditions>

All precision metrics are measured after one hour of warm-up from a cold start
at ambient temperature. This allows the oven-compensated components to warm-up,
temperature gradients to stabilize, and servo loops to settle.

===== Temperature <temperature>

Measurements are made with an ambient temperature range of
$qtyrange(15, 30, "dC")$, with an hourly variation of
maximum $plus.minus qty(2, "dC")$. Temperature is the main source of drift for
components. While designs should compensate for reasonable temperature
variations, they should expect normal temperature operation conditions,
achievable with a standard HVAC.

===== Humidity <humidity>

Measurements are made within a relative humidity range of
$qtyrange(30, 70, "percent") upright("RH")$, with an hourly
variation of maximum $plus.minus qty(5, "percent") upright("RH")$.

High humidity can cause parasitic leakage paths (nanoamps matter at high-Z
nodes), dielectric changes affecting precision capacitors, and long-term
corrosion. Low humidity can cause electro-static discharges (ESD) risk during
handling and static charge accumulation.

These requirements ensure that those risks are mostly avoided. They should be
met with easy access humidity control measures and tools.

===== Atmospheric pressure <atmospheric-pressure>

Measurements are made within an atmospheric pressure range from
$qtyrange(800, 1100, "hPa")$, with a daily variation of
maximum $plus.minus qty(50, "hPa")$.

A low atmospheric pressure impacts convection and temperature regulation. It
also reduces the dielectric strength of the air, inducing a higher risk of
arcing and breakdown.

Some types of capacitors, relays and switches are sensitive to atmospheric
pressure. The recommended pressure range should allow operation from sea level
to $qty(2000, "m")$ altitude, under normal atmospheric conditions.

===== Electro-magnetic environment <electro-magnetic-environment>

RF field immunity must follow EN 61000-4-3 specification (
$qty(3, "volt per meter")$, $qtyrange(80, 1000, "MHz")$). The magnetic field
should be below $qty(1, "ampere per meter") upright("DC")$, and below
$qty(0.3, "ampere per meter") upright("AC")$ (power frequency). SAME equipment should be
at least $qty(1, "m")$ away from switching equipment such as motors, welders
etc.

While SAME provides strong internal shielding, external electro-magnetic
interference (EMI) beyond specification may degrade the SNR.

===== Air quality <air-quality>

SAME equipment should be operated indoors, with clean dust filters (recommended
monthly cleaning). Corrosive gases such as $H_2 S$, $"Cl"_2$, $S O_2$, etc,
conductive particles and salt spray (coastal environment) are not permitted.

Dust reduces cooling efficiency and can introduce leakage paths. Corrosive gases
degrade the components and contacts. Conductive particles can create short
circuits and leakages. Salt spray is corrosive.

Those requirements should be met with indoor operation in air-filtered rooms.

===== Mechanical environment <mechanical-environment>

SAME equipment should be operated on stable surfaces, free from significant
vibration. Vibration can induce microphonic effects in capacitors and
connectors, affecting precision at high-impedance nodes.

Operating vibration should be below $qty(0.5, "g")$ ($qtyrange(5, 500, "Hz")$).
Shock should be below $qty(5, "g")$ ($qty(11, "ms")$ pulse).

These requirements should be met in normal laboratory or studio environments.

===== Lighting <lighting>

Direct sunlight on the chassis should be avoided during precision operation.
Sunlight causes localized heating and thermal gradients. Some precision
semiconductors are photosensitive.

Normal indoor lighting is acceptable. Modules should not be operated with
cassettes removed in bright light.

===== Ionizing radiation <ionizing-radiation>

SAME is designed for normal background radiation environments (below
$qty(1, "micro sievert per hour")$).

Operation near significant ionizing radiation sources such as medical imaging
equipment, nuclear facilities, or particle accelerators is not recommended
without appropriate shielding. Ionizing radiation can increase semiconductor
leakage currents and cause single-event effects.

At altitudes approaching $qty(2000, "m")$, cosmic ray flux increases
approximately $3 times$ compared to sea level. This is however unlikely to
significantly impact analog precision.

SAME is not radiation-hardened. Applications requiring radiation tolerance
should seek specialized equipment.

====== Radioactive source modules <radioactive-source-modules>

Some SAME modules (such as true random voltage generators based on radioactive
decay) may contain low-activity sealed radioactive sources.

These modules:
- Must comply with local regulations regarding exempt-quantity radioactive
  materials. The SAME specification does not mandate specific isotopes or
  activities;
- Must provide adequate shielding to not affect adjacent modules;
- Must be clearly labeled with radiation symbol and source information;
- Must include handling and disposal instructions.

The presence of a radioactive source module does not affect the precision
specifications of other modules in the system, provided shielding requirements
are met.

===== Summary <precision-measurements-conditions-summary>

#include "tables/precision-measurements-conditions-summary.typ"

Note that electrical supply requirements will be discussed in
@power-distribution.

=== Educational tier <educational-tier>

This tier aims for a precision of $qty(0.1, "percent")$ ($qty(1000, "ppm")$),
and a SNR of $qty(70, "dB")$. This tier is intended for lowering the barrier of
entry by reducing the components costs and soldering difficulty. It is suitable
for teaching on circuit topologies and general analog computer patching. At this
level of precision, results are valid within $plus.minus qty(10, "mV")$.

The maximum drift rate should be inferior or equal to $qty(60, "ppm per hour")$.
We recommend calibration verification before each session.

=== Industrial tier <industrial-tier>

This tier aims for a precision of $qty(0.01, "percent")$ ($qty(100, "ppm")$),
and a SNR of $qty(80, "dB")$. This tier is intended for research, serious
experimentation, and applications requiring repeatable results. It is suitable
for control systems modeling, audio-rate computation, and scientific data
acquisition. At this level of precision, results are valid within
$plus.minus qty(1, "mV")$.

The maximum drift rate should be inferior or equal to
$qty(0.6, "ppm per hour")$. We recommend daily calibration verification.

=== Metrologic tier <metrologic-tier>

This tier aims for a precision of $qty(0.001, "percent")$ ($qty(10, "ppm")$),
and a SNR of $qty(90, "dB")$. This tier is intended for precision measurement,
long-duration computation, and applications requiring traceable accuracy. It is
suitable for metrology, reference instrumentation, and extended continuous
operation. At this level of precision, results are valid within
$plus.minus qty(0.1, "mV")$.

The maximum drift rate should be inferior or equal to
$qty(0.014, "ppm per hour")$. We recommend daily calibration verification.

=== Summary <precision-tiers-summary>

#include "tables/precision-tiers-summary.typ"

==== Drift rate derivation <drift-rate-derivation>

The drift rates are calculated such that total accumulated drift over the
drift-free computation period consumes approximately $qty(100, "percent")$ of
the precision budget.

#include "tables/drift-rate-derivation.typ"

== Power distribution <power-distribution>

=== Precision tiers <power-distribution-precision-tiers>

We believe that a single system should be able to aggregate modules from
different precision tiers. Power distribution is not a soldering build
accessible to the average builder, due to the integration with mains voltage
(shock risk). For this reason, SAME only admits one set of constraints for the
power distribution, targeting metrologic tier.

=== Provided power <provided-power>

==== Power rails <power-rails>

Power distribution must provide the following voltages:
- $plus.minus qty(15.00, "V")$: Used to power op-amps.
- $plus.minus qty(10.0000, "V")$ Force + Sense (Kelvin Connection): Reference
  Voltages used to ensure $qty(10, "ppm")$ precision.
- $qty(10, "MHz")$ Master Oscillator: A high-stability, low-phase-noise sine
  wave reference for time-domain computations.
- Stagger ($0$ or $plus qty(15, "V")$, indicates port parity): Used for
  time-domain computation cores frequency stagger relative to the master
  oscillator’s frequency.
- Analog Ground (AGND): Analog signals return path.
- Digital Ground (DGND): Digital signals return path.
- $plus.minus qty(5.0, "V")$ Digital ($"VD"$): Used to power CMOS and Timers.
- Chassis Earth: For high voltage protection and EMF shielding.

Note that in this list we use the significant figure convention systematically
to indicate precision requirements.

==== Power budget <power-budget>

For 8 modules, the total power budget per $plus.minus qty(15.00, "V")$ rail is
$qty(1.5, "A")$. This permits the use of easily available power supplies for
rack chassis, while giving enough power for compute modules. The total power
budget per $plus.minus qty(5, "VD")$ rail is $qty(800, "mA")$.

For each module, this means: $approx qty(185, "mA")$ on the
$plus.minus qty(15.00, "V")$, and $qty(100, "mA")$ on the
$plus.minus qty(5, "VD")$ rails.

==== PWAM frequency staggering <pwam-frequency-staggering>

To limit drift and increase precision in multipliers and time-domain functions,
the system utilizes a global timebase.

/ Master Oscillator: All modules performing time-domain operations (PWAM,
  integration timing, etc.) must accept a $qty(10, "MHz"), qty(1, "Vpp")$ (into
  $qty(50, "ohm")$) sine wave via the rear BNC connector. Modules operating
  purely in the continuous voltage domain (e.g., standard summers, log amps) may
  ignore it.
/ Staggering: Neighboring modules using PWAM should not operate at identical
  switching phases/frequencies to prevent intermodulation. The Stagger rail on
  the DB-25 connector determines the derivation of the local carrier from the
  Master Oscillator.
  - Modules receiving $qty(0, "V")$ from the Stagger rail must lock their
    carrier frequency to exactly $qty(500, "kHz")$ ($"Master"/20$) with
    $qty(0, "degree")$ phase shift.
  - Modules receiving $plus qty(15, "V")$ from the Stagger rail must lock their
    carrier frequency to $qty(500, "kHz")$ ($"Master"/20$) with a
    $qty(90, "degree")$ phase shift, that should be derived via quadrature
    division referenced to the $qty(10, "MHz")$ Master.

==== Cleanliness requirements <cleanliness-requirements>

===== $plus.minus qty(15.00, "V")$ analog supply requirements
<analog-supply-requirements>

At the module connector, the $plus.minus qty(15.00, "V")$ rails shall maintain
an initial accuracy within $plus.minus qty(7.5, "mV")$
($plus.minus qty(0.05, "percent")$) at $qty(25, "dC")$. Line regulation shall be
better than $plus.minus qty(1.5, "mV")$ ($qty(0.01, "percent")$) for a
$plus.minus qty(10, "percent")$ input voltage variation. Load regulation shall
be better than $plus.minus qty(3.0, "mV")$ ($qty(0.02, "percent")$) over the
full load range ($qtyrange(10, 100, "percent")$). Output
voltage ripple and noise shall not exceed $qty(500, "uVpp")$ over a
$qty(20, "MHz")$ bandwidth.

===== $plus.minus qty(5.0, "VD")$ digital supply requirements
<digital-supply-requirements>

The $plus.minus qty(5.0, "VD")$ rails shall maintain an initial accuracy within
$qty(25, "mV")$ ($plus.minus qty(0.5, "percent")$) at $qty(25, "dC")$. Line
regulation shall be better than $plus.minus qty(5, "mV")$
($qty(0.1, "percent")$) for a $plus.minus qty(10, "percent")$ input voltage
variation. Load regulation shall be better than $plus.minus qty(10, "mV")$
($qty(0.2, "percent")$) over the full load range. Output voltage ripple and
noise shall not exceed $qty(5, "mVpp")$ over a $qty(20, "MHz")$ bandwidth.

===== $plus.minus qty(10.0000, "V")$ reference requirements
<reference-requirements>

The $plus.minus qty(10.0000, "V")$ reference rails shall maintain an initial
accuracy within $plus.minus qty(20, "uV")$ ($plus.minus qty(2, "ppm")$) at
$qty(25, "dC")$. Line regulation shall be strictly less than
$qty(2, "micro volt per volt")$ ($qty(0.2, "ppm per volt")$). Load regulation
shall be strictly less than $qty(5, "micro volt per milli ampere")$
($qty(0.5, "ppm per milli ampere")$). The temperature coefficient must be less
than $qty(0.5, "ppm per celsius")$, and low-frequency noise
($qtyrange(0.1, 10, "Hz")$) shall not exceed
$qty(2, "uVpp")$.

===== Master oscillator requirements <master-oscillator-requirements>

The $qty(10, "MHz")$ Master Oscillator shall demonstrate frequency stability
inferior or equal to $qty(10, "ppb")$ (parts per billion) over the full
operating temperature range. Phase noise shall be inferior or equal to
$qty(-140, "dBc per Hz")$ at a $qty(1, "kHz")$ offset.

===== Grounding rules <grounding-rules>

- Analog returns to AGND only.
- Digital returns to DGND only.
- Modules shall not bridge AGND and DGND. Modules containing both analog and
  digital circuitry must maintain internal ground separation and connect each
  to the appropriate backplane ground.
- Chassis Earth is only used for chassis grounding, EMF shielding and high
  voltage protection.
- The power distribution board should provide state of the art ground management
  (e.g. star point).

=== Power distribution calibration <power-distribution-calibration>

At power distribution board level, we do not have access to a source of truth
for automatic calibration. We must accept manual, repeatable calibration
methods. This method should be insensitive to drift (in opposition to trimmers
that are notoriously unstable).

To ensure high precision without drift as specified in the precision tiers
section, the $plus.minus qty(10.0000, "V")$ must be calibrated. The only
accepted method of calibration is Drift-Free, discrete steps, repeatable
topologies, for instance: through two switches (coarse, fine) into a resistor
ladder (R2R) digital-to-analog converter (DAC). The switches must be accessible
on the chassis front panel, next to a $plus qty(10.0000, "V")$ reference, a
$qty(-10.0000, "V")$ reference and an AGND jack (respectively yellow, blue and
black).

The other power rails may also be calibrated, through dip-switches and R2R DACs
on the power distribution board PCB.

==== Standby switch <standby-switch>

Since the reference voltages depend on an oven stabilized buried zener diode and
an ovenized crystal oscillator, the front panel must provide a standby switch,
to shut down the unit while maintaining the diode at temperature. The standby
mode power consumption should not exceed 200mA.

#include "listings/example-calibration-log.typ"

=== Backplane connector <backplane-connector>

Power is distributed from the power distribution board to modules with a
DB-25 cable: female port panel mounted on module cassette, and PCB mounted on
power distribution board, a short DB-25 male to male cable is used to connect
the cassette to the power distribution board. D-sub connectors are ubiquitous,
sturdy and shielded.

#include "diagrams/backplane-connector-diagram.typ"

#include "tables/backplane-connector.typ"

The $qty(10, "MHz")$ Master Oscillator is distributed via a dedicated rear-panel
BNC connector, not through the DB-25 backplane connector.
