Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,26 @@ jobs:
core/src/two_way.cpp core/src/timecode.cpp core/src/chirp.cpp core/src/detect.cpp core/src/g711.cpp \
-framework Foundation -o /tmp/avsync-calibration-math
/tmp/avsync-calibration-math

calibrator:
# Calibrator board: firmware build, host tests, KiCad ERC/DRC (hardware/calibrator).
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: packages
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y gcc-riscv64-unknown-elf picolibc-riscv64-unknown-elf make
- name: firmware (CH32X035, RISC-V)
working-directory: hardware/calibrator/firmware
run: |
make test
make CROSS=riscv64-unknown-elf- EXTRA_CFLAGS="-isystem /usr/lib/picolibc/riscv64-unknown-elf/include"
- name: ERC and DRC (KiCad 9.0.9)
working-directory: hardware/calibrator
run: |
docker run --rm -u "$(id -u):$(id -g)" -e HOME=/tmp -v "$PWD:/work" -w /work kicad/kicad:9.0.9 \
sh -c 'kicad-cli sch erc --severity-error --exit-code-violations -o /tmp/erc.rpt calibrator.kicad_sch &&
kicad-cli sch export netlist --format kicadsexpr -o /tmp/cal.net calibrator.kicad_sch &&
python3 scripts/check_netlist.py /tmp/cal.net &&
kicad-cli pcb drc --severity-error --exit-code-violations -o /tmp/drc.rpt calibrator.kicad_pcb'
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## Hardware (in development)

- Calibrator board v0.3 under `hardware/calibrator/` (signal contract in
`docs/calibrator.md`): KiCad 9 project, JLCPCB files, CH32X035 firmware with host
tests. USB-C powered by the phone (no battery, no cables supplied); the firmware never
enables USB, so a phone only supplies power, and it can be updated over USB-C with the
BOOT button and open tools (wchisp, chprog). Comparator with hysteresis for the sensor
pair, 1 nF sensor filters. AVsync logo on both sides (gold ENIG copper, white silk,
black mask), QR code to the project site. Board files CERN-OHL-P-2.0, firmware MIT.
A first batch of 10 is ordered; not tested yet.

## Mobile (not released yet)

- Test signal (iPhone and Android) no longer stops by itself about 5 minutes
Expand Down
2 changes: 1 addition & 1 deletion docs/calibration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The rig is an LED and a piezo on one microcontroller pin. Parts and firmware are
## With the calibrator

The calibrator is a small board with an LED, a buzzer and two light sensors
([signal contract](calibrator.md)). The phone powers it over a USB-C cable.
([signal contract](calibrator.md), [hardware](../hardware/calibrator/README.md)). The phone powers it over a USB-C cable.
In the app: **Settings → With calibrator** (iPhone and Android; the clap
calibration stays as it is). Three steps:

Expand Down
9 changes: 9 additions & 0 deletions hardware/calibrator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.rpt
*.dsn
*.ses
*-backups/
fp-info-cache
*.kicad_prl
fab/gerbers/
fab/calibrator-pos.csv
__pycache__/
3 changes: 3 additions & 0 deletions hardware/calibrator/3d/LED_reverse_1206.wrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#VRML V2.0 utf8
Transform { translation 0.0000 0.0000 0.0551 children [ Shape { appearance Appearance { material Material { diffuseColor 0.9 0.9 0.85 } } geometry Box { size 1.2598 0.6299 0.1102 } } ] }
Transform { translation 0.0000 0.0000 -0.1024 children [ Shape { appearance Appearance { material Material { diffuseColor 1 1 0.6 } } geometry Box { size 0.7323 0.5512 0.2047 } } ] }
3 changes: 3 additions & 0 deletions hardware/calibrator/3d/MLT-8530.wrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#VRML V2.0 utf8
Transform { translation 0.0000 0.0000 0.5906 children [ Shape { appearance Appearance { material Material { diffuseColor 0.08 0.08 0.08 } } geometry Box { size 3.3465 3.3465 1.1811 } } ] }
Transform { translation -1.7126 0.0000 0.5906 children [ Shape { appearance Appearance { material Material { diffuseColor 0.3 0.3 0.3 } } geometry Box { size 0.1181 0.4724 0.3937 } } ] }
31 changes: 31 additions & 0 deletions hardware/calibrator/3d/QSOP-28.wrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#VRML V2.0 utf8
Transform { translation 0.0000 0.0000 0.3346 children [ Shape { appearance Appearance { material Material { diffuseColor 0.12 0.12 0.12 } } geometry Box { size 1.5354 3.8976 0.5906 } } ] }
Transform { translation -0.4528 1.6929 0.6378 children [ Shape { appearance Appearance { material Material { diffuseColor 0.6 0.6 0.6 } } geometry Box { size 0.1969 0.1969 0.0197 } } ] }
Transform { translation -0.9646 1.6250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 1.6250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 1.3750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 1.3750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 1.1250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 1.1250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 0.8750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 0.8750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 0.6250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 0.6250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 0.3750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 0.3750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 0.1250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 0.1250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 -0.1250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 -0.1250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 -0.3750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 -0.3750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 -0.6250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 -0.6250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 -0.8750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 -0.8750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 -1.1250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 -1.1250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 -1.3750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 -1.3750 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation -0.9646 -1.6250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
Transform { translation 0.9646 -1.6250 0.0984 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4331 0.0984 0.0787 } } ] }
7 changes: 7 additions & 0 deletions hardware/calibrator/3d/TS-1187A.wrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#VRML V2.0 utf8
Transform { translation 0.0000 0.0000 0.2953 children [ Shape { appearance Appearance { material Material { diffuseColor 0.85 0.85 0.85 } } geometry Box { size 2.0079 2.0079 0.5906 } } ] }
Transform { translation 0.0000 0.0000 0.6299 children [ Shape { appearance Appearance { material Material { diffuseColor 0.15 0.15 0.15 } } geometry Box { size 1.1811 1.1811 0.1181 } } ] }
Transform { translation -1.1417 -0.7382 0.0394 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4724 0.2756 0.0787 } } ] }
Transform { translation -1.1417 0.7382 0.0394 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4724 0.2756 0.0787 } } ] }
Transform { translation 1.1417 -0.7382 0.0394 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4724 0.2756 0.0787 } } ] }
Transform { translation 1.1417 0.7382 0.0394 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4724 0.2756 0.0787 } } ] }
5 changes: 5 additions & 0 deletions hardware/calibrator/3d/VEMT2500X01_RGW.wrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#VRML V2.0 utf8
Transform { translation 0.0000 0.0000 0.3150 children [ Shape { appearance Appearance { material Material { diffuseColor 0.75 0.8 0.85 } } geometry Box { size 0.9055 0.9055 0.6299 } } ] }
Transform { translation 0.0000 0.0000 -0.2283 children [ Shape { appearance Appearance { material Material { diffuseColor 0.7 0.75 0.8 } } geometry Box { size 0.7087 0.7087 0.4606 } } ] }
Transform { translation -0.9843 0.0000 0.0394 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4724 0.1575 0.0787 } } ] }
Transform { translation 0.9843 0.0000 0.0394 children [ Shape { appearance Appearance { material Material { diffuseColor 0.8 0.8 0.8 } } geometry Box { size 0.4724 0.1575 0.0787 } } ] }
Loading
Loading