Files
2026-03-12 06:55:33 +01:00

132 lines
3.0 KiB
Markdown

# SkyLogic AeroAlign - CoG Scale Wiring
**Version**: 0.1.0
**Date**: 2026-03-11
**Scope**: planned CoG scale node that shares the same Master and ESP-NOW fabric
## Overview
The CoG extension is based on two supports:
- front support load cell
- rear support load cell
The recommended first implementation uses:
- `1x ESP32-C3` or `1x ESP32-S3`
- `2x HX711`
- `2x single-point load cells` or your existing suitable load cells
One HX711 per support keeps calibration and diagnostics simple.
## Functional Model
The CoG node reports three live values to the Master:
- `front_weight_g`
- `rear_weight_g`
- `cog_position_mm`
These values already fit the shared telemetry packet used by the current Master firmware.
## Recommended Electronics
| Part | Qty | Notes |
|------|-----|-------|
| ESP32-C3 or ESP32-S3 | 1 | same ecosystem as AeroAlign |
| HX711 amplifier | 2 | one per support |
| Load cell | 2 | typically 3 kg to 10 kg depending on model size |
| LiPo or bench supply | 1 | portable or fixed jig |
| TP4056 + regulator | optional | only for portable scale |
## Wiring Strategy
### HX711 #1: Front support
| HX711 pin | Connection |
|-----------|------------|
| `VCC` | `3V3` |
| `GND` | `GND` |
| `DT` | `GPIO6` |
| `SCK` | `GPIO7` |
### HX711 #2: Rear support
| HX711 pin | Connection |
|-----------|------------|
| `VCC` | `3V3` |
| `GND` | `GND` |
| `DT` | `GPIO8` |
| `SCK` | `GPIO9` |
These GPIOs are recommendations for the future CoG firmware. They are not yet hard-coded in the repo.
## Load Cell Wiring
Most 4-wire load cells expose:
| Wire | Meaning |
|------|---------|
| Red | `E+` |
| Black | `E-` |
| Green | `A+` |
| White | `A-` |
Connect each load cell directly to one HX711.
### Important
Wire colors are not universal. Validate your load cells with the supplier datasheet or a multimeter before soldering.
## Mechanical Layout
```
aircraft
|
+--> front support --> load cell #1 --> HX711 #1
|
+--> rear support --> load cell #2 --> HX711 #2
```
The support spacing `L` must be known and entered into the system profile.
## CoG Formula
With front support at `x = 0` and rear support at `x = L`:
`x_cog_from_front_support = rear_weight / (front_weight + rear_weight) * L`
If you measure relative to the wing leading edge:
`x_cog_from_leading_edge = support_offset_from_leading_edge + x_cog_from_front_support`
## Calibration Plan
Each support needs:
1. zero / tare
2. scale factor from known weight
Recommended workflow:
1. tare both supports empty
2. place known weight on front support only
3. save front factor
4. repeat for rear support
5. validate with known total weight centered between supports
## Current Repo Status
- shared protocol support exists in [telemetry_protocol.h](../../firmware/common/telemetry_protocol.h)
- Master can already display CoG-style nodes in the existing UI
- dedicated HX711 firmware is not implemented yet
## Next Firmware Target
Create a new node type, likely `firmware/cog_slave`, with:
- HX711 reading
- tare and scale calibration
- CoG computation
- ESP-NOW transmission using `DEVICE_TYPE_COG_SCALE`