@@ -164,11 +164,9 @@ let (; c2d, tf, feedback, lsim) = CS
164164 G = feedback (C, P)
165165 res = lsim (G, (x, t) -> [0.5 ], timevec)
166166 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"])
172170end
173171# ==============================================================================
174172# # DiscretePIDStandard
@@ -183,7 +181,7 @@ k = ShiftIndex()
183181 sampler = Sampler (; dt)
184182 zoh = ZeroOrderHold ()
185183 controller = DiscretePIDStandard (
186- K = 2 , Ti = 1 , Imethod = :forward , with_D = false )
184+ K = 2 , Ti = 1 , Imethod = :backward , with_D = false )
187185 ref = Constant (k = 0.5 )
188186 end
189187 @equations begin
@@ -226,16 +224,14 @@ let (; c2d, tf, feedback, lsim) = CS
226224 # plot(timevec, [y sol(timevec, idxs = model.plant.output.u)[:]], m = :o, lab = ["CS" "MTK"])
227225 # display(current())
228226
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
230228
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"])
239235end
240236# ==============================================================================
241237# # Delay
0 commit comments