@@ -52,7 +52,7 @@ A smaller `T` leads to a more ideal approximation of the derivative.
52
52
- `output`
53
53
"""
54
54
@component function Derivative (; name, k = 1 , T, x_start = 0.0 )
55
- T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
55
+ @symcheck T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
56
56
@named siso = SISO ()
57
57
@unpack u, y = siso
58
58
sts = @variables x (t)= x_start [description = " State of Derivative $name " ]
@@ -98,7 +98,7 @@ sT + 1 - k
98
98
See also [`SecondOrder`](@ref)
99
99
"""
100
100
@component function FirstOrder (; name, k = 1 , T, x_start = 0.0 , lowpass = true )
101
- T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
101
+ @symcheck T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
102
102
@named siso = SISO ()
103
103
@unpack u, y = siso
104
104
sts = @variables x (t)= x_start [description = " State of FirstOrder filter $name " ]
@@ -171,7 +171,7 @@ Textbook version of a PI-controller without actuator saturation and anti-windup
171
171
See also [`LimPI`](@ref)
172
172
"""
173
173
@component function PI (; name, k = 1 , T, x_start = 0.0 )
174
- T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
174
+ @symcheck T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
175
175
@named err_input = RealInput () # control error
176
176
@named ctr_output = RealOutput () # control signal
177
177
@named gainPI = Gain (k)
@@ -282,9 +282,10 @@ Text-book version of a PI-controller with actuator saturation and anti-windup me
282
282
- `ctr_output`
283
283
"""
284
284
@component function LimPI (; name, k = 1 , T, u_max, u_min = - u_max, Ta, x_start = 0.0 )
285
- Ta > 0 || throw (ArgumentError (" Time constant `Ta` has to be strictly positive" ))
286
- T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
287
- u_max ≥ u_min || throw (ArgumentError (" u_min must be smaller than u_max" ))
285
+ @symcheck Ta > 0 ||
286
+ throw (ArgumentError (" Time constant `Ta` has to be strictly positive" ))
287
+ @symcheck T > 0 || throw (ArgumentError (" Time constant `T` has to be strictly positive" ))
288
+ @symcheck u_max ≥ u_min || throw (ArgumentError (" u_min must be smaller than u_max" ))
288
289
@named err_input = RealInput () # control error
289
290
@named ctr_output = RealOutput () # control signal
290
291
@named gainPI = Gain (k)
@@ -367,8 +368,9 @@ where the transfer function for the derivative includes additional filtering, se
367
368
(Ti ≥ 0 || throw (ArgumentError (" Ti out of bounds, got $(Ti) but expected Ti ≥ 0" )))
368
369
! isequal (Td, false ) &&
369
370
(Td ≥ 0 || throw (ArgumentError (" Td out of bounds, got $(Td) but expected Td ≥ 0" )))
370
- u_max ≥ u_min || throw (ArgumentError (" u_min must be smaller than u_max" ))
371
- Nd > 0 || throw (ArgumentError (" Nd out of bounds, got $(Nd) but expected Nd > 0" ))
371
+ @symcheck u_max ≥ u_min || throw (ArgumentError (" u_min must be smaller than u_max" ))
372
+ @symcheck Nd > 0 ||
373
+ throw (ArgumentError (" Nd out of bounds, got $(Nd) but expected Nd > 0" ))
372
374
373
375
@named reference = RealInput ()
374
376
@named measurement = RealInput ()
0 commit comments