開發紀錄:力矩算完、馬達選完之後——雲台控制的三層串級迴路,以及它跟六軸手臂差在哪

這是 LocalPapa Notes 開發紀錄系列的第二十五篇,也是雲台系列的第八篇。

回頭看前面七篇會發現一個明顯的斷點:第十八篇講怎麼量、第二十篇講機構、第二十一篇第二十四篇把「要多大的馬達」算到小數點後五位。但馬達裝上去之後呢?

f_bw 這個符號在系列裡出現了幾十次,卻從來沒有一篇說清楚它是哪一層迴路的頻寬、旁邊還有哪些層、它為什麼只能是那個數量級。這篇補上那塊。

文獻基礎

串級架構在雲台上是標準做法,文獻也很集中:

Abdo, M. M., Vali, A. R., Toloei, A. R., & Arvan, M. R. (2015). Improving two axes gimbal seeker performance using cascade control approach. Proc. IMechE Part G: Journal of Aerospace Engineering, 229(1), 38–55.

第二十四篇引的 Abdo 2013 是同一組作者。它先把穩定迴路的組成元件辨識出來,再分別定義傳統單迴路與串級迴路來比較,結論是串級在暫態與穩態響應上都優於單迴路。這篇也是同組作者從「建模」走到「控制架構」的那一步。

Cascade Control System for Two Axes Gimbal System with Mass Unbalance (2013). 同一組作者更早的會議論文,把質量不平衡放進串級架構裡處理。

Cascade servo control for LOS stabilization of opto-electronic tracking platform — design and self-tuning. 光電追蹤平台的串級伺服設計與自整定。

這些論文解的是「串級比單迴路好在哪」。它們不太談各層頻寬怎麼分配——那部分是伺服工程的通用實務,下面第二節整節都在講,並標明哪些是通用規則、哪些是本系列自己的數字。

一、三層各自在做什麼

三層串級:從目標指令到三相電壓 三層串級:從目標指令到三相電壓 位置/追蹤環 約 2.4 Hz 速率/穩定環 f_bw 12 Hz 電流環(FOC) 約 1.7 kHz 馬達+機構 目標指令 角度誤差 ω* 速率誤差 T* 電流誤差 V 視線 LOS 擾動:載體運動、風阻、摩 電流感測 陀螺(慣性角速率) 編碼器/影像 ω* 角速率指令 T* 力矩指令 V 三相電壓 由內而外調參:電流環先鎖,速率環才有意義;速率環沒調好,位置環調什麼都沒用。
圖 1:三層串級的完整方塊圖。三條回授來自不同感測器——電流環用電流感測、速率環用陀螺、位置環用編碼器或影像。擾動(載體運動、風阻、摩擦)從受控體注入,這也是為什麼速率環才是「穩定」的那一層。

由內而外:

電流環(FOC) —— 把「我要多少力矩」變成三相電壓。它閉的是電流,而 T = Kt · I,所以控制電流就是控制力矩。這一層的存在讓上層可以直接對「力矩」下指令,不用管換相、反電動勢、電感這些電氣細節。

速率環(穩定環) —— 這一層才是「穩定平台」的穩定。它用陀螺量到的慣性空間角速率當回授,把它壓到指令值。載體晃動時,陀螺立刻看到 LOS 在動,速率環反向出力抵消。第二十一篇第一層講的「馬達的工作是抵消不是固定」,講的就是這一層。

位置環(追蹤環) —— 決定「指到哪」。回授可以是編碼器(指到某個框架角度)或影像(把目標壓在畫面中心)。它的輸出是給速率環的角速率指令,而不是直接給馬達。

三層的分工可以記成一句話:電流環管力矩、速率環管穩定、位置環管指向。

擾動是從受控體注入的,不是從指令端。這解釋了為什麼位置環對抗擾動幾乎沒有幫助——它太慢了,等它反應過來畫面早就糊了。抗擾動是速率環的工作,這也是 f_bw 被稱為「抗擾頻寬」的原因。

二、頻寬為什麼必須差五倍

