From 0c8703ac7362f3815b2917c372cc09ddafed7d11 Mon Sep 17 00:00:00 2001 From: bpmcgeeney Date: Sun, 12 Sep 2021 14:23:35 -0700 Subject: [PATCH] commenting --- src/sim.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sim.cpp b/src/sim.cpp index eb93056..0d706fe 100644 --- a/src/sim.cpp +++ b/src/sim.cpp @@ -198,6 +198,7 @@ void lqrCalc(struct sVars &Vars) */ + // Paste in Values from gainCalc.m double K11 = 39.54316; double K12 = 0.00000; double K13 = -0.00000; @@ -217,7 +218,7 @@ void lqrCalc(struct sVars &Vars) double K35 = 0.00000; double K36 = 39.54394; - double gain = 0.25 * pow(10, -4); + double gain = 0.25 * pow(10, -4); // changing exponenet drastically changes results of LQR // Matrix Multiply K with [YPR/2; w123] column vector and divide by moment arm Vars.LQRx = gain * ((K12 * Vars.pitch) / 2 + K15 * Vars.pitchdot + (K13 * Vars.roll) / 2 + K16 * Vars.rolldot + (K11 * Vars.yaw) / 2 + K14 * Vars.yawdot) / -Vars.momentArm;