feat: add e-foc-harware support - #205
Conversation
…PlatformFactory Replace the array-based Leds() with three discrete GPIO accessors (OperationalLed, WarningLed, FailureLed), add BoardId() for 3-bit active-low CAN node identification (PK0-2 on TM4C1294XL), and PowerStatus() for the LM5164 open-drain PG signal (PC6). Add e-foc-hardware motor board definition and reference submodule. EK-TM4C123GXL gains capability flags (hasBoardIdPins=false, hasPowerStatusPin=false) and placeholder LED pins that avoid conflicts with CAN TX (PF3) and hall sensor inputs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
EK-TM4C1294XL now targets E-FOC-HARDWARE as its primary motor board. EK-TM4C1294XL-FRDM added for builds against the FRDM-MC-LVPMSM shield. Removes the intermediate EK-TM4C1294XL-efoc preset. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 8 | 0 | 0 | 0.24s | |
| ✅ CPP | clang-format | 232 | 11 | 0 | 0 | 2.41s |
| ✅ DOCKERFILE | hadolint | 1 | 0 | 0 | 0.1s | |
| ✅ JSON | jsonlint | 14 | 0 | 0 | 0.37s | |
| ✅ JSON | prettier | 14 | 9 | 0 | 0 | 0.86s |
| markdownlint | 36 | 4 | 105 | 0 | 3.18s | |
| ✅ MARKDOWN | markdown-table-formatter | 36 | 11 | 0 | 0 | 0.52s |
| ✅ REPOSITORY | betterleaks | yes | no | no | 1.2s | |
| ✅ REPOSITORY | checkov | yes | no | no | 29.58s | |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.07s | |
| ✅ REPOSITORY | grype | yes | no | no | 68.22s | |
| ✅ REPOSITORY | ls-lint | yes | no | no | 0.01s | |
| ✅ REPOSITORY | osv-scanner | yes | no | no | 11.24s | |
| ✅ REPOSITORY | secretlint | yes | no | no | 3.65s | |
| ✅ REPOSITORY | syft | yes | no | no | 2.2s | |
| ✅ REPOSITORY | trivy | yes | no | no | 16.89s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.27s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 10.6s | |
| lychee | 139 | 4 | 0 | 1.07s | ||
| ✅ YAML | prettier | 22 | 4 | 0 | 0 | 1.03s |
| ✅ YAML | v8r | 22 | 0 | 0 | 7.99s | |
| ✅ YAML | yamllint | 22 | 0 | 0 | 1.0s |
Detailed Issues
⚠️ SPELL / lychee - 4 errors
📝 Summary
---------------------
🔍 Total...........81
🔗 Unique..........43
✅ Successful......63
⏳ Timeouts.........0
🔀 Redirected.......2
👻 Excluded........14
❓ Unknown..........0
🚫 Errors...........4
⛔ Unsupported......4
Errors in .github/agents/orchestrator.agent.md
[ERROR] file://numerical-toolbox/.github/copilot-instructions.md (at 57:33) | File not found. Check if file exists and path is correct
Errors in .github/workflows/static-analysis.yml
[403] https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$ (at 39:21) | Rejected status code: 403 Forbidden
Errors in README.md
[ERROR] file://infra/embedded-infra-lib/README.md (at 234:3) | File not found. Check if file exists and path is correct
[ERROR] file://infra/numerical-toolbox/README.md (at 235:3) | File not found. Check if file exists and path is correct
Hint: Followed 2 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`
⚠️ MARKDOWN / markdownlint - 105 errors
.claude/agents/executor.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the executor agent for..."]
.claude/agents/orchestrator.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the orchestrator agent..."]
.claude/agents/planner.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the planner agent for ..."]
.claude/agents/reviewer.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the reviewer agent for..."]
.claude/agents/reviewer.md:27 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
.github/agents/executor.agent.md:11 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the executor agent for..."]
.github/agents/orchestrator.agent.md:18 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the orchestrator agent..."]
.github/agents/orchestrator.agent.md:26:401 error MD013/line-length Line length [Expected: 400; Actual: 482]
.github/agents/planner.agent.md:11 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the planner agent for ..."]
.github/agents/planner.agent.md:102:401 error MD013/line-length Line length [Expected: 400; Actual: 441]
.github/agents/planner.agent.md:134:401 error MD013/line-length Line length [Expected: 400; Actual: 418]
.github/agents/reviewer.agent.md:14 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "You are the reviewer agent for..."]
.github/instructions/foc-cpp.instructions.md:82:401 error MD013/line-length Line length [Expected: 400; Actual: 455]
.github/prompts/orchestrate.prompt.md:8:401 error MD013/line-length Line length [Expected: 400; Actual: 559]
.github/prompts/orchestrate.prompt.md:8 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "Analyze the following task for..."]
documentation/architecture/system.md:137:401 error MD013/line-length Line length [Expected: 400; Actual: 500]
documentation/architecture/system.md:139:401 error MD013/line-length Line length [Expected: 400; Actual: 500]
documentation/architecture/system.md:140:401 error MD013/line-length Line length [Expected: 400; Actual: 500]
documentation/architecture/system.md:141:401 error MD013/line-length Line length [Expected: 400; Actual: 500]
documentation/architecture/system.md:142:401 error MD013/line-length Line length [Expected: 400; Actual: 500]
documentation/architecture/system.md:143:401 error MD013/line-length Line length [Expected: 400; Actual: 500]
documentation/architecture/system.md:144:401 error MD013/line-length Line length [Expected: 400; Actual: 500]
documentation/architecture/system.md:160:208 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:161:208 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:162:208 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:184:401 error MD013/line-length Line length [Expected: 400; Actual: 539]
documentation/architecture/system.md:213:19 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:213:57 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:214:19 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:214:57 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:236:266 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:334:401 error MD013/line-length Line length [Expected: 400; Actual: 431]
documentation/architecture/system.md:336:401 error MD013/line-length Line length [Expected: 400; Actual: 415]
documentation/architecture/system.md:336:129 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:336:415 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:337:401 error MD013/line-length Line length [Expected: 400; Actual: 431]
documentation/architecture/system.md:338:401 error MD013/line-length Line length [Expected: 400; Actual: 431]
documentation/architecture/system.md:350:401 error MD013/line-length Line length [Expected: 400; Actual: 540]
documentation/architecture/system.md:402:54 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:402:93 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/architecture/system.md:402:215 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/error-handling.md:44:401 error MD013/line-length Line length [Expected: 400; Actual: 561]
documentation/design/error-handling.md:58:401 error MD013/line-length Line length [Expected: 400; Actual: 505]
documentation/design/foc-position.md:80 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/foc-position.md:219:224 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/foc-speed.md:82 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/foc-speed.md:86:401 error MD013/line-length Line length [Expected: 400; Actual: 430]
documentation/design/foc-speed.md:129:32 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/foc-speed.md:129:96 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/foc-speed.md:129:286 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/foc-speed.md:130:32 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/foc-speed.md:130:96 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/foc-speed.md:130:265 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/foc-speed.md:208:153 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/foc-torque.md:157:149 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/foc-transforms.md:58 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/foc-transforms.md:79 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/foc-transforms.md:88 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/foc-transforms.md:99 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/integration-testing.md:49:401 error MD013/line-length Line length [Expected: 400; Actual: 536]
documentation/design/service-electrical-ident.md:67 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-electrical-ident.md:78 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-electrical-ident.md:86 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-electrical-ident.md:95:401 error MD013/line-length Line length [Expected: 400; Actual: 563]
documentation/design/service-electrical-ident.md:103:401 error MD013/line-length Line length [Expected: 400; Actual: 476]
documentation/design/service-electrical-ident.md:130:401 error MD013/line-length Line length [Expected: 400; Actual: 441]
documentation/design/service-electrical-ident.md:132:401 error MD013/line-length Line length [Expected: 400; Actual: 704]
documentation/design/service-electrical-ident.md:146 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-electrical-ident.md:196:401 error MD013/line-length Line length [Expected: 400; Actual: 657]
documentation/design/service-mechanical-ident.md:53 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-mechanical-ident.md:72 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-mechanical-ident.md:84 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-mechanical-ident.md:92 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-mechanical-ident.md:102 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-mechanical-ident.md:108 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-mechanical-ident.md:114 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-mechanical-ident.md:120 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-mechanical-ident.md:126 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-mechanical-ident.md:216:401 error MD013/line-length Line length [Expected: 400; Actual: 500]
documentation/design/state-machine.md:327:226 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/state-machine.md:328:276 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/state-machine.md:343:43 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/state-machine.md:343:127 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/state-machine.md:343:241 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/state-machine.md:344:46 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/state-machine.md:344:134 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/state-machine.md:344:215 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/templates/requirements.md:8 error MD025/single-title/single-h1 Multiple top-level headings in the same document [Context: "Requirements Specification"]
documentation/theory/alignment.md:200 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/theory/alignment.md:212 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/theory/foc.md:369 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/theory/foc.md:393:80 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/theory/friction-inertia-estimation.md:237 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/theory/resistance-inductance-estimation.md:46:69 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/theory/resistance-inductance-estimation.md:46:79 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/theory/resistance-inductance-estimation.md:217 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/theory/resistance-inductance-estimation.md:258 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/theory/resistance-inductance-estimation.md:281:86 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/theory/resistance-inductance-estimation.md:282:86 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/theory/resistance-inductance-estimation.md:284:86 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/theory/resistance-inductance-estimation.md:286:26 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/theory/resistance-inductance-estimation.md:287:86 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
README.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "[
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@9.6.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_LS_LINT,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

Show us your support by starring ⭐ the repository
There was a problem hiding this comment.
Pull request overview
This PR updates the platform abstraction layer (PAL) to support richer board integration by replacing the prior LED array accessor with three explicit status LED GPIO accessors, and by adding optional board-identity and power-good signals. It also introduces an E-FOC-HARDWARE motor board definition and wiring via CMake presets/submodule.
Changes:
- Replace
Leds()withOperationalLed(),WarningLed(), andFailureLed()across targets, platform implementations, and mocks. - Add PAL accessors
BoardId() const(3-bit active-low) andPowerStatus() const(power-good input), implemented for TI and stubbed for Host/ST. - Add
E-FOC-HARDWAREmotor board characteristics + build preset and register theinfra/e-foc-hardwaresubmodule.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| targets/sync_foc_sensored/main/instantiations/Logic.cpp | Switch debug LED wiring to OperationalLed() |
| targets/hardware_test/instantiations/Logic.cpp | Switch debug LED wiring to OperationalLed() |
| core/platform_abstraction/PlatformFactory.hpp | PAL API change: three LED accessors + BoardId() + PowerStatus() |
| documentation/architecture/system.md | Document new PAL LEDs / board ID / power status responsibilities |
| targets/platform_implementations/ti/implementation/PlatformFactoryImpl.hpp | Add new PAL method overrides (TI) |
| targets/platform_implementations/ti/implementation/PlatformFactoryImpl.cpp | Implement new LED/BoardId/PowerStatus accessors (TI) |
| targets/platform_implementations/ti/EK-TM4C1294XL/PinsAndPeripherals.hpp | Define discrete LED pins + board-id pins + power-good pin + capability flags |
| targets/platform_implementations/ti/EK-TM4C123GXL/PinsAndPeripherals.hpp | Define discrete LED pins + capability flags disabling board-id/power-good |
| targets/platform_implementations/st/implementation/PlatformFactoryImpl.hpp | Add new PAL method overrides (ST) |
| targets/platform_implementations/st/implementation/PlatformFactoryImpl.cpp | Stub new LED/BoardId/PowerStatus accessors (ST) |
| targets/platform_implementations/host/implementation/PlatformFactoryImpl.hpp | Add new PAL method overrides (Host) |
| targets/platform_implementations/host/implementation/PlatformFactoryImpl.cpp | Stub new LED/BoardId/PowerStatus accessors (Host) |
| targets/hardware_test/components/test/TestTerminal.cpp | Update PlatformFactory mock to new PAL API |
| integration_tests/software_in_the_loop/support/PlatformFactoryMock.hpp | Update PlatformFactory mock to new PAL API |
| targets/platform_implementations/motor_boards/E-FOC-HARDWARE/CMakeLists.txt | Add new motor board interface target + header define |
| targets/platform_implementations/motor_boards/E-FOC-HARDWARE/BoardCharacteristics.hpp | Add E-FOC-HARDWARE analog scaling + thresholds |
| CMakePresets.json | Add EK-TM4C1294XL + E-FOC-HARDWARE build presets |
| .gitmodules | Add infra/e-foc-hardware submodule |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
🏎️ Cycle Analysis ResultsWorst case (position) | EK-TM4C1294XLCPU Utilization Budget
Click to expand full detailsCycle Estimation ReportTarget: Executive Summary
CPU Utilization Budget
Path Breakdown
Per-Function Detail — FOC Inner Loop (Calculate)
Instruction MixOptimization Quality Indicators
|
📦 Memory budget (multi-mode)Unified binary📦 Memory budgetEK-TM4C1294XL (M4, RelWithDebInfo) — flash 105.85 KiB · static RAM 25.64 KiB · stack 0 B · heap 0 B
Top symbolsShow top symbols
|
TM4C123 silicon lacks PWM FLTSRC1 digital comparator routing, making hardware fault protection impossible on that board. EK-TM4C1294XL is the only supported TI target going forward. - Delete EK-TM4C123GXL platform implementation - Collapse all hasFaultComparators branches in PlatformFactoryImpl to the async (fault-comparator) path unconditionally - Remove SyncPwmConfig, syncPwm optional, and related includes - Remove syncPwmPhases stubs and hasFaultComparators from EK-TM4C1294XL - Remove EK-TM4C123GXL from CMake presets and CI build matrices - Update CLAUDE.md and architecture doc to reflect single supported board Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Host/ST: return distinct operationalPin/warningPin/failurePin stubs from OperationalLed(), WarningLed(), FailureLed() so callers cannot accidentally observe interference between the three signals - TI: restore hardware overvoltage protection via DCMP1 — step 4 (powerSupplyVoltage) is redirected to digital comparator 1 which feeds PWM FLTSRC1 bit 1 and tristates all motor PWM outputs instantly when the overvoltage threshold is exceeded; also expand currentPhaseAnalogPins array from 4 to 5 elements accordingly - TI: restore SynchronousQuadratureEncoder.hpp include dropped in c9485ae (refactor), fixing EK-TM4C1294XL build failure - scripts/install-caveman.sh: guard Node.js /usr/local extraction with an early root check so non-root users get a clear error
…ent ADC
Overvoltage is monitored by AdcForPowerSupplyMeasurementImpl (synchronous
ADC1, sequencer 0) via Pins::powerSupplyVoltage. Adding that pin as step 4
of the phase-current ADC sequencer with a digital comparator was wrong:
- DCMP1 (Peripheral::OvervoltageComparatorIndex) was not needed there
- It caused Pins::powerSupplyVoltage to be passed to hal::tiva::AnalogPin
twice (also in powerSupplyAnalogPins), configuring the GPIO twice
Revert digitalComparators and currentPhaseAnalogPins to 4 entries each
(steps 0–2: phase currents to FIFO; step 3: currentTotal → DCMP0 overcurrent).
GDB 17.1 has debuginfod enabled and MIEngine turns it on at debug start. The container's default DEBUGINFOD_URLS points at debuginfod.ubuntu.com, which is unreachable offline, so GDB blocks during shared-library loading and the debug session stalls (GUI never appears, Pause/Stop do nothing). Clear GDB's debuginfod URL list via miDebuggerArgs (-iex "set debuginfod urls") in each cppdbg config, and empty DEBUGINFOD_URLS in the devcontainer containerEnv as the root-cause fix for all container tooling.
Add list_can_interfaces.py to discover CAN adapters via python-can, candle_driver, and serial ports, with table/JSON output. Wire a --list-can (and --json) flag into bridge_server.py, and add unit tests.
…r removal
The board-identity refactor removed PlatformAdapter and switched to the async
hal::tiva::Pwm driver, so the cycle-analysis PWM Output stage matched no
functions and the analysis failed. Update the PWM Output patterns to
PlatformFactoryImpl::ThreePhasePwmOutput and hal::tiva::Pwm::{Start,SetComparator,Sync},
and the Encoder Read pattern to PlatformFactoryImpl::Read. Verified all required
stages match against the RelWithDebInfo ELF.
Replace the verbose fully-qualified hal::Percent (infra::Quantity<...>) triple signature with a readable Quantity-based wildcard that matches the 3-phase Start overload using only basic regex (engine-agnostic).
…nd integral method Replace the single-point V/I resistance and 63.2%-threshold inductance estimation, which baked dead-time, switch-drop and current-sensor offsets into the result and quantised tau to one sample. - Resistance: multi-point differential fit (V_j = R*I_ss_j + V_err) via numerical LinearRegression; slope is offset-immune, intercept exports the inverter voltage error as diagnostic data. - Inductance: integral method over the probe transient (offset cancels in the integrand, sub-sample resolution). - Auto-scale excitation levels to target current fractions of the drive maximum using a coarse pre-probe, with a fit-quality residual gate. - Apply the Delta winding correction (1.5x) to both R and L. - Return a single ResistanceInductanceResult struct (R, L, V_err, quality) instead of two optionals; propagate the new callback through the state machine, SIL fixtures, simulator wiring and mocks. - Remove the redundant TerminalElectricalParametersIdentification helper. - Update the theory and integration-testing documentation to match.
…irs in foc - Add "ident" command to run electrical parameter identification (R, L and pole pairs) with an optional winding type and tunable config, storing the result for later use. - Add "align" command that reuses the identified pole pairs and fails fast when identification has not been run. - Make pole pairs a mandatory argument of the "foc" simulation command and remove the now-redundant "motor" command. - Wire the electrical identification and alignment services into the target, raise the terminal command capacity, and update the HIL cycle-budget step.
Update voltageToVolts from 18.433 to 21.25 and drop the two bring-up threshold static_asserts that no longer match the recalibrated scaling.
- Orchestrator: convert to triage advisor (no Agent tool, model→sonnet); subagents cannot spawn subagents so routing was broken - Planner/executor: remove clarifying-questions instructions; subagents have no interactive channel — state assumptions and proceed instead - Planner: add Write tool, write plan to .claude/plans/<task>.md for executor handoff; strip duplicated constraints checklist (→ CLAUDE.md ref) - Executor: strip all constraint sections duplicated from CLAUDE.md; add Grep/Glob tools; add plan-file reading step - Reviewer: model→sonnet; add Grep/Glob; diff-first approach; slim 15-section checklist to 10 by referencing CLAUDE.md; merge duplicate heap/real-time items from §1+§2 - CLAUDE.md: fix Clarke label power-invariant→amplitude-invariant (2/3 scaling is amplitude-invariant; power-invariant uses √(2/3)); add agent workflow note about clarifying before dispatch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…x current at 3A Remove the step-3 currentTotal -> DCMP0 overcurrent redirect and the currentTotal ADC channel (4 -> 3 phase channels) while investigating current-measurement bias; the hardware overcurrent trip via the ADC digital comparator is off in this configuration. Source MaxCurrentSupported() from BoardCharacteristics::maxCurrentAmps instead of a hardcoded 15 A, and lower maxCurrentAmps/overcurrentThresholdAmps from 15/12 A to 3/3 A.
…amp) Replace the DC-step resistance/inductance estimation, which drove torque into a free rotor and let back-EMF corrupt the result, with high-frequency alpha-axis sinusoidal injection plus synchronous demodulation. Zero-mean AC produces no net torque and the demod rejects the low-frequency back-EMF, so no rotor clamp is needed; R and Ls fall out in one shot from the current amplitude and phase. - Guards: peak-current abort below MaxCurrentSupported, invalid-frequency and min-current return nullopt, duty clamped to keep the low-side shunt window samplable. - Compensate the PWM->ADC pipeline lag via voltageToCurrentDelaySamples. - CLI: ident <wye|delta> [inj_freq_hz] [inj_v%] ...; docs and tests updated. Pole-pair estimation is unchanged.
| const auto injectionHz = rlConfig.injectionFrequency.Value(); | ||
| if (injectionHz == 0 || samplingFrequencyHz % injectionHz != 0) | ||
| { | ||
| onResistanceAndInductanceDone(std::nullopt); | ||
| return; |
| "externalConsole": false, | ||
| "MIMode": "gdb", | ||
| "miDebuggerPath": "/usr/bin/gdb", | ||
| "miDebuggerArgs": "-iex \"set debuginfod urls\"", |
| "externalConsole": false, | ||
| "MIMode": "gdb", | ||
| "miDebuggerPath": "/usr/bin/gdb", | ||
| "miDebuggerArgs": "-iex \"set debuginfod urls\"", |
| "externalConsole": false, | ||
| "MIMode": "gdb", | ||
| "miDebuggerPath": "/usr/bin/gdb", | ||
| "miDebuggerArgs": "-iex \"set debuginfod urls\"", |
| "externalConsole": false, | ||
| "MIMode": "gdb", | ||
| "miDebuggerPath": "/usr/bin/gdb", | ||
| "miDebuggerArgs": "-iex \"set debuginfod urls\"", |
| "externalConsole": false, | ||
| "MIMode": "gdb", | ||
| "miDebuggerPath": "/usr/bin/gdb", | ||
| "miDebuggerArgs": "-iex \"set debuginfod urls\"", |
| // Steps 0-2 (phase currents A/B/C) go to the ADC FIFO. | ||
| // NOTE: the step-3 currentTotal -> DCMP0 overcurrent redirect is temporarily | ||
| // disabled while investigating current-measurement bias — hardware overcurrent | ||
| // trip via the ADC digital comparator is OFF in this configuration. | ||
|
|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…dent TerminalMotorAlignment and TerminalMechanicalParametersIdentification were standalone CLI wrappers wired into no target; the application drives the MotorAlignment and MechanicalParametersIdentification services directly. Delete both classes and their unit tests and drop the CMake source/test entries. The underlying services are unchanged.
The prior change disabled the step-3 currentTotal -> DCMP0 overcurrent redirect, leaving the hardware overcurrent protection (ADC -> PWM fault path) off by default, which is unsafe for a motor drive (raised in review). Restore the digital-comparator config, the currentTotal ADC channel, and the ConfigureAdcAndPwm assignment. Decouple the ADC/comparator full-scale (maxCurrentAmps, 15 A) from the application limit: add ratedCurrentAmps (3 A) returned by MaxCurrentSupported(), and set the overcurrent trip to 12 A (80% of full-scale) so it sits above the rated current with real headroom instead of at ADC saturation.
|



Replace the array-based Leds() with three discrete GPIO accessors (OperationalLed, WarningLed, FailureLed), add BoardId() for 3-bit active-low CAN node identification (PK0-2 on TM4C1294XL), and PowerStatus() for the LM5164 open-drain PG signal (PC6).
Add e-foc-hardware motor board definition and reference submodule. EK-TM4C123GXL gains capability flags (hasBoardIdPins=false, hasPowerStatusPin=false) and placeholder LED pins that avoid conflicts with CAN TX (PF3) and hall sensor inputs.