> For the complete documentation index, see [llms.txt](https://docs.bituo-technik.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bituo-technik.com/application-guides/sdm01-g2x-and-combo-gen2-balcony-solar-and-micro-storage-export-limiting-integration-guide.md).

# SDM01 G2X & Combo Gen2 — Balcony Solar & Micro-Storage Export Limiting Integration Guide

{% hint style="info" %}
**Status:** Active| **Applies to:** SDM01 G2X and SDM01 Combo Gen2 | **Firmware:** Pro V3.1.11+  | **Audience:** Balcony Solar PV & Micro-Storage Product Managers and Firmware Engineers | **Last Updated:** 2026-08-11
{% endhint %}

#### TL;DR — Quick Decision Card

```
Recommended communication channel for export limiting
└── Raw UDP push  ← Primary channel
    Push-based, no connection overhead, configurable interval 0.2–0.5 s
    See Section 5.1

Fallback channel
└── Modbus TCP polling
    Use if your inverter/storage MCU already has a Modbus stack
    ⚠️ Single TCP connection; open → read → close per cycle, ≥ 150 ms gap
    See Section 5.2

Configuration and diagnostics (not for real-time control)
├── HTTP GET         ← Read current power data
├── HTTP POST        ← Write configuration (UDP target IP, etc.)
└── BLE              ← Local provisioning via BT Powerlink app or custom app

Security compliance required (EN 18031 / RED)?
└── UDP AES (encrypted push, same low latency as Raw UDP)
    Pre-shared key is shared with BLE broadcast key
    See Section 5.3

Want to build your own communication stack?
└── Contact Bituo for custom firmware support on ESP32-C6
    See Section 9

Typical end-to-end system response: 2–5 seconds
(varies by country, DNO, and inverter/storage design — see Section 3.2)
```

***

#### 1. Purpose & Scope

This guide helps balcony solar and micro-storage **product managers** and **firmware/embedded engineers** integrate the [**SDM01 Gen2 Combo**](/product-document/sdm-series/sdm01-combo-gen2.md) or [**SDM01 G2X**](/product-document/sdm-series/sdm01-g2x.md) smart energy meter into a system over a local Wi-Fi/LAN network to implement **Export Limiting** — also known as zero feed-in control or anti-backflow.

**What Export Limiting does:** By continuously monitoring the total grid power ($$P\_{grid}$$) at the home's main incomer, the balcony inverter or micro-storage unit dynamically adjusts its output so that net power exported to the grid stays within the regulatory limit (e.g. 0 W zero-feed-in, or within the 800 W cap under the 2024 German Balkonkraftwerk regulation).

<figure><img src="https://68488808-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTmsWivaZjkubbVKrCezC%2Fuploads%2FovHJ6mJNOhkEZDZMEbTD%2FExport-Limiting-with-SDM01G2.png?alt=media&amp;token=db5e6c13-5264-45cb-a555-2956ee83233e" alt=""><figcaption></figcaption></figure>

> 📌 **Bituo Technik's role in this system:** The SDM01 Gen2 Combo / SDM01 G2X is the **real-time electrical monitoring and communication node** — it measures $$P\_{grid}$$ and delivers that data to your inverter or storage controller over Wi-Fi. The closed-loop control logic lives in your device. This guide focuses on getting accurate, low-latency power data from the meter to your system reliably.
>
> **The integration approach, control algorithm, fail-safe behavior, and grid-code compliance described in this guide are provided as reference examples only.** Export limiting control, output ramping, and regulatory compliance are implemented and validated by the inverter or storage system manufacturer.

**What this guide covers:**

* Supported products and selection guide
* System architecture and control flow
* Typical system-level response time
* Electrical installation and CT wiring
* Wi-Fi provisioning and device discovery
* Communication protocols (Raw UDP, Modbus TCP, HTTP, UDP AES)
* Export limiting control logic reference example
* Fail-safe and reconnection design
* Testing and validation checklist
* Custom firmware / open integration options

**Out of scope:** RS-485 / Modbus RTU integration — use the [SDM01 Modbus RTU Map](/device-api/sdm01-modbus-rtu-map.md) for that use case.

***

#### 2. Supported Products

Both products below support this export limiting integration over Wi-Fi. Select based on your installation environment.

<table data-header-hidden><thead><tr><th width="161"></th><th></th><th></th></tr></thead><tbody><tr><td></td><td> <a href="/product-document/sdm-series/sdm01-combo-gen2.md"><strong>SDM01 Gen2 Combo</strong></a> </td><td> <a href="/product-document/sdm-series/sdm01-g2x.md"><strong>SDM01 G2X</strong></a></td></tr><tr><td><strong>Measurement Update Rate</strong></td><td>≤ 200ms (Power RMS value)</td><td>≤ 200ms  (Power RMS value)</td></tr><tr><td><strong>Wi-Fi SoC</strong></td><td>ESP32-C6</td><td>ESP32-C6</td></tr><tr><td><strong>Antenna</strong></td><td>Built-in PCB antenna</td><td>External (SMA connector, antenna routable outside enclosure)</td></tr><tr><td><strong>Best fit</strong></td><td>Adequate Wi-Fi signal</td><td>Metal cabinets and weak Wi-Fi environments where adding WiFi AP is not feasible </td></tr></tbody></table>

> 💡 **Architecture note:** Both products use a dual-chip architecture — a dedicated **metering MCU** handles all energy measurement to ensure accuracy and isolation, while a separate **ESP32-C6 Wi-Fi SoC** manages connectivity and protocol handling. The two chips communicate internally via `UART`. Developers familiar with the ESP32 ecosystem can leverage this open interface for custom firmware or proprietary communication stacks.

***

#### 3. System Architecture Overview

**3.1 Control Flow**

<table><thead><tr><th width="170">Step</th><th width="259">Actor</th><th>Action</th></tr></thead><tbody><tr><td><strong>① Provision</strong></td><td>User / Installer</td><td>Configure meter Wi-Fi via BLE (BT Powerlink app or custom app via BLE API)</td></tr><tr><td><strong>② Discover</strong></td><td>Inverter / Storage MCU</td><td>Auto-discover meter IP on LAN via mDNS, or use DHCP-reserved static IP</td></tr><tr><td><strong>③ Communicate</strong></td><td>Inverter / Storage MCU</td><td>Receive UDP pushes from meter (or poll via Modbus TCP)</td></tr><tr><td><strong>④ Control</strong></td><td>Inverter / Storage MCU</td><td>Run export limiting control algorithm, adjust PV/storage output</td></tr><tr><td><strong>⑤ Fail-Safe</strong></td><td>Inverter / Storage MCU</td><td>On comms timeout, ramp output down to safe level</td></tr></tbody></table>

> 💡 **Configuring the UDP target address:** The meter needs to know which IP:Port to push UDP data to. This can be configured via any of the following channels:
>
> * **LAN HTTP** — `POST http://<meter-ip>/save-config` with `{"cmd":"udp","IpAddress":"<inverter-ip>","localUdpPort":<port>}` from the inverter MCU or any LAN client
> * **BLE** — via BT Powerlink app or your own app using the BLE Secured API (local, no internet required)
> * **Cloud MQTT** — via your app → cloud MQTT broker → meter (requires meter to be online)

**3.2 Typical System-Level Response Time**

The total time from a change in grid power to the inverter completing its output adjustment depends on multiple stages across the system. A typical well-designed system can achieve **2–5 seconds** end-to-end.

> ⚠️ The applicable response time requirement varies by country, region, DNO, and grid connection type. Always verify with the local grid code and connection agreement for your target market. The figures below are reference budgets only.

<table><thead><tr><th>Stage</th><th width="171">Reference Budget</th><th>Notes</th></tr></thead><tbody><tr><td><strong>① Metering IC — valid power value</strong></td><td>≤ 200 ms</td><td>The metering IC produces a valid, stable active power reading within 200 ms after a load change. This is the fundamental measurement latency floor.</td></tr><tr><td><strong>② MCU reads metering IC + Wi-Fi SoC transmits over network</strong></td><td>+ 50–100 ms</td><td>The MCU reads data from the metering IC, packages it, and the Wi-Fi SoC transmits the UDP packet over the LAN. Typical LAN UDP delivery adds 5–50 ms.</td></tr><tr><td><strong>③ Inverter / storage MCU receive &#x26; process</strong></td><td>10–100 ms</td><td>Parsing UDP packet, running control algorithm, issuing new power setpoint. Implemented by customer.</td></tr><tr><td><strong>④ Power electronics ramp / settling</strong></td><td>100–1000 ms</td><td>The inverter or storage unit physically ramps output to the new setpoint. Dominant factor; fully determined by inverter/storage design.</td></tr><tr><td><strong>End-to-end system response</strong></td><td><strong>Typically 2–5 s</strong></td><td>Must be validated by the system manufacturer on the final product.</td></tr></tbody></table>

**UDP push interval recommendation:**

The meter's UDP push interval is configurable. **0.5 s is recommended** for most balcony PV applications, balancing control responsiveness with MCU and network load. For systems with fast power electronics (ramp time < 200 ms) and capable inverter MCUs, the interval can be reduced to **0.2 s** to improve control responsiveness.

> 💡 Since the metering IC produces a valid power reading within \~200 ms, a 0.2 s push interval ensures every UDP packet carries a freshly computed measurement. At 0.5 s, each packet is still well within one measurement cycle. Both settings are appropriate depending on your system design.

**3.3 Key Parameters and Sign Convention**

<table><thead><tr><th width="141">Symbol</th><th>Description</th></tr></thead><tbody><tr><td><span class="math">P_{grid}</span></td><td>Real-time total grid power at main incomer. Unit: <strong>kW</strong> in UDP/HTTP. Multiply by 1000 for W.</td></tr><tr><td><span class="math">P_{export,max}</span></td><td>Maximum allowed export power, defined as a positive number (e.g. 0 W or 800 W)</td></tr><tr><td><span class="math">P_{margin}</span></td><td>Optional safety margin (e.g. 30–50 W)</td></tr><tr><td><span class="math">P_{target}</span></td><td>Controller target: <span class="math">-P_{export,max} + P_{margin}</span></td></tr><tr><td><span class="math">\Delta P</span></td><td>Control dead band (e.g. ±30–±50 W)</td></tr><tr><td><span class="math">T_{timeout}</span></td><td>Comms timeout before fail-safe triggers (configurable, e.g. 2–5 s)</td></tr></tbody></table>

**Sign convention (applies to all active power fields):**

| Value             | Meaning                                                            |
| ----------------- | ------------------------------------------------------------------ |
| $$P\_{grid} > 0$$ | Household is importing power from the grid                         |
| $$P\_{grid} = 0$$ | Net-zero grid exchange                                             |
| $$P\_{grid} < 0$$ | Household is exporting power to the grid → trigger export limiting |

***

#### 4. Electrical Installation

> ⚠️ **Safety Notice:** Installation must be performed by a qualified electrician. Always de-energize the circuit before wiring.

**4.1 Installation Position**

The meter must be installed at the **main incomer** (grid entry point) of the consumer unit, **upstream of all loads including the balcony inverter connection point**. This ensures $$P\_{grid}$$ reflects the true net household power balance.

```
Grid Supply
    │
┌───┴────────────────────────────────────────┐
│  Main Incomer                              │
│  [SDM01 Gen2 Combo / G2X — CT on all phases]  │  ← Install here
└───┬────────────────────────────────────────┘
    │
    ├── Household loads (appliances, lighting…)
    │
    └── Balcony inverter / micro-storage connection point
            (e.g. Schuko socket or dedicated circuit)
```

**4.2 CT Orientation and Phase Matching**

* The **arrow on the CT** must point toward the load (away from the grid supply).
* CT(L1) must be clamped on the **L1 phase conductor**, CT(L2) on L2, CT(L3) on L3.
* Mismatch between voltage measurement phase and CT phase will cause **incorrect power sign** and completely defeat export limiting logic.

> ⚠️ **Most common field issue:** Reversed CT orientation. If $$P\_{grid}$$ reads negative when the household is clearly importing (PV off), reverse the affected CT.

**4.3 Wiring Check — Verify Before Going Live**

After installation, use the BT Powerlink app or `HTTP GET /data` to verify:

1. All phase voltages read \~230 V (for 3P4W systems).
2. $$P\_{grid}$$ (`TotalActivePower`) is **positive** when household is consuming with no PV active.
3. Per-phase power signs are consistent — no phase reads opposite sign to the others under balanced load.
4. **Phase power factor check:** With PV off and normal household loads running, each phase power factor (`PowerFactorX/Y/Z`) should read between **0.7 and 1.0**. A reading outside this range or a negative power factor on one phase while others are normal typically indicates a CT orientation or phase matching error.

***

#### 5. Network Provisioning and Device Discovery

**5.1 Wi-Fi Provisioning via BLE**

Use the **BT Powerlink app** (Android / iOS) to provision the meter onto the same 2.4 GHz Wi-Fi network as the balcony inverter or storage unit:

1. Open BT Powerlink app → tap **Add Device**.
2. App scans for nearby meter via BLE.
3. Enter your Wi-Fi SSID and password → confirm.
4. Meter connects; ACT LED changes to slow blink (connected).

> 💡 **2.4 GHz only.** The meter connects to 2.4 GHz Wi-Fi only. If your router broadcasts a combined 2.4/5 GHz SSID, ensure the meter associates to the 2.4 GHz band, or use a dedicated 2.4 GHz SSID.

**5.2 Fixed IP — Recommended Primary Discovery**

Assign a DHCP reservation in the router for the meter's MAC address (find it in BT Powerlink app → **Device Info**). This gives the meter a stable IP across reboots and simplifies inverter-side configuration.

**5.3 mDNS Auto-Discovery — Recommended Fallback**

```
Service Type : _http._tcp.local.
Hostname     : energysensor-{model}-{mac}.local
Example      : energysensor-SDM01-c8b0d137f7c4.local
```

Integration pattern:

1. Browse for `_http._tcp.local.` on the LAN.
2. Filter for hostnames starting with `EnergySensor-SDM01`.
3. Resolve to IP and proceed with UDP or Modbus TCP.

> ⚠️ Some consumer routers block mDNS multicast between Wi-Fi clients. If discovery fails, check that **multicast/IGMP snooping** is enabled, or fall back to local network scan + HTTP probe.

**5.4 Local Network Scan + HTTP Probe — Last-Resort Discovery**

When fixed IP and mDNS both fail, scan the local network (e.g. via ARP scan or router client-list lookup) and probe each candidate:

```
GET http://<candidate-ip>/data
```

Response includes `model`, `mac`, and `firmware` fields. Match `ProductModel` against `SDM01_3PN` to confirm identity.

***

#### 6. Communication Protocols

**6.1 Raw UDP Push — Primary Channel ✅ Recommended**

Push-based, no connection overhead. The meter actively pushes data to a configured target IP:Port at a configurable interval.

**Configure UDP target (via BT Powerlink app or HTTP POST):**

```
POST http://<meter-ip>/save-config
{
  "cmd": "udp",
  "IpAddress": "<inverter-ip>",
  "localUdpPort": <port>
}
```

Or configure via BLE using the BLE Secured API, or via Cloud MQTT.

**Recommended push interval:** 0.5 s for most applications; 0.2 s for fast-response systems.

**Actual UDP message payload** (example from a live device):

```
{
  "Post": 20,
  "Time": 1786419136,
  "IP": "192.168.3.23",
  "Rssi": -41,
  "FWVersion": "3.1.12",
  "SerialNumber": "99B08567F7C1",
  "ProductModel": "SDM01_3PN",
  "MCUVersion": "001.01.00",
  "TP": 8,
  "VoltageX": "223.6",
  "VoltageY": "225.1",
  "VoltageZ": "223.3",
  "CurrentX": "8.711",
  "CurrentY": "8.117",
  "CurrentZ": "20.915",
  "ActivePowerX": "1.860",
  "ActivePowerY": "1.538",
  "ActivePowerZ": "4.518",
  "TotalActivePower": "7.916",
  "ReactivePowerX": "0.360",
  "ReactivePowerY": "-0.460",
  "ReactivePowerZ": "-0.315",
  "ApparentPowerX": "1.895",
  "ApparentPowerY": "1.605",
  "ApparentPowerZ": "4.529",
  "PowerFactorX": "0.98",
  "PowerFactorY": "0.96",
  "PowerFactorZ": "1.00",
  "UnbalanceLineCurrents": "66",
  "OverallPowerFactor": "1.00",
  "Frequency": "50.01",
  "ForwardEnergyX": "683.55",
  "ForwardEnergyY": "289.31",
  "ForwardEnergyZ": "1012.49",
  "TotalForwardEnergy": "1985.35",
  "ReverseEnergyX": "0.00",
  "ReverseEnergyY": "0.00",
  "ReverseEnergyZ": "0.00",
  "TotalReverseEnergy": "0.00"
}
```

> ⚠️ **Important implementation notes:**
>
> * All power and energy field values are **strings** — parse to float before use.
> * `TotalActivePower`, `ActivePowerX/Y/Z` unit is **kW**. Multiply by 1000 to get W.
> * Use `Time` field for freshness checking. Discard packets where `Time` is stale (> 10 s behind current time).
> * UDP is connectionless — implement a watchdog timer. If no packet is received for the configured timeout (e.g. 2–5 s), trigger fail-safe (see Section 8).

**6.2 Modbus TCP — Fallback Channel**

Use as a reliable fallback, or as primary if your MCU already has a Modbus stack.

```
Protocol  : Modbus TCP
Port      : 502
Slave ID  : 1
Byte Order: ABCD (big-endian, native mode)
```

> ⚠️ **Single-connection limit:** Firmware supports only one concurrent TCP connection. Open → read → close per cycle. Allow ≥ 150 ms between consecutive reads.

**Key registers for export limiting (Native Mode — ABCD byte order):**

<table><thead><tr><th width="143">Register (Dec)</th><th>Register (Hex)</th><th>Description</th><th width="145">Format</th><th>Notes</th></tr></thead><tbody><tr><td>1012</td><td>0x03F4</td><td>Active Power A</td><td>FLOAT32</td><td>Per-phase, signed. Use as control input for single-phase inverters — read the phase the inverter is connected to.</td></tr><tr><td>1014</td><td>0x03F6</td><td>Active Power B</td><td>FLOAT32</td><td>Per-phase, signed. Use as control input for single-phase inverters — read the phase the inverter is connected to.</td></tr><tr><td>1016</td><td>0x03F8</td><td>Active Power C</td><td>FLOAT32</td><td>Per-phase, signed. Use as control input for single-phase inverters — read the phase the inverter is connected to.</td></tr><tr><td><strong>1044</strong></td><td><strong>0x0414</strong></td><td><strong>Total Active Power</strong></td><td>FLOAT32</td><td>Primary control input for 3-phase inverters/storage systems.</td></tr></tbody></table>

Function codes `0x03` or `0x04` both supported. Recommended polling interval: **0.5–1 s**.

> 📌 For the full Modbus register map, see the SDM01 Documentation Center.

**6.3 HTTP GET /data — Diagnostics and Low-Frequency Reads**

HTTP is **not recommended as the primary real-time channel** for export limiting due to connection setup overhead. Use it for:

* Wiring verification during installation
* Low-frequency energy logging (> 5 s interval)
* Device discovery and health checks

**Request:**

```
GET http://<meter-ip>/data
```

**Example response** (from a live device at `192.168.3.23`):

```
{
  "Post": 92,
  "Time": 1786419230,
  "IP": "192.168.3.23",
  "Rssi": -37,
  "FWVersion": "3.1.12",
  "SerialNumber": "99B08567F7C1",
  "ProductModel": "SDM01_3PN",
  "VoltageX": "223.8",
  "VoltageY": "225.0",
  "VoltageZ": "223.1",
  "CurrentX": "8.735",
  "CurrentY": "8.077",
  "CurrentZ": "16.666",
  "ActivePowerX": "1.867",
  "ActivePowerY": "1.533",
  "ActivePowerZ": "3.564",
  "TotalActivePower": "6.964",
  "ReactivePowerX": "0.353",
  "ReactivePowerY": "-0.458",
  "ReactivePowerZ": "-0.452",
  "ApparentPowerX": "1.900",
  "ApparentPowerY": "1.600",
  "ApparentPowerZ": "3.593",
  "PowerFactorX": "0.98",
  "PowerFactorY": "0.96",
  "PowerFactorZ": "0.99",
  "UnbalanceLineCurrents": "49",
  "OverallPowerFactor": "1.00",
  "Frequency": "50.03",
  "ForwardEnergyX": "683.58",
  "ForwardEnergyY": "289.34",
  "ForwardEnergyZ": "1012.55",
  "TotalForwardEnergy": "1985.47",
  "ReverseEnergyX": "0.00",
  "ReverseEnergyY": "0.00",
  "ReverseEnergyZ": "0.00",
  "TotalReverseEnergy": "0.00"
}
```

The HTTP `/data` response uses the same field names and units as the UDP push payload.

**6.4 UDP AES — Encrypted Push**

For products requiring wireless security compliance (EN 18031, EU RED Directive), use **UDP AES encrypted push**:

* Same message structure and field names as Raw UDP
* Payload is AES-encrypted
* No latency penalty vs Raw UDP
* **The AES pre-shared key is the same key used for BLE electrical data broadcast encryption** — configure once via BT Powerlink app or BLE Secured API

***

#### 7. Export Limiting Control Logic (Reference Example)

> 📌 **This section is provided as a simplified reference example only.** The meter provides real-time grid power measurement; the actual closed-loop control algorithm, output ramping behavior, and grid-code compliance logic are implemented inside the inverter or storage controller. The approach described here is one common method — adapt it to your system's specific requirements.

**7.1 Power Sign Convention**

The control input field depends on your inverter topology:

<table><thead><tr><th width="276">Inverter Type</th><th width="254">Recommended Control Input</th><th>Field (UDP/HTTP)</th></tr></thead><tbody><tr><td><strong>3-phase inverter / 3-phase storage</strong></td><td>Total Active Power</td><td><code>TotalActivePower</code></td></tr><tr><td><strong>Single-phase micro-inverter (e.g. balcony PV)</strong></td><td>Active Power of the connected phase</td><td><code>ActivePowerX/Y/Z</code></td></tr><tr><td><strong>DNO requires per-phase zero export</strong></td><td>Monitor all 3 phases independently; trigger limiting when any phase goes negative</td><td>All three <code>ActivePowerX/Y/Z</code></td></tr></tbody></table>

> ⚠️ For single-phase micro-inverters: using `TotalActivePower` may mask per-phase export — e.g. the connected phase exports −500 W while the other two phases import +600 W total, making the sum appear positive. Always verify with your target DNO's metering and compliance requirements.

**7.2 Define the Export Limit Clearly**

To avoid sign mistakes, define the export limit as a positive number and derive the controller target:

<table><thead><tr><th width="178">Symbol</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><span class="math">P_{export,max}</span></td><td>Maximum allowed export power, expressed as a positive number</td><td>0 W (zero-feed-in) or 800 W</td></tr><tr><td><span class="math">P_{margin}</span></td><td>Optional safety margin</td><td>30–50 W</td></tr><tr><td><span class="math">P_{target}</span></td><td>Target grid power for the controller</td><td><span class="math">-P_{export,max} + P_{margin}</span></td></tr></tbody></table>

**Note:** *The formula above applies when using `TotalActivePower` as the control input (3-phase inverter scenario). For single-phase control, substitute the per-phase power reading accordingly.*

**Examples:**

* **Zero-feed-in** ($$P\_{export,max}=0\text{ W}$$, $$P\_{margin}=30\text{ W}$$):$$P\_{target} = +30\text{ W}$$The system keeps a small import margin to avoid crossing zero.
* **800 W export cap** ($$P\_{export,max}=800\text{ W}$$, $$P\_{margin}=50\text{ W}$$):$$P\_{target} = -750\text{ W}$$The system allows export up to 750 W, keeping 50 W safety margin.

**7.3 Incremental PI Control Example**

**Error signal:**

$$e(t) = P\_{grid}(t) - P\_{target}$$

* $$e(t) > 0$$: grid power is above target (household importing) → control output **increases**
* $$e(t) < 0$$: grid power is below target (household exporting beyond limit) → control output **decreases**

**Incremental PI correction:**

$$\Delta P\_{out}(t) = K\_p \cdot e(t) + K\_i \cdot \int e(t),dt$$

**New output setpoint:**

$$P\_{out,new} = P\_{out,current} + \Delta P\_{out}$$

**Output clamping:**

$$P\_{out,new} = \text{clamp}(P\_{out,new},; 0\text{ W},; P\_{rated})$$

**7.4 Example Starting Parameters**

> These are starting points only. Tune according to your power electronics ramp rate, communication interval, and grid-code requirements.

| Parameter              | Example Value                     | Notes                                        |
| ---------------------- | --------------------------------- | -------------------------------------------- |
| $$K\_p$$               | 0.2–0.6                           | Reduce if oscillation is observed            |
| $$K\_i$$               | 0.1–0.3 s⁻¹                       | Too high may cause overshoot                 |
| Dead band $$\Delta P$$ | ±30–±50 W                         | Prevents micro-adjustments                   |
| UDP push interval      | 0.5 s (or 0.2 s for fast systems) | See Section 3.2                              |
| Control update trigger | On each valid new meter sample    | Do not reuse stale data as new measurements  |
| Output ramp limit      | Device-dependent                  | Implement inside inverter/storage controller |

**7.5 Dead Band**

```
if |P_grid - P_target| < ΔP:
    hold current output
else:
    update output setpoint
```

> For zero-feed-in systems, a small positive import margin (30–50 W) is usually more stable than targeting exactly 0 W.

**7.6 Anti-Windup**

When the output is clamped at 0 W or $$P\_{rated}$$, freeze the integral term to prevent accumulation:

```
if P_out_new is clamped:
    freeze or limit the integral term
else:
    update the integral term normally
```

This prevents slow recovery, overshoot, and oscillation after output saturation or communication recovery.

***

#### 8. Fail-Safe and Reconnection

> ⚠️ A robust fail-safe design is mandatory. Network instability must never result in uncontrolled grid export.

> 📌 **Note:** Communication timeout and export limiting response time are different concepts. Response time describes how quickly the system adjusts output under normal operation. Timeout describes when the controller should enter fail-safe after losing valid meter data. The timeout value should be selected by the system manufacturer based on safety strategy and grid-code requirements.

**8.1 Timeout Detection**

| Condition                                                          | Recommended Action                              |
| ------------------------------------------------------------------ | ----------------------------------------------- |
| No valid UDP packet received for configurable timeout (e.g. 2–5 s) | Ramp PV/storage output to configured safe level |
| Modbus TCP read fails for configurable consecutive cycles          | Ramp PV/storage output to configured safe level |
| Packet `Time` field is stale (> 10 s old)                          | Treat as timeout, increment timeout counter     |

**8.2 Last Valid Data Cache**

Cache the last valid $$P\_{grid}$$ reading. Use it to ride through transient single-packet losses rather than triggering full fail-safe immediately. Only trigger fail-safe on sustained loss beyond the configured timeout.

**8.3 Reconnection**

After fail-safe triggers:

1. Continue attempting UDP reception / Modbus TCP connection in the background.
2. Once valid data resumes, **gradually ramp** output back up — do not step directly to full power.
3. Example ramp rate: increase by no more than $$P\_{rated} / 10$$ per control cycle (e.g. per 0.5 s) until steady state.

***

#### 9. Testing and Validation Checklist

> 📌 The following checklist is provided as a reference only. The system integrator and inverter/storage manufacturer are responsible for defining and executing their own validation procedures.

* [ ] **Step 1 — Wiring:** CT orientation and phase matching correct. `TotalActivePower` positive when household is importing with PV off.
* [ ] **Step 2 — Power factor check:** With PV off and normal loads running, per-phase power factor reads 0.7–1.0. Abnormal readings indicate CT or phase wiring issues.
* [ ] **Step 3 — Provisioning:** Meter connected to Wi-Fi, ACT LED slow-blinks. IP confirmed via BT Powerlink app.
* [ ] **Step 4 — Discovery:** Inverter/storage MCU discovers meter via mDNS or fixed IP. UDP packets arriving at expected interval.
* [ ] **Step 5 — Export limiting ramp-up:** Gradually increase PV output. Observe `TotalActivePower` stabilizing near $$P\_{target}$$.
* [ ] **Step 6 — End-to-end response time:** Measure total time from step-change in load to inverter output settling. Validate against your target grid code requirement.
* [ ] **Step 7 — Fail-safe:** Disconnect meter from Wi-Fi. Confirm inverter/storage output ramps to safe level within the configured timeout.
* [ ] **Step 8 — Reconnection:** Restore Wi-Fi. Confirm system automatically resumes export limiting, output ramps up smoothly.

***

#### 10. Custom Firmware / Open Integration (SDM01 G2X & Combo Gen2)

The SDM01 G2X & Combo Gen2's communication module is based on an **ESP32-C6** SoC. For manufacturers requiring a proprietary communication stack or custom cloud integration, Bituo Technik can provide firmware customization support, flashing access, and metering interface documentation.

> 💡 **Important:** The ESP32-C6 handles **communication only**. Measurement accuracy is handled by a dedicated metering IC and is **not affected** by custom firmware on the ESP32-C6.

For custom firmware resources, flashing guides, and metering IC interface documentation, please contact <support@bituo-technik.com> or visit the [Documentation Center](https://docs.bituo-technik.com).

***
