Discrete-time is important because digital controllers work by checking and adjusting signals at specific time steps, not continuously. This helps computers control real-world systems effectively.
When designing a digital thermostat that adjusts temperature every few seconds.
When controlling a robot that makes decisions at fixed time intervals.
When programming a traffic light system that changes lights at set times.
When monitoring and adjusting a chemical process with sensors that update periodically.
Syntax
Simulink
In Simulink, discrete-time systems use blocks like 'Discrete Transfer Function'or'Unit Delay'with a specified sample time.
Example:
Discrete Transfer Function: numerator, denominator, Sample time = Ts
Unit Delay: Sample time = Ts
Sample time (Ts) defines how often the system updates in seconds.
Discrete blocks process signals at each sample time step, unlike continuous blocks.
Examples
This block updates the output every 0.1 seconds using the given transfer function.
Simulink
Discrete Transfer Function:
Numerator = [0.5]
Denominator = [1 -0.5]
Sample time = 0.1
This block delays the input by one sample step, updating every 0.05 seconds.
Simulink
Unit Delay:
Sample time = 0.05
Sample Program
This code simulates a digital controller responding to a sine wave input sampled every 0.1 seconds. It shows how discrete-time processing affects the output at each time step.
Simulink
/* Simulink model setup steps (conceptual):
1. Add a Sine Wave block (continuous signal).
2. Add a Zero-Order Hold block with sample time 0.1 to convert to discrete-time.
3. Add a Discrete Transfer Function block with numerator [1] and denominator [1 -0.9], sample time 0.1.
4. Connect blocks: Sine Wave -> Zero-Order Hold -> Discrete Transfer Function -> Scope.
5. Run simulation for 1 second.
*/
% Since Simulink code is graphical, here is equivalent MATLAB code to simulate discrete-time control:
Ts = 0.1; % sample time
num = [1];
den = [1 -0.9];
sys_d = tf(num, den, Ts); % discrete transfer function
% Create input: sine wave sampled at Ts
t = 0:Ts:1;
u = sin(2*pi*1*t); % 1 Hz sine wave
% Simulate discrete system response
y = lsim(sys_d, u, t);
% Display output values
for i = 1:length(t)
fprintf('Time %.1f s: Output %.3f\n', t(i), y(i));
end
OutputSuccess
Important Notes
Discrete-time control matches how digital computers process signals step-by-step.
Choosing the right sample time is important: too slow misses details, too fast wastes resources.
Summary
Digital controllers work in discrete time, updating signals at fixed intervals.
Simulink uses discrete blocks with sample time to model this behavior.
Understanding discrete-time helps design effective digital control systems.
Practice
(1/5)
1. Why is discrete-time important in digital control systems modeled in Simulink?
easy
A. Because discrete-time eliminates the need for sampling
B. Because continuous signals are easier to process digitally
C. Because it allows infinite precision in signal values
D. Because digital controllers update signals at fixed time intervals
Solution
Step 1: Understand digital controller operation
Digital controllers work by updating signals at fixed intervals, not continuously.
Step 2: Connect discrete-time to Simulink modeling
Simulink models this by using discrete blocks with sample times to represent these fixed updates.
Final Answer:
Because digital controllers update signals at fixed time intervals -> Option D
Quick Check:
Digital control = discrete updates [OK]
Hint: Digital control means fixed update times, not continuous [OK]
Common Mistakes:
Thinking digital control is continuous
Confusing sampling with elimination
Assuming infinite precision in digital signals
2. Which Simulink block parameter correctly sets the discrete sample time for a digital controller?
easy
A. Continuous sample time set to 0
B. Sample time set to a positive fixed value
C. Sample time set to -1 for inherited
D. Sample time set to infinity
Solution
Step 1: Identify how discrete sample time is set
Discrete blocks require a positive fixed sample time to update at intervals.
Step 2: Evaluate options
Setting sample time to 0 means continuous, -1 means inherited, infinity is invalid.
Final Answer:
Sample time set to a positive fixed value -> Option B
Quick Check:
Discrete sample time = positive value [OK]
Hint: Discrete sample time must be positive fixed number [OK]
Common Mistakes:
Using 0 which means continuous time
Using -1 which inherits sample time
Setting sample time to infinity
3. Given this Simulink discrete-time update code snippet:
y[k] = 0.5 * y[k-1] + u[k]
and input sequence u = [2, 4, 6], with initial y[0] = 0, what is y[3]?
Check each step carefully to avoid off-by-one errors in indexing.
Final Answer:
8.5 -> Option A
Quick Check:
Discrete update sums to 8.5 [OK]
Hint: Calculate each step using previous output and input [OK]
Common Mistakes:
Mixing up indices k and k-1
Forgetting initial condition y[0]
Adding instead of multiplying coefficients
4. Identify the error in this Simulink discrete-time block setup:
Sample time = 0 Initial condition = 5
What is wrong?
medium
A. No error, setup is correct
B. Initial condition cannot be 5
C. Sample time 0 means continuous, not discrete
D. Sample time must be negative
Solution
Step 1: Understand sample time meaning
Sample time 0 means continuous time, not discrete updates.
Step 2: Check initial condition validity
Initial condition 5 is valid; no issue there.
Final Answer:
Sample time 0 means continuous, not discrete -> Option C
Quick Check:
Discrete sample time ≠ 0 [OK]
Hint: Sample time 0 means continuous, use positive for discrete [OK]
Common Mistakes:
Thinking initial condition causes error
Believing sample time can be zero for discrete
Ignoring sample time meaning
5. You want to design a digital controller in Simulink that samples input every 0.1 seconds and holds output constant between samples. Which setup correctly models this behavior?
hard
A. Use a discrete block with sample time 0.1 and a Zero-Order Hold block
B. Use a continuous block with sample time 0 and a Unit Delay block
C. Use a discrete block with sample time -1 and no hold block
D. Use a continuous block with sample time 0.1 and a Zero-Order Hold block
Solution
Step 1: Identify correct sample time setting
Discrete block with sample time 0.1 means updates every 0.1 seconds.
Step 2: Understand output holding
Zero-Order Hold block keeps output constant between samples, matching requirement.
Final Answer:
Use a discrete block with sample time 0.1 and a Zero-Order Hold block -> Option A
Quick Check:
Discrete sample + hold = correct model [OK]
Hint: Discrete block + Zero-Order Hold models sampled and held output [OK]
Common Mistakes:
Using continuous block for discrete sampling
Omitting Zero-Order Hold block
Using inherited sample time (-1) incorrectly
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.