@@ -164,11 +164,9 @@ let (; c2d, tf, feedback, lsim) = CS
164
164
G = feedback (C, P)
165
165
res = lsim (G, (x, t) -> [0.5 ], timevec)
166
166
y = res. y[:]
167
- @test_skip begin
168
- @test_broken sol (timevec .+ 1e-10 , idxs = model. plant. input. u)≈ y rtol= 1e-8 # Broken due to discrete observed
169
- # plot([y sol(timevec .+ 1e-12, idxs=model.plant.input.u)], lab=["CS" "MTK"])
170
- plot (timevec, [y sol (timevec .+ 1e-12 , idxs = model. controller. u)[:]], m = :o , lab = [" CS" " MTK" ])
171
- end
167
+ @test sol (timevec, idxs = model. plant. input. u)≈ y rtol= 1e-8
168
+ # plot([y sol(timevec, idxs=model.plant.input.u).u], lab=["CS" "MTK"])
169
+ # plot(timevec, [y sol(timevec, idxs = model.controller.u)[:]], m = :o, lab = ["CS" "MTK"])
172
170
end
173
171
# ==============================================================================
174
172
# # DiscretePIDStandard
@@ -183,7 +181,7 @@ k = ShiftIndex()
183
181
sampler = Sampler (; dt)
184
182
zoh = ZeroOrderHold ()
185
183
controller = DiscretePIDStandard (
186
- K = 2 , Ti = 1 , Imethod = :forward , with_D = false )
184
+ K = 2 , Ti = 1 , Imethod = :backward , with_D = false )
187
185
ref = Constant (k = 0.5 )
188
186
end
189
187
@equations begin
@@ -226,16 +224,14 @@ let (; c2d, tf, feedback, lsim) = CS
226
224
# plot(timevec, [y sol(timevec, idxs = model.plant.output.u)[:]], m = :o, lab = ["CS" "MTK"])
227
225
# display(current())
228
226
229
- @test_broken sol (timevec, idxs = model. plant. output. u)[:]≈ y rtol= 1e-6
227
+ @test sol (timevec, idxs = model. plant. output. u)[:]≈ y rtol= 1e-6
230
228
231
- @test_skip begin
232
- # Test the output of the discrete partition
233
- G = feedback (C, P)
234
- res = lsim (G, (x, t) -> [0.5 ], timevec)
235
- y = res. y[:]
236
- @test_broken sol (timevec .+ 1e-10 , idxs = model. controller. output. u)≈ y rtol= 1e-8 # Broken due to discrete observed
237
- # plot([y sol(timevec .+ 1e-12, idxs=model.controller.output.u)], lab=["CS" "MTK"])
238
- end
229
+ # Test the output of the discrete partition
230
+ G = feedback (C, P)
231
+ res = lsim (G, (x, t) -> [0.5 ], timevec)
232
+ y = res. y[:]
233
+ @test_broken sol (timevec, idxs = model. controller. u)≈ y rtol= 1e-8 # Broken due to LLVM error: ERROR: KeyError: key shift(controller₊I, -1, false, nothing) not found
234
+ # plot([y sol(timevec .+ 1e-12, idxs=model.controller.u).u], lab=["CS" "MTK"])
239
235
end
240
236
# ==============================================================================
241
237
# # Delay
0 commit comments