頻寬階梯:每一層的位置都是被上下夾出來的 頻寬階梯:每一層的位置都是被上下夾出來的 1 10 100 1k 10k 頻率(Hz,對數) 位置環 2.4 Hz 速率環 f_bw 12 Hz 結構共振 ≥ 60 Hz 電流環 ≈ 1.7 kHz PWM 20 kHz ↓ 分離規則:至少差 5 倍 ↑ 第 21 篇第六層:f_res / f_bw ≥ 5 電流環由 PWM 與數位延遲決定,不是由分離規則決定——結果遠快於需求,所以上層可以把它當純增益。中間三層是連動的:機構的共振壓住速率環,速率環又壓住位置環。想要位置環更快,得先從機構下手。
圖 2:頻寬階梯。中間三層是連動的——機構的結構共振壓住速率環,速率環又壓住位置環。電流環不在這條鏈上,它由 PWM 與數位延遲決定。

串級能成立的前提是:內層對外層而言必須「快到可以當成一個純增益」。通用的經驗規則是內層至少比外層快 3–5 倍;差得不夠,內層的動態會跑進外層的相位裕度裡,兩層互相打架。

把系列一路用的數字代進去:

  • 速率環 f_bw = 12 Hz —— 這是系列從第二十一篇用到現在的那個值。
  • 位置環 ≤ 12 / 5 = 2.4 Hz —— 分離規則的上限。想要更快的追蹤,得先把速率環做快。
  • 結構共振 f_res ≥ 12 × 5 = 60 Hz —— 這是第二十一篇第六層那條 f_res / f_bw ≥ 5 的另一種讀法。機構的第一階模態壓住速率環的天花板。

電流環不在這條鏈上。 它由 PWM 開關頻率與數位延遲決定,20 kHz 的開關頻率大約給到 1.7 kHz 的電流環頻寬——比分離規則要求的(速率環的 5 倍 = 60 Hz)快了將近三十倍。正因為快這麼多,上層才能安心把它當成純增益忽略掉。

這條階梯最有用的一點是它把責任歸屬講清楚了:位置環慢,多半不是位置環的錯。 往回追是速率環不夠快;速率環不夠快,往回追是機構的共振太低。想要更快的追蹤響應,第一件事是去看機構,不是去調 PID。

三、調參一定要由內而外

順序不是偏好問題,是因果問題:

  1. 先鎖電流環 —— 用馬達的 RL 算 PI 增益,量階躍響應確認沒有超調與振盪。電流環沒鎖好,速率環看到的「力矩指令」跟實際力矩對不上,後面調什麼都是在補電流環的錯。
  2. 再調速率環 —— 這一層要配合第十八篇的量測:搖擺台掃頻,看抗擾頻率響應的 0 dB 穿越點。同時把陷波濾波器擺在 f_res 上。
  3. 最後才是位置環 —— 頻寬吃分離規則的上限,通常只需要 P 或 PI。

中間穿插的補償(都疊在速率環上,不是另一層):

  • 陷波濾波 —— 壓 f_res。代價是陷波點會隨溫度、酬載、磨耗漂移(第二十一篇第六層有提)。
  • 摩擦補償 —— LuGre 前饋,第十九、二十二篇整理過文獻。低速過零點是雲台最常待的工作點,這一項的回報很直接。
  • 擾動觀測器 / ADRC —— 把沒建模的東西即時估出來抵消(第二十二篇第一、二類)。
  • 增益排程 —— 見第五節。

四、雲台需要運動學嗎?

這是一個從六軸機械手臂帶過來的問題,值得單獨一節,因為答案是「需要,但只需要一小塊」——而且那一小塊你可能已經算過了。

雲台需要運動學嗎?跟六軸手臂的對照 雲台需要運動學嗎?跟六軸手臂的對照 六軸機械手臂 雙軸雲台 6 DOF 2 DOF 任務 把末端送到空間中的一個位姿(3 位置+3 姿態) 把一條視線指向一個方向(2 自由度) 正運動學 q → 位姿,6 個連桿的齊次變換連乘 LOS = R_az(ψ)·R_el(θ)·x̂,一行 逆運動學 數值或解析解、多組解、要選解 兩個 atan2,閉式唯一解 Jacobian 6×6,速度控制與力控的核心 2×2,行列式 = cos(el) 奇異點 手腕/肩/肘,可用第七軸繞開 gimbal lock,雙軸無冗餘可繞 動力學 M(q)q̈ + C(q,q̇)q̇ + G(q) = τ 同一式的縮減版,Ekstrand 2001 推的就是它 參考系 基座固定,一切相對基座 基座在動,目標固定在慣性/地理系 主導迴路 位置環(IK 主導) 速率環(陀螺主導) 結論:運動學需要,但只需要一小塊——而那一塊就是 Jacobian,也就是你已經在算的 yaw gain。
圖 3:六軸手臂與雙軸雲台的運動學對照。手臂的難點在逆運動學與位姿;雲台的逆運動學是兩個 atan2,難點全部集中在 Jacobian 與參考系。

