<div dir="ltr"><div>As discussed last night.</div><div><br></div><div>Karim was right - it was easy.</div><div><br></div><div>Plus - we now have <b><i>additional <span style="background-color:rgb(255,255,0)">proof that <u><font color="#ff0000">algebra doesn't work on the weekends when the weather is nice outside</font></u></span>.</i></b></div><div><br></div><div>instead of cancelling out to zero, this term somehow wound up getting doubled</div><div><img src="cid:ii_kmnggdsw1" alt="image.png" width="542" height="178"><br></div><div><br></div><div>the ugly logic below still wants to be simplified & cleaned up.  But at least it now works correctly:</div><div><br></div><div>the method below calculates <b>fbTerm</b> for this summing node</div><div><br></div><div><b>setpoint - fbTerm = loop error </b></div><div><br></div><div>where <b>setpoint </b>has range [ 0 .. 360 ]</div><div><div>where<b> IMU outputs</b> [ 0 .. 360 ]</div><div></div></div><div>and where <b>error </b>has range [ -180 .. +180 ], to give the shortest rotation from current to setpoint</div><div><br></div><div><img src="cid:ii_kmngm2cn2" alt="image.png" width="542" height="378"><br></div><div><br></div><div>Anyhow...</div><div>Now onto cleanup, then to actually tuning the loop, then finally to more interesting behaviors...</div><div><br></div><div>Carl</div><div><br></div></div>