ao_control

Active object processing measurement and config events to generate control actions.

Inherited Component

Inherited Requirements

Relationship Diagram

UML class diagram for ao_control

SW Unit Relations

Outgoing Relations

Relation

UML Type

Visibility

Target Unit

Description

SWR-004

composition

private

sm_fan_control

Control active object embeds fan control state machine.

SWR-012

association

public

ao_safety

Control and safety coordinate control override behavior.

SWR-013

association

public

ao_diagnostics

Control publishes operational and fault-relevant events to diagnostics.

Incoming Relations

Relation

UML Type

Visibility

Source Unit

Description

SWR-008

dependency

public

ao_runtime_supervisor

Runtime supervisor dispatches control events.

SWR-021

association

public

ao_monitoring

Monitoring publishes validated sensor snapshots to control for decision logic.

Data Types

ao_control_contextstruct

Internal runtime context for ao_control.

Struct Members

Name

Type

Description

control_mode

uint8_t

Control mode state.

fan_command_on

bool

Last commanded fan output.

threshold_c

int16_t

Configured activation threshold.

hysteresis_band_c

int16_t

Configured hysteresis band.

ao_control_eventstruct

Event payload handled by ao_control.

Struct Members

Name

Type

Description

signal_id

uint16_t

Control event signal id.

snapshot_valid

bool

Incoming sensor snapshot validity.

temperature_c

int16_t

Temperature sample for decision.

protect_active

bool

Protection override input.

ao_control_resultenum

Result code for ao_control operations.

Enum Members

Name

Value

Description

OK

0

Control command computed.

INVALID_SNAPSHOT

1

Snapshot rejected due to invalidity.

SAFETY_OVERRIDE

2

Command forced by safety policy.

Attributes

Attribute

Type

Visibility

Description

ctx

ao_control_context

private

Runtime context for ao_control state timing and error tracking.

Methods

dispatch

  • Return Type: ao_control_result

  • Visibility: public

  • Description: Process one ao_control event and update runtime outputs.

Parameters

Name

Type

Direction

Description

event

ao_control_event

in

Process one ao_control event and update runtime outputs.

init

  • Return Type: ao_control_result

  • Visibility: public

  • Description: Initialize ao_control runtime state and dependencies.

Dynamic Behaviour

Activity Diagrams

ao_control_activity

@startuml
start
:Receive IF_SensorSnapshot;
if (snapshot valid?) then (yes)
  :Evaluate thresholds and hysteresis;
  if (protective active?) then (yes)
    :Force fan OFF command;
  else (no)
    :Compute fan command ON or OFF;
  endif
  :Publish IF_FanCommand;
  :Publish IF_OperatingStatus update;
else (no)
  :Emit controlled safe output policy;
endif
stop
@enduml

This activity diagram defines ao_control decision flow from validated sensor snapshot intake through threshold and hysteresis evaluation to fan command generation with explicit protective override logic and status publication side effects.

Timing Diagrams

ao_control_timing

@startuml
robust "ao_control" as CTRL
scale max 1200 width
concise "sampling tick" as TICK

@0
TICK is idle
CTRL is waiting

@100
TICK is sensor_snapshot
CTRL is evaluating

@400
CTRL is command_ready

@500
CTRL is published

@enduml

This timing diagram allocates the control cycle budget relative to the sampling tick and shows ordering from input availability to command publication to support deterministic control latency analysis and schedulability review.

Sequence Diagrams

SEQ-001_Runtime_Event_Orchestration

@startuml

hide footbox
title Runtime Event Orchestration

participant ao_runtime_supervisor
participant evt_timer_service
participant evt_dispatcher
participant ao_monitoring
participant ao_control
participant ao_safety
participant ao_diagnostics
participant ao_modbus_server

ao_runtime_supervisor -> evt_timer_service : init periodic tick
ao_runtime_supervisor -> evt_dispatcher : init event loop
loop each scheduler tick
  evt_timer_service -> ao_runtime_supervisor : tick event
  ao_runtime_supervisor -> evt_dispatcher : dispatch cycle
  evt_dispatcher -> ao_monitoring : monitor_event
  evt_dispatcher -> ao_control : control_event
  evt_dispatcher -> ao_safety : safety_event
  evt_dispatcher -> ao_diagnostics : diagnostics_event
  evt_dispatcher -> ao_modbus_server : comms_event
end

@enduml

Primary runtime interoperability sequence showing scheduler tick propagation through dispatcher fan-out and deterministic active-object processing order across monitoring control safety diagnostics and communication units.

SEQ-002_Protection_And_Fault_Propagation

@startuml

hide footbox
title Control-Safety-Diagnostics Fault Propagation