正逆運動學:幾乎不用

手臂的正運動學是六個連桿的齊次變換連乘,逆運動學要解析或數值求解、還有多組解要挑。雲台完全沒有這個問題,因為它不搬運「位置」,只指「方向」:

LOS = R_az(ψ) · R_el(θ) · x̂

一行就寫完,而且逆運動學是閉式的:給定目標方向的單位向量 [x, y, z]

ψ = atan2(y, x)θ = asin(z)

兩個 atan2 等級的運算,唯一解,沒有選解問題。雲台沒有「逆運動學求解器」這種東西。

Jacobian:這一塊才是重點,而且你已經在算了

手臂的 6×6 Jacobian 是速度控制與力控的核心。雲台的是 2×2,而它的行列式就是 cos(el)

這代表兩件事,而且都在第二十四篇出現過:

  • Jacobian 掉秩的地方就是 gimbal lock —— 跟手臂的手腕奇異點是同一個數學現象。
  • Jacobian 的逆就是 yaw gain —— ω_az = ω_LOS / cos(el) 那條式子,就是在對 Jacobian 求逆。第二十四篇整篇在算的東西,用手臂的語言講就是「靠近奇異點時逆 Jacobian 的元素發散」。

差別在於:六軸手臂可以用第七軸的冗餘繞開奇異點,雙軸雲台做 2 自由度的工作,冗餘度是零——所以繞不開,只能劃禁區或改機構。

動力學:是同一條式子的縮減版

手臂的 M(q)q̈ + C(q,q̇)q̇ + G(q) = τ 每一項在雲台上都找得到對應:

  • M(q)J_az(el),隨姿態變化的慣量(第二十四篇算過,全行程差 1.81 倍)
  • C(q,q̇)q̇ → 軸間耦合項(Ekstrand 2001 推的就是這些,並指出可用慣量對稱條件消掉一部分)
  • G(q)重力力矩 m·g·e·cos(el),配平後的殘留

所以動力學不是不需要,是已經被 Ekstrand 收斂成幾項具名的東西,不必每次重推。

真正差最多的兩件事

前面都是「雲台比較簡單」,但有兩處雲台更麻煩

第一,參考系是慣性系,不是基座。 手臂的基座固定,所有東西相對基座定義,編碼器讀數經正運動學就是末端的真實位姿。雲台的基座在動——那正是整個問題。編碼器只告訴你框架相對機身轉了多少,機身自己在晃,所以編碼器推不出真實的 LOS。這就是為什麼雲台一定要陀螺,而手臂不用。第二十篇引的 Kennedy & Kennedy 2003 討論的「直接 vs 間接量測」就是這件事。

第二,主導迴路不同。 手臂的核心是位置環,運動學(IK)主導;雲台的核心是速率環,抗擾動主導。所以整個控制架構的重心不一樣——手臂的難題在「算得準」,雲台的難題在「反應得快」。

一句話回答:運動學需要,但只需要 Jacobian 那一塊,而它就是 yaw gain。 正逆運動學各一行,動力學被文獻收斂好了。真正要花力氣的地方從運動學移到了兩個手臂沒有的問題上:慣性參考系,與速率環的抗擾頻寬。

五、俯仰角相依落在兩個不同的層

這一節把第二十四篇的結論接回控制架構。方位軸的俯仰角相依其實有兩個,落在不同的層,補償方式也不同——這兩件事常被混為一談。

