pull down to refresh

For a zero-cost workflow I would separate the two deliverables instead of
forcing one program to do both:

  1. QElectroTech for the electrical single-line and control schematic.
  2. Mermaid or PlantUML for the PLC operating sequence/state diagram.
  3. Keep equipment tags identical in both files, then export both to SVG/PDF.

Why QElectroTech

QElectroTech is open-source, runs on Windows/Linux/macOS, stores projects in an
XML-based format, has reusable electrical symbols, and supports single-line
conductors. Its own manual explains that a single-line diagram is the simplified
power-system view; control wiring belongs on separate folios:

https://download.qelectrotech.org/qet/manuals/html/users/folio/type/single_line_diagram.html

That separation is useful in an industrial project:

Folio 1: utility → transformer → main breaker → MCC bus
Folio 2: MCC feeders → QF1/KM1/M1 ... QF8/KM8/M8
Folio 3: 24 VDC control power and safety chain
Folio 4: PLC I/O and terminal plan

Use consistent IEC-style tags:

QF1  motor feeder breaker
KM1  motor contactor
M1   motor
OL1  overload
DI_01 KM1 run feedback
DO_01 KM1 start command

Sequence diagram as text

This Mermaid file is reviewable in Git and renders in many Markdown tools:

stateDiagram-v2
    [*] --> Idle
    Idle --> CheckM1: Start request
    CheckM1 --> StartM1: bus voltage/current permit
    StartM1 --> CheckM2: M1 run + at-speed + settle timer
    CheckM2 --> StartM2: bus voltage/current permit
    StartM2 --> Running: repeat through M8
    StartM1 --> Fault: start timeout / overload
    StartM2 --> Fault: start timeout / overload
    Running --> Idle: controlled stop
    Fault --> Idle: fault cleared + manual reset

For detailed interactions, a sequence diagram is clearer:

sequenceDiagram
    participant OP as Operator/HMI
    participant PLC
    participant MCC
    participant M1
    participant BUS as Voltage/Current Monitor

    OP->>PLC: Start sequence
    PLC->>BUS: Check capacity
    BUS-->>PLC: Permit
    PLC->>MCC: Close KM1
    MCC->>M1: Energize
    M1-->>PLC: Run and at-speed feedback
    PLC->>PLC: Minimum settle timer
    PLC->>BUS: Re-check before M2

Practical workflow hack

Create one CSV equipment list as the source of truth:

tag,type,rating,command,feedback,folio
M1,motor,75kW,DO_01,DI_01,2
M2,motor,55kW,DO_02,DI_02,2

Use it for:

  • QElectroTech labels and cross-references;
  • PLC tag import;
  • I/O schedule;
  • cable/terminal schedule;
  • automatically generated Mermaid labels.

Even without full automation, a simple consistency check catches expensive
drawing mistakes:

import csv, re
from pathlib import Path

rows = list(csv.DictReader(open("equipment.csv", encoding="utf-8")))
expected = {r["tag"] for r in rows}
sequence = Path("sequence.md").read_text(encoding="utf-8")
used = set(re.findall(r"\bM\d+\b", sequence))

print("Missing from sequence:", sorted(expected - used))
print("Unknown in sequence:", sorted(used - expected))

The result is a maintainable package: QElectroTech handles proper electrical
documentation, the text diagram explains PLC behavior, and the shared tag list
prevents the two from drifting apart.