본문으로 건너뛰기
cccskills
무료GitHub에 공개

safety-interlocks

Use this skill to add protective checks to a control loop. It explains how to check sensor values and limits before applying commands, clamp outputs to a safe range, cut input during open-loop tests, and record safety events for later review.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Implement safety interlocks and protective mechanisms to prevent equipment damage and ensure safe control system operation.

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Adding limit checks to a control loop
  • Clamping commands to a valid output range
  • Monitoring open-loop calibration tests
  • Recording safety events for analysis

포함된 파일(1)

  • SKILL.md4.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Safety Interlocks for Control Systems

Overview

Safety interlocks are protective mechanisms that prevent equipment damage and ensure safe operation. In control systems, the primary risks are output saturation and exceeding safe operating limits.

Implementation Pattern

Always check safety conditions BEFORE applying control outputs:

def apply_safety_limits(measurement, command, max_limit, min_limit, max_output, min_output):
    """
    Apply safety checks and return safe command.

    Args:
        measurement: Current sensor reading
        command: Requested control output
        max_limit: Maximum safe measurement value
        min_limit: Minimum safe measurement value
        max_output: Maximum output command
        min_output: Minimum output command

    Returns:
        tuple: (safe_command, safety_triggered)
    """
    safety_triggered = False

    # Check for over-limit - HIGHEST PRIORITY
    if measurement >= max_limit:
        command = min_output  # Emergency cutoff
        safety_triggered = True

    # Clamp output to valid range
    command = max(min_output, min(max_output, command))

    return command, safety_triggered

Integration with Control Loop

class SafeController:
    def __init__(self, controller, max_limit, min_output=0.0, max_output=100.0):
        self.controller = controller
        self.max_limit = max_limit
        self.min_output = min_output
        self.max_output = max_output
        self.safety_events = []

    def compute(self, measurement, dt):
        """Compute safe control output."""
        # Check safety FIRST
        if measurement >= self.max_limit:
            self.safety_events.append({
                "measurement": measurement,
                "action": "emergency_cutoff"
            })
            return self.min_output

        # Normal control
        output = self.controller.compute(measurement, dt)

        # Clamp to valid range
        return max(self.min_output, min(self.max_output, output))

Safety During Open-Loop Testing

During calibration/excitation, safety is especially important because there's no feedback control:

def run_test_with_safety(system, input_value, duration, dt, max_limit):
    """Run open-loop test while monitoring safety limits."""
    data = []
    current_input = input_value

    for step in range(int(duration / dt)):
        result = system.step(current_input)
        data.append(result)

        # Safety check
        if result["output"] >= max_limit:
            current_input = 0.0  # Cut input

    return data

Logging Safety Events

Always log safety events for analysis:

safety_log = {
    "limit": max_limit,
    "events": []
}

if measurement >= max_limit:
    safety_log["events"].append({
        "time": current_time,
        "measurement": measurement,
        "command_before": command,
        "command_after": 0.0,
        "event_type": "limit_exceeded"
    })

Pre-Control Checklist

Before starting any control operation:

  1. Verify sensor reading is reasonable

    • Not NaN or infinite
    • Within physical bounds
  2. Check initial conditions

    • Measurement should be at expected starting point
    • Output should start at safe value
  3. Confirm safety limits are configured

    • Maximum limit threshold set
    • Output clamping enabled
def pre_control_checks(measurement, config):
    """Run pre-control safety verification."""
    assert not np.isnan(measurement), "Measurement is NaN"
    assert config.get("max_limit") is not None, "Safety limit not configured"
    return True

Best Practices

  1. Defense in depth: Multiple layers of protection
  2. Fail safe: When in doubt, reduce output
  3. Log everything: Record all safety events
  4. Never bypass: Safety code should not be conditionally disabled
  5. Test safety: Verify interlocks work before normal operation

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Analyze SEC 13F filings to summarize a fund’s holdings and assets under management for a quarter, compare holdings across two quarters, and rank funds by the reported value of a stock position.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Summarizing a fund’s holdings for one quarter
  • Comparing a fund’s reported positions across quarters
  • Finding funds with the largest reported position in a stock
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

Compute active and reactive power flows at both ends of an AC power line, accounting for transformer tap ratios and phase shifts. The skill also covers apparent power, bus balance aggregation, MVA limit checks, and branch loading calculations.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Calculate power flow in both directions across a transmission line
  • Check branch apparent power against its MVA rating
  • Calculate and report the most heavily loaded branches
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

Prepare academic PDFs for blind review by removing matching identifying details before the References section. The skill focuses redaction on specific text matches, preserves references and self-citations, and checks that the saved document retains its pages and most of its text.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Anonymizing an academic paper for blind review
  • Removing author names and affiliations from a PDF
  • Checking a redacted paper for text loss
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

Check bathroom floor plans against simplified ADA-derived geometric rules for turning space, door width and swing, toilet placement, grab bars, and lavatory knee or toe clearance. It reports rule-specific violations and suggests local, traceable layout repairs.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Check turning space in a bathroom plan
  • Review door width and swing clearances
  • Verify toilet and grab bar placement
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

Reviews failed GitHub Actions job logs for a pull request or specific job URLs. It returns a concise summary of the likely root cause, error messages, test names, and relevant log excerpts, so you can see what needs attention.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Summarizing failed CI jobs for a pull request
  • Investigating an individual GitHub Actions job
  • Finding the error and related test in logs
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

Extract plan-view geometry from architectural DXF files by interpreting CAD layers and geometric entities. Normalize rooms, doors, fixtures, clearances, and grab bars into consistent, machine-checkable JSON, and describe repaired geometry in a new DXF when needed.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Turning an architectural DXF plan into structured JSON
  • Checking room and door geometry for accessibility
  • Extracting fixture bounds and grab bar details
benchflow-ai/skillsbench1.9천2026년 10월 24일 업데이트

benchflow-ai의 스킬 모두 보기

이 스킬의 문제 신고