Skip to content

Fix ComplexConjugateControl reactive-gain sign error (K_r double-negative) - #10

Merged
salhus merged 2 commits into
mainfrom
copilot/fix-cc-reactive-gain-sign-error
Jul 8, 2026
Merged

Fix ComplexConjugateControl reactive-gain sign error (K_r double-negative)#10
salhus merged 2 commits into
mainfrom
copilot/fix-cc-reactive-gain-sign-error

Conversation

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

ComputeCCGains computed K_r = −ω²(I+A) + K_hs, which combined with the control law τ = −K_r·θ yielded τ_react = +(ω²(I+A) − K_hs)·θ — the wrong sign. The reactive torque reinforced the flap's reactance instead of cancelling it, causing ±0.92 rad runaway amplitude and negative mean absorbed power.

Changes

  • src/impedance.cppComputeCCGains (one-line fix + explanatory comment):

    // Before (wrong — double-negative):
    gains.K_r = -omega0 * omega0 * (I_flap_kgm2 + A55) + K_hs55;
    // After — K_r is the intrinsic pitch reactance; control law applies conjugate sign (−K_r·θ):
    gains.K_r = omega0 * omega0 * (I_flap_kgm2 + A55) - K_hs55;
  • src/impedance.h, src/active_pto.h, docs/CONTROLLERS.md — updated K_r formula in all doc comments/gain-derivation blocks to reflect the corrected sign.

ComplexConjugateControl::ComputeForce, all other controllers (passive, opt_passive, exc_ff_pid), PitchImpedanceMagnitude, and the CSV schema are unchanged.

Copilot AI changed the title [WIP] Fix the Complex-Conjugate Control reactive-gain sign error Fix ComplexConjugateControl reactive-gain sign error (K_r double-negative) Jul 8, 2026
Copilot finished work on behalf of salhus July 8, 2026 15:46
Copilot AI requested a review from salhus July 8, 2026 15:46
@salhus
salhus marked this pull request as ready for review July 8, 2026 15:46
@salhus
salhus merged commit 6fac772 into main Jul 8, 2026
@salhus
salhus deleted the copilot/fix-cc-reactive-gain-sign-error branch July 8, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants