Skip to content
Success

Changes

Summary

  1. Add DirectionTracker and wire it up to BetterController (commit: f527fad) (details)
Commit f527fad64d7825df829e6402cb9049bbcce558e1 by lamont
Add DirectionTracker and wire it up to BetterController

The DirectionTracker is my attempt to solve the problem of splitting
up desired vs current pitch/yaw/roll so that I can implement LQRs and
2DOF PID controllers.  It attempts to track small tick-to-tick
deltas and use them to accumulate a value which will not suffer from
gimbal lock issues or 2pi wraparound issues.  When the controller axis
is reset then in addition to clobbering the PID integral states, it also
zeros the DirectionTracker.  Since the error calc is still mathematically
identical at the end of the day it really shouldn't change the
BetterController much (i hope).

This also adds an LQR based controller which is just a proof of concept
that I can actually wire up an LQR controller.  It also uses the
DirectionTracker.  It does not usably fly a rocket in its current form.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
(commit: f527fad)
The file was addedMechJebLib/Control/MultiVariableInterpolator.cs
The file was modified MechJebLib/Primitives/M3.cs (diff)
The file was addedMechJebLib/Control/MultiVariableGrid.cs
The file was modified MechJeb2/MechJebModuleAttitudeController.cs (diff)
The file was modified MechJeb2/MechJebModuleAttitudeAdjustment.cs (diff)
The file was modified MechJeb2/AttitudeControllers/BetterController.cs (diff)
The file was addedMechJebLib/Control/LQRLoop1.cs
The file was modified MechJebLib/MechJebLib.csproj (diff)
The file was addedMechJeb2/AttitudeControllers/LQRController.cs
The file was modified MechJeb2/MechJeb2.csproj (diff)
The file was modified MechJeb2.sln.DotSettings (diff)
The file was addedMechJeb2/AttitudeControllers/DirectionTracker.cs