Skip to content

Commit 80b580d

Browse files
committed
scale integrators by sample time
1 parent d88e6bb commit 80b580d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/model_augmentation.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Gd = add_output_integrator(add_output_differentiator(G), 1)
109109
Note: numerical integration is subject to numerical drift. If the output of the system corresponds to, e.g., a velocity reference and the integral to position reference, consider methods for mitigating this drift.
110110
"""
111111
function add_output_integrator(sys::AbstractStateSpace{<: Discrete}, ind=1; ϵ=0)
112-
int = tf(1.0, [1, -(1-ϵ)], sys.Ts)
112+
int = tf(1.0*sys.Ts, [1, -(1-ϵ)], sys.Ts)
113113
𝟏 = tf(1.0,sys.Ts)
114114
𝟎 = tf(0.0,sys.Ts)
115115
M = [i==j ? 𝟏 : 𝟎 for i = 1:sys.ny, j = 1:sys.ny]
@@ -131,7 +131,7 @@ function add_input_integrator(sys::AbstractStateSpace, ui=1; ϵ=0)
131131
Cd = zeros(T, 1, nx+1)
132132
Cd[end] = 1
133133
Bd = zeros(T, 1, nu)
134-
Bd[ui] = 1
134+
Bd[ui] = ControlSystems.isdiscrete(sys) ? sys.Ts : 1
135135
Ad = -ϵ*I(1)
136136
isdiscrete(sys) && (Ad += I)
137137

0 commit comments

Comments
 (0)