Zero-order hold in Simulink - Step-by-Step Execution
Input: sin(t) continuous signal Sample time: 1 sec Output: hold each sample value for 1 sec
| Step | Time (s) | Input Signal Value | Sampled Value | Output Value | Action |
|---|---|---|---|---|---|
| 1 | 0 | sin(0)=0.0 | 0.0 | 0.0 | Sample input and hold |
| 2 | 0.5 | sin(0.5)=0.4794 | 0.0 | 0.0 | Hold previous sample |
| 3 | 1 | sin(1)=0.8415 | 0.8415 | 0.8415 | Sample input and hold |
| 4 | 1.5 | sin(1.5)=0.9975 | 0.8415 | 0.8415 | Hold previous sample |
| 5 | 2 | sin(2)=0.9093 | 0.9093 | 0.9093 | Sample input and hold |
| 6 | 2.5 | sin(2.5)=0.5985 | 0.9093 | 0.9093 | Hold previous sample |
| 7 | 3 | sin(3)=0.1411 | 0.1411 | 0.1411 | Sample input and hold |
| 8 | 3.5 | sin(3.5)=-0.3508 | 0.1411 | 0.1411 | Hold previous sample |
| 9 | 4 | sin(4)=-0.7568 | -0.7568 | -0.7568 | Sample input and hold |
| 10 | 4.5 | sin(4.5)=-0.9775 | -0.7568 | -0.7568 | Hold previous sample |
| 11 | 5 | sin(5)=-0.9589 | -0.9589 | -0.9589 | Sample input and hold |
| 12 | 5.5 | sin(5.5)=-0.7055 | -0.9589 | -0.9589 | Hold previous sample |
| 13 | 6 | sin(6)=-0.2794 | -0.2794 | -0.2794 | Sample input and hold |
| 14 | 6.5 | sin(6.5)=0.2151 | -0.2794 | -0.2794 | Hold previous sample |
| 15 | 7 | sin(7)=0.6570 | 0.6570 | 0.6570 | Sample input and hold |
| 16 | 7.5 | sin(7.5)=0.9379 | 0.6570 | 0.6570 | Hold previous sample |
| 17 | 8 | sin(8)=0.9894 | 0.9894 | 0.9894 | Sample input and hold |
| 18 | 8.5 | sin(8.5)=0.7985 | 0.9894 | 0.9894 | Hold previous sample |
| 19 | 9 | sin(9)=0.4121 | 0.4121 | 0.4121 | Sample input and hold |
| 20 | 9.5 | sin(9.5)=-0.0752 | 0.4121 | 0.4121 | Hold previous sample |
| 21 | 10 | sin(10)=-0.5440 | -0.5440 | -0.5440 | Sample input and hold |
| Variable | Start | After 1 | After 2 | After 3 | After 4 | After 5 | After 6 | After 7 | After 8 | After 9 | After 10 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Time (s) | 0 | 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 | 4 | 4.5 | 5 |
| Input Signal Value | 0.0 | 0.4794 | 0.8415 | 0.9975 | 0.9093 | 0.5985 | 0.1411 | -0.3508 | -0.7568 | -0.9775 | -0.9589 |
| Sampled Value | 0.0 | 0.0 | 0.8415 | 0.8415 | 0.9093 | 0.9093 | 0.1411 | 0.1411 | -0.7568 | -0.7568 | -0.9589 |
| Output Value | 0.0 | 0.0 | 0.8415 | 0.8415 | 0.9093 | 0.9093 | 0.1411 | 0.1411 | -0.7568 | -0.7568 | -0.9589 |
Zero-order hold (ZOH): - Samples continuous input at fixed intervals - Holds each sample value constant until next sample - Output is piecewise constant signal - Used to convert continuous signals to discrete-time - Sample time controls update frequency - Common in digital control and simulation
Practice
What is the main function of a Zero-order hold block in Simulink?
Solution
Step 1: Understand the role of Zero-order hold and compare options
The Zero-order hold block keeps the input value constant during the sample period. It does not differentiate, integrate, or convert continuous to discrete signals.Final Answer:
It holds the input value constant between sample times. -> Option DQuick Check:
Zero-order hold = hold input constant [OK]
- Confusing zero-order hold with differentiation or integration
- Thinking it converts continuous to discrete signals
- Assuming it changes the signal value continuously
Which of the following is the correct way to set the fixed sample time parameter in a Zero-order hold block in Simulink?
Solution
Step 1: Understand sample time settings and evaluate options
Fixed sample time must be a positive number (e.g., 0.1s) to specify hold duration. -1 inherits from input; 0 means continuous (no hold); other negatives invalid.Final Answer:
Set sample time to a positive number like 0.1 seconds. -> Option AQuick Check:
Sample time positive number = correct setting [OK]
- Using zero or negative sample times incorrectly
- Confusing inherited sample time (-1) with explicit sample time
- Setting sample time to continuous (0) for discrete hold
Consider this Simulink model snippet using a Zero-order hold block with sample time 0.5 seconds. The input signal is a step that changes from 0 to 1 at time 0.3 seconds. What will be the output of the Zero-order hold block at time 0.7 seconds?
Solution
Step 1: Analyze sample intervals and input timing
With sample time 0.5s, samples at 0, 0.5, 1.0s. Step changes at 0.3s, so input(0)=0, input(0.5)=1. At 0.7s (in [0.5,1.0)), holds 1.Final Answer:
1 -> Option CQuick Check:
Output holds last sampled input = 1 [OK]
- Thinking sample at 0.5s captures 0 despite change at 0.3s
- Ignoring sample time intervals
- Confusing step change time with sample time
In a Simulink model, a Zero-order hold block is set with sample time 0.2 seconds. The output signal is not holding values as expected and changes continuously. What is the most likely cause?
Solution
Step 1: Identify cause of continuous output behavior
If sample time=0, block operates continuously (follows input without holding). Other causes less likely to produce continuous change.Final Answer:
Sample time is set to 0 (continuous) instead of 0.2. -> Option AQuick Check:
Continuous sample time = no hold [OK]
- Ignoring sample time setting
- Assuming input signal type causes issue
- Misconnecting blocks without checking parameters
You want to convert a discrete sensor signal sampled every 0.1 seconds into a continuous signal for further processing in Simulink. Which approach using a Zero-order hold block is correct?
Choose the best option.
Solution
Step 1: Understand goal and evaluate ZOH configurations
Goal: hold discrete samples constant between 0.1s intervals for continuous output. Set Ts=0.1s matches sensor rate. Ts=0 continuous (no hold); -1 inherits (risk mismatch); integrator changes values.Final Answer:
Set the Zero-order hold sample time to 0.1 seconds to hold each sample value constant until the next sample. -> Option BQuick Check:
Sample time = sensor rate for correct hold [OK]
- Setting sample time to zero for hold
- Using inherited sample time without checking input
- Replacing hold with integrator incorrectly
Ready to prove it?
Pass the test and this pattern moves unknown
