Skip to content

BACKUP_FREQUENCY_REGULATION

Combined mode: frequency regulation in normal operation, switching to backup when the grid fails.

Mode string BACKUP_FREQUENCY_REGULATION
Dispatcher control_step_backup via mode_involves_backup (no dedicated elif branch)
Config block functions.Backup_Frequency_Regulation
Status Composition stub — not fully implemented

Purpose

Intended to run frequency regulation while grid-tied and fall back to backup on grid loss.

What actually runs today

Same situation as BACKUP_PEAK_SHAVING:

  • ✅ The PQ ↔ VF grid-mode governor runs from control_step_backup (subject to functions.Backup.grid_mode_switch.enabled).
  • ❌ The fast frequency-regulation process is not started — ems_main.py only starts ems_frequency_regulation_direct_modbus_v4.py when mode == EMS_OP_FREQUENCY_REGULATION exactly. This combined mode does not match, so freq_reg.stop() is called.
  • ❌ No elif branch exists, so it falls through to "[EMS] ... not implemented in ems_main.py yet".
  • ❌ The frequency_regulation_ref indirection is never dereferenced.

Configuration

functions.Backup_Frequency_Regulation

Key Live value Meaning
enabled false Documented master switch; not read by any code path.
priority_rule backup_over_frequency_regulation Documented precedence.
frequency_regulation_ref Peak_Shaving Names the config block to delegate to. Not resolved.

Likely bug: frequency_regulation_ref points at "Peak_Shaving". It almost certainly should be "Frequency_Regulation".

Safety

Effectively governed by functions.Backup.grid_mode_switch.enabled, false by default — selecting this mode currently produces no actuation.

TODO to complete this mode

  1. Fix frequency_regulation_ref to reference Frequency_Regulation.
  2. Start/stop the fast controller for this mode, not only for FREQUENCY_REGULATION.
  3. Switch to backup power behaviour on grid loss (see backup.md).
  4. Honour enabled and priority_rule.