俯仰角相依落在兩個不同的層,補償方式也不同 俯仰角相依落在兩個不同的層,補償方式也不同 速率環:迴路增益 ∝ 1 / J_az(el) 0.00 1.00 2.00 全行程只變 1.81 倍——固定增益通常撐得住 追蹤環:LOS 換算 ∝ cos(el) 0.00 0.50 1.00 趨近 0——不補償就完全失去追蹤能力 0 20 40 60 80 俯仰角(度) 速率環的變化溫和,可以用固定增益吃掉;追蹤環的 cos(el) 不行,指令端必須乘上 1/cos(el)。這兩件事常被混為一談。
圖 4:兩個俯仰角相依。上:速率環的迴路增益隨 1/J_az(el) 變化,全行程只差 1.81 倍。下:追蹤環的 LOS 換算隨 cos(el) 趨近 0。

速率環:J_az(el) 的變化。 速率環閉在方位框架的陀螺上,看到的受控體是「馬達 + J_az」。迴路增益大致與 1/J_az 成正比,而 J_az 全行程只變 1.81 倍——這個量級通常落在增益裕度裡,固定增益撐得住

追蹤環:cos(el) 的變化。 這一層要把「LOS 要動多少」換成「方位軸要動多少」,中間隔著 cos(el)。它趨近於 0,不是 1.81 倍的問題。不補償的話,越接近正下方,同樣的追蹤誤差產生的方位指令越不夠,最後完全失去追蹤能力。

所以補償方式不同:

  • 速率環 → 固定增益就好(除非你的 J_az 變化遠大於 1.81 倍)
  • 追蹤環 → 指令端必須乘上 1/cos(el),這就是 yaw gain 補償

1/cos(el) 在接近奇異點時發散,所以補償本身也有上限——那個上限就是第二十四篇算出來的天底禁區。控制上補不過去的地方,是被馬達的轉速上限擋住的,不是被演算法擋住的。

這篇的邊界

  • 各層頻寬的數字是從系列自己的 f_bw = 12 Hz 與分離規則推出來的,不是產業統計值。你的 f_bw 不同,整條階梯就跟著平移。
  • 分離規則的 3–5 倍是經驗法則,不是定理。實際的裕度要看相位圖,不是看倍數。
  • 電流環 1.7 kHz 是由 20 kHz PWM 粗估的,實際值受數位延遲、電流取樣時序、馬達電感影響很大,要以驅動器實測的閉迴路頻率響應為準。
  • 本篇只談單軸的迴路結構。 軸間耦合的完整處理(多輸入多輸出設計)不在範圍內,那要回到 Ekstrand 或 Kane 法的完整模型。

怎麼跟我協作

要把這套套進你的雲台,準備這些:

  • 馬達的 RLKt(電流環增益從這裡算)
  • 驅動器的 PWM 頻率與電流取樣方式(決定電流環頻寬上限)
  • 機構的第一階共振頻率 f_res(決定速率環天花板,第十八篇有量法)
  • 陀螺的雜訊底線與頻寬(決定速率環的訊號品質下限)
  • 追蹤來源是編碼器還是影像,以及影像的延遲(影像延遲常常是位置環真正的瓶頸)

缺哪一項就說缺,我不會替你猜一個填進去。

參考文獻

  • Abdo, M. M., Vali, A. R., Toloei, A. R., & Arvan, M. R. (2015). Improving two axes gimbal seeker performance using cascade control approach. Proc. IMechE Part G: Journal of Aerospace Engineering, 229(1), 38–55. DOI: 10.1177/0954410014525130
  • Abdo, M., Toloei, A. R., Vali, A. R., & Arvan, M. R. (2013). Cascade Control System for Two Axes Gimbal System with Mass Unbalance. 連結
  • Cascade servo control for LOS stabilization of opto-electronic tracking platform — design and self-tuning. 連結
  • Ekstrand, B. (2001). Equations of Motion for a Two-Axes Gimbal System. IEEE Transactions on Aerospace and Electronic Systems, 37(3), 1083–1091. 連結
  • Kennedy, P. J., & Kennedy, R. L. (2003). Direct versus Indirect Line of Sight (LOS) Stabilization. IEEE Transactions on Control Systems Technology, 11(1), 3–15.
  • Hilkert, J. M. (2008). Inertially Stabilized Platform Technology: Concepts and Principles. IEEE Control Systems Magazine, 28(1), 26–46.