participant ao_control
participant ao_safety
participant ao_diagnostics

ao_control -> ao_safety : IF_FanCommand(command_request)
ao_safety --> ao_control : IF_FanCommand(override_feedback)

ao_control -> ao_diagnostics : IF_OperatingStatus(control_status)
alt protection or fault detected
  ao_control -> ao_diagnostics : IF_FaultEvent(control_fault)
  ao_safety -> ao_diagnostics : IF_OperatingStatus(protection_state)
end

@enduml

Control and safety coordinate fan command decisions and publish operating/fault status into diagnostics for downstream handling.

SEQ-005_Startup_To_Ready

@startuml
hide footbox
participant ao_runtime_supervisor
participant evt_timer_service
participant evt_dispatcher
participant ao_monitoring
participant ao_control
participant ao_safety
participant ao_diagnostics
participant ao_modbus_server

ao_runtime_supervisor -> evt_timer_service : init()
ao_runtime_supervisor -> evt_dispatcher : init()
ao_runtime_supervisor -> ao_monitoring : init()
ao_runtime_supervisor -> ao_control : init()
ao_runtime_supervisor -> ao_safety : init()
ao_runtime_supervisor -> ao_diagnostics : init()
ao_runtime_supervisor -> ao_modbus_server : init()

group readiness gates
  evt_timer_service --> ao_runtime_supervisor : EVT_TIMER_READY
  evt_dispatcher --> ao_runtime_supervisor : EVT_DISPATCH_READY
  ao_monitoring --> ao_runtime_supervisor : EVT_AO_READY
  ao_control --> ao_runtime_supervisor : EVT_AO_READY
  ao_safety --> ao_runtime_supervisor : EVT_AO_READY
  ao_diagnostics --> ao_runtime_supervisor : EVT_AO_READY
  ao_modbus_server --> ao_runtime_supervisor : EVT_AO_READY
end

ao_runtime_supervisor -> evt_dispatcher : EVT_INIT_OK / start Run
@enduml

Startup lifecycle sequence with explicit readiness gates before entering Run state.

SEQ-006_Degraded_Entry_And_Recovery

@startuml
hide footbox
participant ao_runtime_supervisor
participant evt_dispatcher
participant ao_control
participant ao_safety
participant ao_diagnostics

ao_runtime_supervisor -> evt_dispatcher : dispatch cycle
alt degraded entry criteria met
  note over ao_runtime_supervisor: init_timeout OR required_service_failed OR fatal_fault
  ao_runtime_supervisor -> ao_control : EVT_DEGRADED
  ao_runtime_supervisor -> ao_safety : EVT_DEGRADED
  ao_runtime_supervisor -> ao_diagnostics : EVT_DEGRADED
  ao_runtime_supervisor -> evt_dispatcher : restrict noncritical events
end

ao_runtime_supervisor -> evt_dispatcher : periodic degraded dispatch

alt recovery criteria met
  note over ao_runtime_supervisor: fault_cleared AND watchdog_ok AND required_services_ready
  ao_runtime_supervisor -> evt_dispatcher : EVT_RESET
  ao_runtime_supervisor -> ao_control : EVT_RECOVERY
  ao_runtime_supervisor -> ao_safety : EVT_RECOVERY
  ao_runtime_supervisor -> ao_diagnostics : EVT_RECOVERY
end
@enduml

Lifecycle sequence for degraded entry triggers and guarded recovery back to Run.

SEQ-007_Controlled_Shutdown

@startuml
hide footbox
participant ao_runtime_supervisor
participant evt_dispatcher
participant ao_control
participant ao_safety
participant ao_diagnostics
participant ao_modbus_server

ao_runtime_supervisor -> evt_dispatcher : EVT_SHUTDOWN_REQ
ao_runtime_supervisor -> ao_control : stop outputs to safe state
ao_runtime_supervisor -> ao_safety : keep protective policy active
ao_runtime_supervisor -> ao_diagnostics : publish shutdown status
ao_runtime_supervisor -> ao_modbus_server : stop comm servicing

ao_modbus_server --> ao_runtime_supervisor : EVT_STOPPED
ao_diagnostics --> ao_runtime_supervisor : EVT_STOPPED
ao_safety --> ao_runtime_supervisor : EVT_STOPPED
ao_control --> ao_runtime_supervisor : EVT_STOPPED
evt_dispatcher --> ao_runtime_supervisor : EVT_STOPPED

ao_runtime_supervisor -> ao_runtime_supervisor : EVT_ALL_STOPPED / Shutdown complete
@enduml

Controlled shutdown sequence defining stop ordering and completion criteria.