Programmatic Use
Block Parameter: TimeDomain
Type: character vector
Values: 'discrete-time' | 'continuous-time'
Default: 'discrete-time'
Controller sample time (sec) — Sample time of PID controller
0.1 (default) | positive scalar | –1
Specify the sample time of your PID controller in seconds. This value also sets the sample
time for the experiment performed by the block.
To perform PID tuning, the block measures frequency-response information up to a
frequency of 10 times the target bandwidth. To ensure that this frequency is less than the
Nyquist frequency, the target bandwidth, ωc, must satisfy ωcTs ≤ 0.3, where Ts ωc is the
controller sample time that you specify with the Controller sample time (sec)
parameter.
When you update a PID Controller block or custom PID controller with tuned parameter
values, make sure the controller sample time matches.
Tips
If you want to run the deployed block with different sample times in your application, set
this parameter to –1 and put the block in a Triggered Subsystem. Then, trigger the
subsystem at the desired sample time. If you do not plan to change the sample time after
deployment, specify a fixed and finite sample time.
Dependencies
To enable this parameter, set Time Domain to discrete-time.
Programmatic Use
Block Parameter: DiscreteTs
Type: scalar
Value positive scalar | –1
Default: 0.1
Experiment sample time (sec) — Sample time for experiment
0.02 (default) | positive scalar
Even when you tune a continuous-time controller, you must specify a sample time for the
experiment performed by the block. In general, continuous-time controller tuning is not
Closed-Loop PID Autotuner