上一篇:雙軸雲台的馬達怎麼挑。想試算馬達規格?雲台馬達選型計算機。想追蹤系列後續?把 LocalPapa Notes 加入書籤吧。

Dev Log: After the Torque and the Motor — A Gimbal's Three-Loop Cascade, and How It Differs From a 6-Axis Arm

This is the twenty-fifth post in the LocalPapa Notes dev-log series, and the eighth on gimbals.

Looking back over the previous seven, there is an obvious gap. Post 18 covered measurement, post 20 the mechanism, and posts 21 through 24 worked out "how big a motor" to five decimal places. But what happens once the motor is bolted on?

The symbol f_bw appears dozens of times across the series without any post ever saying which loop it belongs to, what other loops sit beside it, or why it can only be that order of magnitude. This post fills that in.

The literature

Cascade architecture is standard practice for gimbals and the literature is concentrated:

Abdo, M. M., Vali, A. R., Toloei, A. R., & Arvan, M. R. (2015). Improving two axes gimbal seeker performance using cascade control approach. Proc. IMechE Part G: Journal of Aerospace Engineering, 229(1), 38–55.

Same author group as the Abdo 2013 cited in post 24. It first identifies the stabilization loop's components, then defines a conventional single loop and a cascade loop to compare, concluding that cascade improves both transient and steady-state response. This is also that group's step from modeling into control architecture.

Cascade Control System for Two Axes Gimbal System with Mass Unbalance (2013). The same group's earlier conference paper, folding mass unbalance into the cascade.

Cascade servo control for LOS stabilization of opto-electronic tracking platform — design and self-tuning. Cascade servo design and self-tuning for an opto-electronic tracking platform.

These papers answer "why cascade beats a single loop." They say little about how to allocate bandwidth between layers — that is general servo practice, which section two covers, marked clearly as to what is a general rule and what is this series' own number.

1. What each layer does

The three-loop cascade: from target command to three-phase voltage The three-loop cascade: from target command to three-phase voltage Position / track loop about 2.4 Hz Rate / stabilization loop f_bw 12 Hz Current loop (FOC) about 1.7 kHz Motor + mechanism Target command angle error ω* rate error T* current error V Line of sight Disturbance: basemotion, wind, friction current sense gyro (inertial rate) encoder / image ω* rate command T* torque command V three-phase voltage Tune inside out: lock the current loop first or the rate loop is meaningless; with a bad rate loop, nothing you do to theposition loop helps.
Figure 1: the full three-loop cascade. The three feedback paths come from different sensors — current sense, gyro, and encoder or image. Disturbance enters at the plant, which is why the rate loop is the one that does the "stabilizing."

Inside out:

Current loop (FOC) — turns "how much torque I want" into three-phase voltage. It closes on current, and since T = Kt · I, controlling current is controlling torque. This layer is what lets the outer loops command torque without dealing with commutation, back-EMF, or inductance.

Rate loop (stabilization loop)this is the layer that does the stabilizing in "stabilized platform." It feeds back the gyro's measurement of inertial angular rate and drives it to the commanded value. When the airframe moves, the gyro sees the LOS moving immediately and the rate loop pushes back. "The motor's job is to cancel, not to hold," from post 21 layer 1, describes this layer.

Position loop (track loop) — decides where to point. Feedback can be the encoder (hold a frame angle) or the image (keep the target centered). Its output is an angular rate command to the rate loop, not a direct motor command.

The division of labour fits in one sentence: current loop owns torque, rate loop owns stability, position loop owns pointing.

Disturbance enters at the plant, not at the command input. That is why the position loop barely helps against disturbance — it is far too slow; by the time it reacts the image has already smeared. Disturbance rejection is the rate loop's job, which is why f_bw is called the disturbance-rejection bandwidth.

2. Why the bandwidths must differ by five times

