Repository navigation
feat(firmware): add PCBA test environment and documentation #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jamro
wants to merge
7
commits into
main
Choose a base branch
from
feat/main-control-board-tester
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9,082
−2
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5a32640
feat(firmware): add PCBA test environment and documentation
jamro b88084a
fix(pcba): enhance key handling for Windows input in PCBA tester
jamro 13e1fe4
fix(web): implement acceptKeyEvent function for improved key handling…
jamro a0c2728
fix(pcba): handle OSError during port write to improve stability in P…
jamro 3cfb755
fix(pcb): clarify PCBA test documentation and enhance PCA failure han…
jamro 7aed4e7
feat(docs): introduce PCBA test session with dedicated environment an…
jamro 3f2de20
feat(docs): add servo tester PCB
jamro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ data/*.* | |
| data/*/ | ||
| artifacts/ | ||
|
|
||
| .venv | ||
|
|
||
| node_modules/ | ||
|
|
||
| *.bak | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # PCBA test | ||
|
|
||
| Check a produced main control board rev 3 with a golden ESP32-C3-Zero and one operator. The test is compatible with main control board rev 3. The product firmware cannot do this check. Power is the USB cable through the module. No servo supply. | ||
|
|
||
| The golden module stays with the tester. The ESP32 must already run the test firmware. How to get one is below. Do not ship that module on a board. | ||
|
|
||
| ## Get an ESP32 with the test firmware | ||
|
|
||
| The ESP32 must already run the test firmware. The product firmware cannot run this test. The script and the page do not flash the module. | ||
|
|
||
| Seat a Waveshare ESP32-C3-Zero on a main control board. Match the USB mark. Plug a USB-C data cable into the board socket, not the ESP32 socket. From the repo root: | ||
|
|
||
| ```bash | ||
| pio run -e pcba-test -t upload | ||
| ``` | ||
|
|
||
| When the test firmware is running, the onboard LED stays steady white. That lamp is not a board pass or fail. Before a module leaves the bench, flash the product image again. | ||
|
|
||
| The module LED stays steady white while the test image has power, including after a failed PCA probe, a verdict, and `q`. Steady white means the test image is running. It is not the board verdict. Judge the board by the ear on J1 and the plug lamps. Unplugging USB is what turns the module LED off. | ||
|
|
||
| ## Run the script | ||
|
|
||
| Python 3 and pyserial. From the repo root: | ||
|
|
||
| ```bash | ||
| python3 -m pip install pyserial | ||
| python3 scripts/pcba_test.py | ||
| ``` | ||
|
|
||
| The script prints a header, the web tester address, and a prepare card. It opens the board USB port. If that port is busy, the script says so and waits. Close the other program using the board. Keys match the page: Enter accepts a step, `n` rejects it. On SPEAKER, `+` is louder and `-` is quieter. After `RESULT`, unplug USB for the next board, or `q` to stop. | ||
|
|
||
| The other path is the web tester: [https://tinyengineer.dev/pcba_test](https://tinyengineer.dev/pcba_test). Chrome or Edge only. If the browser cannot open a serial port, the page says so and names `python3 scripts/pcba_test.py`. | ||
|
|
||
| USB-C data cable. Speaker on J1. Cards stay on screen. Act on the latest one. | ||
|
|
||
| ## Testing board | ||
|
|
||
| The testing board seats on one column at a time. The silk-side pin is yellow (SIG). The middle pin is red (5 V). Treat the square pad as GND. | ||
|
|
||
| During `servos`, signal is on all five servo outputs. Take the testing board and plug it into one column at a time: HEAD, NECK, ARM L, ARM R, and BODY. On every column, red stays on and yellow pulses. | ||
|
|
||
| ## What you see | ||
|
|
||
| The first card is prepare. Do that, then connect the board. The next card waits until the board is on USB, then waits for Enter before the first test step. | ||
|
|
||
| 1. Take the board. | ||
| 2. Plug in the ESP32. Match the USB mark on the board. | ||
| 3. Plug the speaker into the JST speaker port. | ||
| 4. Connect USB to the board. Use the board socket, not the ESP32. | ||
|
|
||
| Power-on is a short beep-beep, then silence. The next card is: | ||
|
|
||
| ``` | ||
| CONNECTED | ||
|
|
||
| The board is connected. | ||
|
|
||
| Enter = continue | ||
| ``` | ||
|
|
||
| Enter starts step `1/3`. `n` rejects a step. On a test step that is `Enter = good` and `n = bad`. On SPEAKER, `+` is louder and `-` is quieter. The card shows `+ = louder` and `- = quieter`, plus the level, from `Volume 1/10` through `Volume 10/10`. The tone keeps playing. | ||
|
|
||
| | Card | What you do | Look | | ||
| | --- | --- | --- | | ||
| | `1/3` `tone` | Speaker on the JST speaker port. `+` louder, `-` quieter. | A repeating tone until Enter or `n`. | | ||
| | `2/3` `servos` | Signal is on all five servo outputs. Plug the testing board into one column at a time: HEAD, NECK, ARM L, ARM R, and BODY. Check the LEDs on every column. | Red stays on and yellow pulses. | | ||
| | `3/3` OE OUTPUT ENABLE | Look at the testing board on one column. No need to test each servo column. | The red LED stays on. Only the yellow LED goes out. | | ||
|
|
||
| A column whose yellow LED does not pulse is a failure. Judge every column before Enter. | ||
|
|
||
| ## Keys | ||
|
|
||
| `n` shows `FAIL` and the menu `r`, `c`, `a`. | ||
|
|
||
| - `r` retries the step and drops that failure. On screen: `r = try this step again`. | ||
| - `c` keeps the failure and goes on. On screen: `c = keep the fail, go on`. | ||
| - `a` clears the board and returns to CONNECTED without unplugging. Enter starts the test again. On screen: `a = start this board over`. | ||
|
|
||
| After `RESULT PASS` or `RESULT FAIL`, the card says to unplug USB for the next board, or `q` to stop. The host stays open and attaches when the port returns. `q` prints `STOP`. `n` after the verdict does nothing. | ||
|
|
||
| `RESULT PASS` covers the speaker, the five servo columns, and output enable. It does not cover J2, J3, J4, the OLED, Wi-Fi, or a 2 A load. A fault in those can still be present. | ||
|
|
||
| No PCA answer prints `FAIL pca` and `RESULT FAIL pca`. The card says the PCA9685 did not answer and this board fails before the speaker test. There is no `r` / `c` / `a` for that failure. Unplug or `q`, same as any other verdict. | ||
|
|
||
| ## Dialogue | ||
|
|
||
| The wire under each card is a short token. All accepted: | ||
|
|
||
| ``` | ||
| STEP tone | ||
| STEP servos | ||
| STEP oe | ||
| RESULT PASS | ||
| ``` | ||
|
|
||
| `tone` and `servos` rejected with `c`: | ||
|
|
||
| ``` | ||
| FAIL tone | ||
| FAIL servos | ||
| RESULT FAIL tone servos | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.