The Control Problem
Many grid operators prohibit exporting excess photovoltaic energy to the public network. Compliance requires that the installation remain net-zero at the utility meter at all times: PV generation must never exceed site consumption. For small fixed loads, a manually set power cap on the inverter may suffice. For sites where consumption varies — commercial buildings, pumping stations, light industrial facilities — a static cap either wastes generation capacity or risks a compliance breach whenever load drops unexpectedly.
The correct solution is a closed-loop control system. A controller reads the utility meter continuously, calculates the available generation headroom in real time, and adjusts the inverter power limit to match. When surplus generation exists, discretionary loads (heat pumps, water heaters, storage charging) are switched in to absorb it, keeping the array at its maximum power point without exporting.
This application note describes a complete implementation of this scheme using the EQSP32, a DTSU666 three-phase revenue meter, and a Huawei SUN2000 grid-tied inverter.
I/O Inventory
All field connections terminate at the EQSP32. No external gateways, protocol converters, or signal conditioning modules are required:
| Signal | Type | Notes |
|---|---|---|
| DTSU666 three-phase power meter | RS-485 (Modbus-RTU) | Per-phase V, A, power factor, total active power |
| Huawei SUN2000 inverter | Wi-Fi (Modbus-TCP) | Read: AC output, DC input, status. Write: active power limit register |
| Heat pump contactor | Relay out | Three-phase, high-current contactor coil (24 V) |
| Water heater contactor | Relay out | Single or three-phase, contactor coil (24 V) |
| System status indicator | Relay out | Optional panel lamp or alarm output |
| Manual override input | Digital in | Operator keyswitch to disable automatic curtailment |
Single power supply. The EQSP32 and all 24 V relay coils run from one DIN-rail 24 V DC supply. No additional interface boards, relay bricks, or communication gateways are required. All protocol interfaces (RS-485, Wi-Fi, Ethernet) are native to the controller.
Wiring and Panel Layout
The DTSU666 revenue meter mounts in the main distribution panel on the supply side of the main breaker. Its RS-485 terminals wire directly to the EQSP32 RS-485 port using a two-wire twisted pair. The meter requires no separate power supply — it is powered from the monitored phase and neutral.
The EQSP32 communicates with the SUN2000 inverter over Wi-Fi using the inverter's built-in Modbus-TCP server. No additional Ethernet cabling is required between the panel and the inverter. The relay outputs drive 24 V coils on three-phase contactors for the heat pump and water heater. All relay coils return to the EQSP32 24 V rail.
Control Loop
The main control loop executes once per second. Each cycle follows a fixed sequence:
- Read the DTSU666 via Modbus-RTU: per-phase voltage, current, and power factor. Calculate total three-phase active power consumed at the meter.
- Read the SUN2000 via Modbus-TCP: current AC output power, DC input power, and inverter status.
- Calculate available headroom: site consumption minus current generation, with a configurable safety margin (default 1 kW) to prevent momentary export during load steps.
- Write the new active power limit to the SUN2000 power-limit register.
- Evaluate soak load state: if headroom exceeds the heat pump or water heater rated power, enable that load. If headroom drops below the running load's rated power, disable it subject to minimum run-time constraints.
- Publish telemetry over MQTT: per-phase power, inverter output, generation headroom, soak load state, Wi-Fi signal strength, and uptime.
Loop timing and compliance. A one-second control cycle is adequate for most grid operator zero-export requirements, which typically specify response times of 2–5 seconds. The EQSP32 non-blocking communication architecture ensures that a slow response from either the meter or the inverter does not stall the rest of the loop — each communication task times out independently and the loop continues on schedule.
Soak Load Management
Simply enabling a load whenever surplus generation exists is not sufficient for equipment with thermal or mechanical constraints. A heat pump compressor that is cycled on and off at sub-minute intervals will suffer premature wear and may trigger its internal protection relay. The firmware enforces minimum run and minimum off timers for each soak load independently.
- Minimum run time: once a soak load is enabled, it remains on for a configurable minimum period (typically 10 minutes for a heat pump) regardless of generation headroom changes during that window. If headroom drops below the load's rated power during the minimum run period, the inverter limit absorbs the shortfall rather than switching the load off early.
- Minimum off time: after a load is switched off, a minimum off period (typically 3 minutes) must elapse before it can be re-enabled. This prevents rapid cycling at the threshold.
- Priority order: if multiple soak loads are available, lower-priority loads are shed first when headroom contracts. The priority order is configurable in firmware.
Compressor protection. Minimum run and off timers are not optional for heat pump applications. Most heat pump manufacturers specify a minimum compressor run time of 3–10 minutes in their installation manuals. Violating this in firmware will void the warranty and may damage the compressor over time.
Communication Fault Behaviour
A zero-export control system must define a safe state for every possible communication failure. If the meter or inverter becomes unreachable, the controller cannot simply hold the last known power limit indefinitely — site consumption may have changed significantly in the interim.
- Meter communication lost: if the DTSU666 fails to respond within three consecutive poll cycles, the EQSP32 sets the inverter power limit to a configurable conservative value (typically 20% of inverter rated power). This ensures the site cannot export even if consumption has dropped to zero. Soak loads are disabled. A fault flag is published over MQTT.
- Inverter communication lost: if the SUN2000 Modbus-TCP connection fails, the last written power limit remains in the inverter until communication recovers or the inverter is manually reset. The EQSP32 logs the event, disables soak loads, and continues attempting to reconnect. A fault flag is published over MQTT.
- Manual override: a physical keyswitch input on the controller allows an operator to disable automatic curtailment and set the inverter to a fixed safe limit, bypassing the control loop entirely during maintenance.
MQTT Telemetry and Remote Monitoring
The EQSP32 publishes the complete dataset to an MQTT broker at each control cycle. All key signals are available as individual topics for integration with any SCADA, building management system, or custom dashboard:
- Per-phase voltage, current, and power factor (from DTSU666)
- Total site consumption (W)
- Inverter AC output power and active power limit setpoint (W)
- DC input power and estimated PV irradiance
- Generation headroom (W)
- Heat pump and water heater state and remaining minimum run/off time
- Communication fault flags (meter, inverter)
- Controller uptime and Wi-Fi signal strength
Broker options: the EQSP32 connects to any standards-compliant MQTT broker. Cloud-managed brokers (HiveMQ Cloud, EMQX Cloud, AWS IoT Core) provide TLS-secured remote access with no server to maintain. For on-premises installations or sites with no internet connectivity requirement, a local Mosquitto instance on a small Linux server is fully supported. The firmware configuration is identical in either case.
Why EQSP32 for This Application
Native RS-485 port
The built-in RS-485 interface connects directly to the DTSU666 revenue meter with no external adapter, level shifter, or USB converter.
Modbus-TCP over Wi-Fi
The EQSP32 acts as a Modbus-TCP client over Wi-Fi, reaching the SUN2000 inverter's built-in server without additional Ethernet cabling between the panel and the inverter.
Concurrent protocol stack
RS-485 Modbus-RTU, Wi-Fi Modbus-TCP, and MQTT all run concurrently in a non-blocking architecture. No task starves another regardless of communication latency.
Relay outputs for contactors
Multiple relay outputs drive 24 V contactor coils directly, with PWM derating for reduced coil temperature during long energised periods.
Native MQTT client
Built-in MQTT stack with TLS support publishes telemetry to any standards-compliant broker — cloud or local — without external libraries or gateways.
Single 24 V DC supply
Controller and all relay coils share one DIN-rail power supply. No additional signal converters, interface boards, or communication modules required.
Ready to design your zero-export solar control system?
EQSP32 datasheet, I/O reference, Modbus register map for SUN2000 and DTSU666, and full application source code available.
View the EQSP32