The bandwidth ladder: every layer is squeezed from both sides The bandwidth ladder: every layer is squeezed from both sides 1 10 100 1k 10k Frequency (Hz, log) Position loop 2.4 Hz Rate loop f_bw 12 Hz Structural resonance ≥ 60 Hz Current loop ≈ 1.7 kHz PWM 20 kHz ↓ separation rule: at least 5× ↑ post 21 layer 6: f_res / f_bw ≥ 5 The current loop is set by PWM and digital delay, not by the separation rule — it ends up far faster than needed, which is whythe outer loops can treat it as a plain gain.The middle three are linked: the mechanism's resonance caps the rate loop, and the rate loop caps the position loop. Want afaster position loop? Start with the mechanism.
Figure 2: the bandwidth ladder. The middle three are linked — the mechanism's structural resonance caps the rate loop, and the rate loop caps the position loop. The current loop is not on that chain; it is set by PWM and digital delay.

Cascade only works if the inner loop is fast enough to look like a plain gain to the outer one. The general rule of thumb is that the inner loop should close at least 3–5× faster; any less and the inner dynamics eat into the outer loop's phase margin and the two fight each other.

Substituting the series' own numbers:

  • Rate loop f_bw = 12 Hz — the value this series has used since post 21.
  • Position loop ≤ 12 / 5 = 2.4 Hz — the separation rule's ceiling. Want faster tracking? Make the rate loop faster first.
  • Structural resonance f_res ≥ 12 × 5 = 60 Hz — another way of reading the f_res / f_bw ≥ 5 constraint from post 21 layer 6. The mechanism's first mode caps the rate loop.

The current loop is not on that chain. It is set by PWM switching frequency and digital delay; a 20 kHz switching frequency gives roughly a 1.7 kHz current loop — nearly thirty times faster than the separation rule would demand (5 × the rate loop = 60 Hz). Precisely because it is that much faster, the outer loops can safely treat it as a plain gain.

The most useful thing about this ladder is that it assigns blame. A slow position loop is usually not the position loop's fault. Trace back and the rate loop is too slow; trace back again and the mechanism's resonance is too low. If you want faster tracking response, the first thing to look at is the mechanism, not the PID.

3. Tuning has to go inside out

The order is not a preference, it's causal:

  1. Lock the current loop first — compute PI gains from the motor's R and L, and check the step response for overshoot and ringing. If the current loop isn't right, the "torque command" the rate loop thinks it is issuing does not match actual torque, and everything you tune afterwards is compensating for the current loop's error.
  2. Then the rate loop — this is where post 18's measurement comes in: sweep on a shaker table and read the 0 dB crossing of the disturbance-rejection response. Place the notch filter on f_res at the same time.
  3. The position loop last — take the separation rule's ceiling as its bandwidth; usually P or PI is enough.

Compensators layered in between (all riding on the rate loop, not a separate layer):

  • Notch filter — suppresses f_res. The cost is that the notch drifts with temperature, payload, and wear (post 21 layer 6 notes this).
  • Friction compensation — LuGre feed-forward, literature surveyed in posts 19 and 22. Low-speed zero crossing is where a gimbal spends most of its time, so this one pays off directly.
  • Disturbance observer / ADRC — estimate the unmodeled part in real time and cancel it (post 22, clusters 1 and 2).
  • Gain scheduling — see section 5.

4. Does a gimbal need kinematics?

A question carried over from 6-axis robot arms, and it deserves its own section, because the answer is "yes, but only a small slice" — and you may have already computed that slice.

Does a gimbal need kinematics? Compared with a 6-axis arm Does a gimbal need kinematics? Compared with a 6-axis arm 6-axis robot arm Two-axis gimbal 6 DOF 2 DOF Task Put the end effector at a pose (3 position + 3 orientation) Point one line in a direction (2 DOF) Forward kin. q → pose, six link transforms multiplied LOS = R_az(ψ)·R_el(θ)·x̂ — one line Inverse kin. Numeric or analytic, multiple solutions, must pick Two atan2 calls, closed form, unique Jacobian 6×6, the core of velocity and force control 2×2, determinant = cos(el) Singularity Wrist / shoulder / elbow; a 7th axis can dodge them Gimbal lock; two axes have no redundancy Dynamics M(q)q̈ + C(q,q̇)q̇ + G(q) = τ A reduced form of the same — what Ekstrand 2001 derives Reference Base is fixed, everything relative to it Base is moving; target fixed in inertial / geo frame Dominant loop Position loop (IK-driven) Rate loop (gyro-driven) Verdict: you need kinematics, but only a small slice — and that slice is the Jacobian, which is the yaw gain you are already computing.
Figure 3: kinematics compared between a 6-axis arm and a two-axis gimbal. The arm's difficulty is inverse kinematics and pose; the gimbal's inverse kinematics is two atan2 calls, and all the difficulty concentrates in the Jacobian and the reference frame.

