{
 "原理:回授與狀態機為什麼讓機器人穩定#2": {
  "type": "cards",
  "reveal": [
   0,
   2
  ],
  "cards": [
   {
    "title": "開迴路",
    "points": [
     "只送出固定的指令",
     "不看結果"
    ]
   },
   {
    "title": "閉迴路(回授)",
    "points": [
     "量測結果、跟目標比較",
     "再修正馬達的輸出"
    ]
   }
  ]
 },
 "原理:回授與狀態機為什麼讓機器人穩定#3": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   3,
   3,
   5,
   5
  ],
  "nodes": [
   {
    "label": "兩輪下 50%",
    "sub": "左 40、右 42 cm/s",
    "color": 0
   },
   {
    "label": "走 2 秒",
    "sub": "左 80 cm、右 84 cm",
    "color": 2
   },
   {
    "label": "差距",
    "sub": "4 cm",
    "color": 4
   },
   {
    "label": "÷ 輪距 14 cm",
    "sub": "≈ 0.286 rad",
    "color": 3
   },
   {
    "label": "航向偏移",
    "sub": "約 16.4°",
    "color": 1,
    "kind": "end"
   }
  ]
 },
 "原理:回授與狀態機為什麼讓機器人穩定#6": {
  "type": "table",
  "head": [
   "方式",
   "門檻",
   "結果"
  ],
  "widths": [
   1,
   1.5,
   2.4
  ],
  "reveal": [
   0,
   1,
   2
  ],
  "rows": [
   [
    "單一門檻",
    "20 cm",
    "雜訊 ±2 cm,狀態在 18 與 22 間一直跳"
   ],
   [
    "遲滯",
    "進入 < 20 cm,離開 > 30 cm",
    "中間 10 cm 維持原狀態"
   ]
  ]
 },
 "原理:回授與狀態機為什麼讓機器人穩定#7": {
  "type": "cards",
  "reveal": [
   0,
   2
  ],
  "cards": [
   {
    "title": "單一門檻",
    "points": [
     "狀態隨雜訊來回切換"
    ]
   },
   {
    "title": "遲滯",
    "points": [
     "進入、離開用不同門檻",
     "狀態保持穩定"
    ]
   }
  ]
 },
 "三感測器循線的控制邏輯#3": {
  "type": "table",
  "head": [
   "L M R",
   "意義",
   "動作"
  ],
  "widths": [
   0.8,
   1.4,
   2
  ],
  "reveal": [
   0,
   0,
   1,
   2,
   3,
   4,
   5
  ],
  "rows": [
   [
    "0 1 0",
    "線在正中間",
    "左 50、右 50,直走"
   ],
   [
    "1 1 0",
    "線偏左一點",
    "左 30、右 50"
   ],
   [
    "1 0 0",
    "線偏左很多",
    "左 10、右 50"
   ],
   [
    "0 1 1",
    "線偏右一點",
    "左 50、右 30"
   ],
   [
    "0 0 1",
    "線偏右很多",
    "左 50、右 10"
   ]
  ]
 },
 "三感測器循線的控制邏輯#4": {
  "type": "table",
  "head": [
   "L M R",
   "意義",
   "動作"
  ],
  "widths": [
   0.8,
   1.2,
   2.2
  ],
  "reveal": [
   0,
   1,
   2
  ],
  "rows": [
   [
    "0 0 0",
    "脫線",
    "依上一次方向搜尋"
   ],
   [
    "1 1 1",
    "全黑",
    "交叉口或終點,依任務處理"
   ]
  ]
 },
 "三感測器循線的控制邏輯#6": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   0,
   0,
   2,
   4,
   4
  ],
  "nodes": [
   {
    "label": "線偏左",
    "sub": "lastDir = −1",
    "color": 0
   },
   {
    "label": "線偏右",
    "sub": "lastDir = +1",
    "color": 1
   },
   {
    "label": "三顆都是 0",
    "sub": "脫線",
    "color": 4
   },
   {
    "label": "原地轉去找線",
    "sub": "朝最後的方向",
    "color": 2,
    "kind": "end"
   }
  ]
 },
 "三感測器循線的控制邏輯#7": {
  "type": "cards",
  "reveal": [
   0,
   2,
   3
  ],
  "cards": [
   {
    "title": "車速越快",
    "points": [
     "發現偏離時已衝出去越遠"
    ]
   },
   {
    "title": "彎很急",
    "points": [
     "降低速度",
     "或增加感測器數量"
    ]
   },
   {
    "title": "bang-bang",
    "points": [
     "左右搖擺、蛇行",
     "第六章用 PID"
    ]
   }
  ]
 },
 "避障:遲滯與安全距離#2": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "nodes": [
   {
    "label": "立即停止",
    "color": 4
   },
   {
    "label": "後退",
    "sub": "約 0.5 秒",
    "color": 2
   },
   {
    "label": "轉向",
    "sub": "約 0.6 秒",
    "color": 0
   },
   {
    "label": "再檢查前方",
    "sub": "夠遠才恢復前進",
    "color": 1,
    "kind": "end"
   }
  ]
 },
 "避障:遲滯與安全距離#3": {
  "type": "bar",
  "unit": " ms",
  "labels": [
   "停止",
   "後退",
   "轉向"
  ],
  "values": [
   200,
   500,
   600
  ],
  "reveal": [
   0,
   0,
   3,
   3,
   3,
   3
  ]
 },
 "避障:遲滯與安全距離#4": {
  "type": "waterfall",
  "unit": " cm",
  "reveal": [
   0,
   3,
   3
  ],
  "items": [
   {
    "label": "一個週期",
    "value": 2
   },
   {
    "label": "煞停距離",
    "value": 5
   },
   {
    "label": "安全距離",
    "value": 7,
    "kind": "total"
   }
  ]
 },
 "避障:遲滯與安全距離#5": {
  "type": "cards",
  "reveal": [
   0,
   2,
   2
  ],
  "cards": [
   {
    "title": "第一優先:避障",
    "points": [
     "先檢查距離",
     "太近就進入 AVOID"
    ]
   },
   {
    "title": "第二:循線",
    "points": [
     "沒有障礙才看循線"
    ]
   }
  ]
 },
 "狀態機:讓行為清楚且可擴充#2": {
  "type": "flow",
  "layout": "cycle",
  "reveal": [
   0,
   4
  ],
  "edges": [
   [
    0,
    1,
    "< 20 cm"
   ],
   [
    0,
    3,
    "沒看到線"
   ],
   [
    3,
    2,
    "逾時 3 秒"
   ]
  ],
  "nodes": [
   {
    "label": "FOLLOW",
    "sub": "循線前進",
    "color": 0
   },
   {
    "label": "AVOID",
    "sub": "> 30 cm 回循線",
    "color": 2
   },
   {
    "label": "STOP",
    "sub": "急停可從任何狀態進入",
    "color": 4
   },
   {
    "label": "SEARCH",
    "sub": "看到線回循線",
    "color": 3
   }
  ]
 },
 "狀態機:讓行為清楚且可擴充#3": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "FOLLOW",
    "points": [
     "循線前進",
     "距離 < 20 cm → AVOID",
     "沒看到線 → SEARCH"
    ]
   },
   {
    "title": "AVOID",
    "points": [
     "倒退並轉向",
     "前方 > 30 cm → FOLLOW"
    ]
   },
   {
    "title": "SEARCH",
    "points": [
     "朝最後方向搜尋",
     "看到線 → FOLLOW",
     "逾時 3 秒 → STOP"
    ]
   }
  ]
 }
}
