|
- <svg xmlns="http://www.w3.org/2000/svg" width="2000" height="1250" viewBox="0 0 2000 1250">
- <defs>
- <filter id="shadow" x="-20%" y="-20%" width="140%" height="150%">
- <feDropShadow dx="0" dy="7" stdDeviation="7" flood-color="#24445F" flood-opacity="0.16"/>
- </filter>
- <marker id="arrowBlue" markerWidth="13" markerHeight="13" refX="11" refY="6.5" orient="auto">
- <path d="M0,0 L13,6.5 L0,13 Z" fill="#2F78B7"/>
- </marker>
- <marker id="arrowOrange" markerWidth="13" markerHeight="13" refX="11" refY="6.5" orient="auto">
- <path d="M0,0 L13,6.5 L0,13 Z" fill="#D97925"/>
- </marker>
- <marker id="arrowGreen" markerWidth="13" markerHeight="13" refX="11" refY="6.5" orient="auto">
- <path d="M0,0 L13,6.5 L0,13 Z" fill="#31845E"/>
- </marker>
- <marker id="arrowRed" markerWidth="13" markerHeight="13" refX="11" refY="6.5" orient="auto">
- <path d="M0,0 L13,6.5 L0,13 Z" fill="#C64545"/>
- </marker>
- <style>
- text { font-family: "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif; fill: #123A60; }
- .title { font-size: 42px; font-weight: 700; fill: #123A60; }
- .subtitle { font-size: 20px; fill: #61778C; }
- .lane { font-size: 20px; font-weight: 700; fill: #50708D; letter-spacing: 1px; }
- .state-title { font-size: 29px; font-weight: 700; }
- .state-desc { font-size: 19px; }
- .flag { font-size: 17px; fill: #345B7D; }
- .label { font-size: 18px; font-weight: 600; paint-order: stroke; stroke: #FFFFFF; stroke-width: 7px; stroke-linejoin: round; }
- .note-title { font-size: 18px; font-weight: 700; }
- .note-text { font-size: 17px; }
- .blue { fill: none; stroke: #2F78B7; stroke-width: 4; marker-end: url(#arrowBlue); }
- .orange { fill: none; stroke: #D97925; stroke-width: 4; marker-end: url(#arrowOrange); }
- .green { fill: none; stroke: #31845E; stroke-width: 4; marker-end: url(#arrowGreen); }
- .red { fill: none; stroke: #C64545; stroke-width: 4; marker-end: url(#arrowRed); }
- .dash { stroke-dasharray: 11 9; }
- </style>
- </defs>
-
- <rect width="2000" height="1250" fill="#F4F8FC"/>
- <text x="1000" y="62" text-anchor="middle" class="title">PLSR 单轴状态机</text>
- <text x="1000" y="94" text-anchor="middle" class="subtitle">每轴独立运行 · 唯一状态入口 · 硬件脉冲发生与状态控制解耦</text>
-
- <rect x="65" y="125" width="1870" height="1050" rx="25" fill="#FFFFFF" stroke="#A7C8E5" stroke-width="2.5" filter="url(#shadow)"/>
-
- <!-- 分层背景 -->
- <rect x="95" y="155" width="1810" height="185" rx="18" fill="#F4F7FA"/>
- <rect x="95" y="365" width="1810" height="245" rx="18" fill="#F0F6FC"/>
- <rect x="95" y="635" width="1810" height="210" rx="18" fill="#FFF8F0"/>
- <rect x="95" y="870" width="1810" height="245" rx="18" fill="#F6FAF7"/>
- <text x="115" y="184" class="lane">准备状态</text>
- <text x="115" y="394" class="lane">脉冲活动状态</text>
- <text x="115" y="664" class="lane">保持状态</text>
- <text x="115" y="899" class="lane">终止状态</text>
-
- <!-- 准备状态 -->
- <g filter="url(#shadow)">
- <rect x="190" y="205" width="330" height="105" rx="20" fill="#E8EDF3" stroke="#93A9BD" stroke-width="2.5"/>
- <rect x="700" y="205" width="330" height="105" rx="20" fill="#EAF4FD" stroke="#66A4DC" stroke-width="2.5"/>
- </g>
- <text x="355" y="246" text-anchor="middle" class="state-title">UNINITIALIZED</text>
- <text x="355" y="278" text-anchor="middle" class="state-desc">输出安全,模块尚未就绪</text>
- <text x="865" y="246" text-anchor="middle" class="state-title">IDLE</text>
- <text x="865" y="278" text-anchor="middle" class="flag">BUSY=0 · PULSE_ACTIVE=0</text>
-
- <!-- 活动状态 -->
- <g filter="url(#shadow)">
- <rect x="190" y="430" width="330" height="120" rx="20" fill="#347FBD"/>
- <rect x="700" y="430" width="330" height="120" rx="20" fill="#2876B5"/>
- <rect x="1210" y="430" width="330" height="120" rx="20" fill="#347FBD"/>
- </g>
- <text x="355" y="474" text-anchor="middle" class="state-title" fill="#FFFFFF" style="fill:#FFFFFF">ACCEL</text>
- <text x="355" y="504" text-anchor="middle" class="state-desc" fill="#FFFFFF" style="fill:#FFFFFF">按加速参数提升频率</text>
- <text x="355" y="532" text-anchor="middle" class="flag" fill="#FFFFFF" style="fill:#FFFFFF">BUSY=1 · PULSE_ACTIVE=1</text>
- <text x="865" y="474" text-anchor="middle" class="state-title" fill="#FFFFFF" style="fill:#FFFFFF">RUN</text>
- <text x="865" y="504" text-anchor="middle" class="state-desc" fill="#FFFFFF" style="fill:#FFFFFF">恒频或段内动态调频</text>
- <text x="865" y="532" text-anchor="middle" class="flag" fill="#FFFFFF" style="fill:#FFFFFF">BUSY=1 · PULSE_ACTIVE=1</text>
- <text x="1375" y="474" text-anchor="middle" class="state-title" fill="#FFFFFF" style="fill:#FFFFFF">DECEL</text>
- <text x="1375" y="504" text-anchor="middle" class="state-desc" fill="#FFFFFF" style="fill:#FFFFFF">减速、反向或受控停止</text>
- <text x="1375" y="532" text-anchor="middle" class="flag" fill="#FFFFFF" style="fill:#FFFFFF">BUSY=1 · PULSE_ACTIVE=1</text>
-
- <!-- 保持状态 -->
- <g filter="url(#shadow)">
- <rect x="190" y="690" width="330" height="115" rx="20" fill="#FFF3E7" stroke="#EA9B55" stroke-width="2.5"/>
- <rect x="700" y="690" width="330" height="115" rx="20" fill="#FFF3E7" stroke="#EA9B55" stroke-width="2.5"/>
- </g>
- <text x="355" y="734" text-anchor="middle" class="state-title">WAIT</text>
- <text x="355" y="765" text-anchor="middle" class="state-desc">等待时间、信号或EXT条件</text>
- <text x="355" y="791" text-anchor="middle" class="flag">BUSY=1 · PULSE_ACTIVE=0</text>
- <text x="865" y="734" text-anchor="middle" class="state-title">PAUSED</text>
- <text x="865" y="765" text-anchor="middle" class="state-desc">保留快照、段号与剩余量</text>
- <text x="865" y="791" text-anchor="middle" class="flag">BUSY=1 · PULSE_ACTIVE=0</text>
-
- <!-- 终止状态 -->
- <g filter="url(#shadow)">
- <rect x="175" y="950" width="350" height="120" rx="20" fill="#ECF8F1" stroke="#56A67D" stroke-width="2.5"/>
- <rect x="690" y="950" width="350" height="120" rx="20" fill="#F5F2ED" stroke="#AF9A7C" stroke-width="2.5"/>
- <rect x="1205" y="950" width="350" height="120" rx="20" fill="#FDEEEF" stroke="#E06469" stroke-width="2.5"/>
- </g>
- <text x="350" y="994" text-anchor="middle" class="state-title">COMPLETED</text>
- <text x="350" y="1025" text-anchor="middle" class="state-desc">正常结束,DONE=1并锁存</text>
- <text x="350" y="1053" text-anchor="middle" class="flag">BUSY=0 · PULSE_ACTIVE=0</text>
- <text x="865" y="994" text-anchor="middle" class="state-title">STOPPED</text>
- <text x="865" y="1025" text-anchor="middle" class="state-desc">命令或限位停止,DONE=0</text>
- <text x="865" y="1053" text-anchor="middle" class="flag">停止原因锁存</text>
- <text x="1380" y="994" text-anchor="middle" class="state-title">ERROR</text>
- <text x="1380" y="1025" text-anchor="middle" class="state-desc">不可恢复运行错误,DONE=0</text>
- <text x="1380" y="1053" text-anchor="middle" class="flag">禁止新脉冲并锁存错误</text>
-
- <!-- 主运行链 -->
- <path d="M520 257 L692 257" class="blue"/>
- <text x="606" y="244" text-anchor="middle" class="label">初始化成功</text>
-
- <path d="M865 310 L865 355 L355 355 L355 422" class="blue"/>
- <text x="610" y="345" text-anchor="middle" class="label">合法START:校验并建立快照</text>
-
- <path d="M520 490 L692 490" class="blue"/>
- <text x="606" y="478" text-anchor="middle" class="label">达到目标频率</text>
-
- <path d="M1030 490 L1202 490" class="blue"/>
- <text x="1116" y="478" text-anchor="middle" class="label">需要减速或反向</text>
-
- <path d="M1375 430 L1375 405 L865 405 L865 422" class="blue dash"/>
- <text x="1120" y="395" text-anchor="middle" class="label">下一同向段或继续运行</text>
-
- <!-- WAIT -->
- <path d="M700 500 L610 500 L610 748 L528 748" class="orange"/>
- <text x="625" y="675" class="label">段完成且等待条件未满足</text>
- <path d="M355 690 L355 558" class="orange dash"/>
- <text x="340" y="632" text-anchor="end" class="label">条件满足,进入下一段</text>
-
- <!-- PAUSE -->
- <path d="M1375 550 L1375 640 L865 640 L865 682" class="orange"/>
- <text x="1120" y="629" text-anchor="middle" class="label">PAUSE减速到0</text>
- <path d="M700 748 L620 748 L620 615 L470 615 L470 558" class="orange dash"/>
- <text x="635" y="735" text-anchor="middle" class="label">RESUME</text>
-
- <!-- 正常完成 -->
- <path d="M355 805 L355 942" class="green"/>
- <text x="340" y="880" text-anchor="end" class="label">等待后正常结束</text>
- <path d="M700 535 L650 535 L650 830 L350 830 L350 942" class="green"/>
- <text x="500" y="820" text-anchor="middle" class="label">最后一段正常完成</text>
-
- <!-- 停止汇总入口 -->
- <rect x="650" y="850" width="430" height="68" rx="14" fill="#FFF3E7" stroke="#D97925" stroke-width="2"/>
- <text x="865" y="877" text-anchor="middle" class="note-title">停止入口</text>
- <text x="865" y="902" text-anchor="middle" class="note-text">STOP_DECEL到0 / STOP_IMMEDIATE收尾</text>
- <path d="M865 918 L865 942" class="orange"/>
-
- <!-- 错误与复位 -->
- <rect x="1210" y="850" width="340" height="68" rx="14" fill="#FDEEEF" stroke="#C64545" stroke-width="2"/>
- <text x="1380" y="877" text-anchor="middle" class="note-title">任意状态不可恢复错误</text>
- <text x="1380" y="902" text-anchor="middle" class="note-text">参数、定时器、计数或非法转换</text>
- <path d="M1380 918 L1380 942" class="red"/>
- <path d="M1555 1010 L1850 1010 L1850 170 L1030 170 L1030 245" class="red dash"/>
- <text x="1450" y="158" text-anchor="middle" class="label">RESET_ERROR成功:仅回IDLE,不自动续跑</text>
-
- <!-- 说明与图例 -->
- <rect x="1580" y="205" width="285" height="335" rx="18" fill="#F8FAFC" stroke="#B9C8D5" stroke-width="2"/>
- <text x="1722" y="242" text-anchor="middle" class="state-title" style="font-size:23px">转换原则</text>
- <text x="1605" y="282" class="note-text">1. 每个周期只执行一次转换</text>
- <text x="1605" y="320" class="note-text">2. 高优先级事件先于普通事件</text>
- <text x="1605" y="358" class="note-text">3. 状态切换不直接产生脉冲</text>
- <text x="1605" y="396" class="note-text">4. 硬件安全收尾后确认终态</text>
- <text x="1605" y="434" class="note-text">5. 终态原因和错误均需锁存</text>
- <text x="1605" y="472" class="note-text">6. 零任务直接进入完成态</text>
- <line x1="1605" y1="505" x2="1655" y2="505" stroke="#2F78B7" stroke-width="4"/>
- <text x="1670" y="512" class="note-text">正常运行</text>
- <line x1="1605" y1="535" x2="1655" y2="535" stroke="#D97925" stroke-width="4"/>
- <text x="1670" y="542" class="note-text">等待/暂停/停止</text>
-
- <text x="1000" y="1145" text-anchor="middle" class="subtitle">COMPLETED 或 STOPPED 收到下一次合法 START:清除旧完成标志,重新校验并建立运行快照</text>
- </svg>
|