Forward and inverse kinematics: barely needed

An arm's forward kinematics is six link transforms multiplied together, and its inverse kinematics needs an analytic or numeric solve plus solution selection. A gimbal has none of that, because it does not move a position, it points a direction:

LOS = R_az(ψ) · R_el(θ) · x̂

One line, and the inverse is closed form: given a target unit vector [x, y, z],

ψ = atan2(y, x), θ = asin(z)

Two atan2-class operations, unique solution, nothing to choose between. There is no such thing as an "IK solver" for a gimbal.

The Jacobian: this is the part that matters, and you already compute it

An arm's 6×6 Jacobian is the core of velocity and force control. A gimbal's is 2×2, and its determinant is cos(el).

That means two things, both of which appeared in post 24:

  • Where the Jacobian loses rank is gimbal lock — the same mathematical phenomenon as an arm's wrist singularity.
  • The Jacobian's inverse is the yaw gainω_az = ω_LOS / cos(el) is inverting the Jacobian. Everything post 24 computed, said in arm language, is "the inverse Jacobian's entries blow up near the singularity."

The difference: a 6-axis arm can use a 7th axis's redundancy to dodge singularities; a two-axis gimbal doing a 2-DOF job has zero redundancy — so it cannot dodge, only draw a keep-out cone or change the mechanism.

Dynamics: a reduced form of the same equation

Every term in an arm's M(q)q̈ + C(q,q̇)q̇ + G(q) = τ has a gimbal counterpart:

  • M(q)J_az(el), configuration-dependent inertia (post 24 computed it: 1.81× across full travel)
  • C(q,q̇)q̇ → cross-axis coupling terms (what Ekstrand 2001 derives, noting some can be removed by inertia symmetry conditions)
  • G(q)gravity torque m·g·e·cos(el), the residual after balancing

So dynamics is not unnecessary — it has already been collapsed by Ekstrand into a few named terms, so you don't re-derive it each time.

The two places where the gimbal is actually harder

Everything above says "the gimbal is simpler." Two things are not:

First, the reference frame is inertial, not the base. An arm's base is fixed, everything is defined relative to it, and forward kinematics from encoders gives the true end-effector pose. **A gimbal's base is moving — that is the problem.** Encoders only tell you how far the frame turned relative to the airframe, and the airframe is moving, so encoders cannot give you the true LOS. That is why a gimbal needs a gyro and an arm does not. It's exactly the "direct versus indirect sensing" question in Kennedy & Kennedy 2003, cited in post 20.

Second, the dominant loop differs. The arm's core is the position loop, driven by kinematics. The gimbal's core is the rate loop, driven by disturbance rejection. The whole architecture's center of gravity is different — the arm's hard problem is computing accurately; the gimbal's is reacting quickly.

One-sentence answer: you need kinematics, but only the Jacobian slice, and that slice is the yaw gain. Forward and inverse are one line each, and the dynamics has been pre-collapsed by the literature. The real effort moves from kinematics to two problems the arm does not have: the inertial reference frame, and the rate loop's disturbance-rejection bandwidth.

5. Elevation dependence lands on two different layers

This section connects post 24's conclusion back to the control architecture. The azimuth axis has two elevation dependencies, they sit on different layers, and they need different fixes — the two are frequently conflated.

Elevation dependence lands on two different layers, and they need different fixes Elevation dependence lands on two different layers, and they need different fixes Rate loop: loop gain ∝ 1 / J_az(el) 0.00 1.00 2.00 Varies only 1.81× over full travel — fixed gain usually copes Track loop: LOS mapping ∝ cos(el) 0.00 0.50 1.00 Goes to zero — withoutcompensation, tracking authoritydisappears 0 20 40 60 80 Elevation (degrees) The rate loop varies gently and a fixed gain absorbs it. The track loop's cos(el) does not — the command side mustmultiply by 1/cos(el). These two are often conflated.
Figure 4: the two elevation dependencies. Top: the rate loop's loop gain varies as 1/J_az(el), only 1.81× across full travel. Bottom: the track loop's LOS mapping goes as cos(el), approaching zero.

