mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 12:02:09 +08:00
INDI: Time constant is used based on breakpoints (#19858)
* Time constant is used based on break points * no need for alpha class variable old-commit-hash: 76cf50066936e60a9a6c0fd144d48f33728e12c6
This commit is contained in:
@@ -40,7 +40,6 @@ class LatControlINDI():
|
||||
self._G = (CP.lateralTuning.indi.actuatorEffectivenessBP, CP.lateralTuning.indi.actuatorEffectivenessV)
|
||||
self._outer_loop_gain = (CP.lateralTuning.indi.outerLoopGainBP, CP.lateralTuning.indi.outerLoopGainV)
|
||||
self._inner_loop_gain = (CP.lateralTuning.indi.innerLoopGainBP, CP.lateralTuning.indi.innerLoopGainV)
|
||||
self.alpha = 1. - DT_CTRL / (self.RC + DT_CTRL)
|
||||
|
||||
self.sat_count_rate = 1.0 * DT_CTRL
|
||||
self.sat_limit = CP.steerLimitTimer
|
||||
@@ -104,7 +103,8 @@ class LatControlINDI():
|
||||
rate_des = math.radians(self.rate_steers_des)
|
||||
|
||||
# Expected actuator value
|
||||
self.delayed_output = self.delayed_output * self.alpha + self.output_steer * (1. - self.alpha)
|
||||
alpha = 1. - DT_CTRL / (self.RC + DT_CTRL)
|
||||
self.delayed_output = self.delayed_output * alpha + self.output_steer * (1. - alpha)
|
||||
|
||||
# Compute acceleration error
|
||||
rate_sp = self.outer_loop_gain * (steers_des - self.x[0]) + rate_des
|
||||
|
||||
Reference in New Issue
Block a user