Rate loop: the J_az(el) variation. The rate loop closes on the azimuth frame's gyro and sees a plant of "motor + J_az". Loop gain goes roughly as 1/J_az, and J_az varies only 1.81× over the whole travel — that magnitude usually sits inside the gain margin, so a fixed gain copes.

Track loop: the cos(el) variation. This layer converts "how much the LOS should move" into "how much azimuth should move," with cos(el) in between. It approaches zero — not a 1.81× problem. Uncompensated, the closer to straight down, the less azimuth command a given tracking error produces, until tracking authority disappears entirely.

So the fixes differ:

  • Rate loop → a fixed gain is fine (unless your J_az varies far more than 1.81×)
  • Track loop → the command side must multiply by 1/cos(el) — that is yaw gain compensation

And 1/cos(el) diverges near the singularity, so the compensation itself has a ceiling — and that ceiling is exactly the nadir keep-out cone computed in post 24. Where control cannot compensate, it is the motor's speed limit blocking you, not the algorithm.

The limits of this analysis

  • The per-layer bandwidth numbers are derived from this series' own f_bw = 12 Hz plus the separation rule, not from industry statistics. A different f_bw shifts the whole ladder.
  • The 3–5× separation rule is a rule of thumb, not a theorem. Real margin comes from the phase plot, not from a ratio.
  • The 1.7 kHz current loop is a rough estimate from 20 kHz PWM. The real value depends heavily on digital delay, current sampling timing, and motor inductance — use the drive's measured closed-loop frequency response.
  • This post covers single-axis loop structure only. Full treatment of cross-axis coupling (MIMO design) is out of scope; that goes back to Ekstrand's or Kane's full model.

How to work through this with me

To apply this to your gimbal, have these ready:

  • The motor's R, L, Kt (current loop gains come from these)
  • The drive's PWM frequency and current sampling scheme (sets the current loop's ceiling)
  • The mechanism's first resonance f_res (sets the rate loop's ceiling; post 18 covers measuring it)
  • The gyro's noise floor and bandwidth (sets the rate loop's signal quality floor)
  • Whether tracking comes from encoders or imagery, and the image latency (image latency is often the position loop's real bottleneck)

If something's missing, say it's missing — I won't guess a value and fill it in for you.

References

  • Abdo, M. M., Vali, A. R., Toloei, A. R., & Arvan, M. R. (2015). Improving two axes gimbal seeker performance using cascade control approach. Proc. IMechE Part G: Journal of Aerospace Engineering, 229(1), 38–55. DOI: 10.1177/0954410014525130
  • Abdo, M., Toloei, A. R., Vali, A. R., & Arvan, M. R. (2013). Cascade Control System for Two Axes Gimbal System with Mass Unbalance. Link
  • Cascade servo control for LOS stabilization of opto-electronic tracking platform — design and self-tuning. Link
  • Ekstrand, B. (2001). Equations of Motion for a Two-Axes Gimbal System. IEEE Transactions on Aerospace and Electronic Systems, 37(3), 1083–1091. Link
  • Kennedy, P. J., & Kennedy, R. L. (2003). Direct versus Indirect Line of Sight (LOS) Stabilization. IEEE Transactions on Control Systems Technology, 11(1), 3–15.
  • Hilkert, J. M. (2008). Inertially Stabilized Platform Technology: Concepts and Principles. IEEE Control Systems Magazine, 28(1), 26–46.

Previous post: Sizing Motors for a Two-Axis Gimbal. Want to size a motor? Gimbal Motor Sizing Calculator. Want to follow the series? Bookmark LocalPapa Notes.

探索 61 個隱私優先的瀏覽器工具
全程本地運算、檔案不上傳。
前往 LocalPapa →
Explore 61 privacy-first browser tools
Everything runs locally — your files never leave your device.
Visit LocalPapa →

想看英文版?點右上角 EN 切換語言。

Prefer Chinese? Tap at the top-right to switch.