Triggered sample and hold
control.sample_hold
Samples the input each time the trigger input rises above 0.5 and holds that value until the next rise. The output is 0 until the first trigger.
Ports
| Name | Domain | Direction |
|---|---|---|
u | signal | in |
trigger | signal | in |
y | signal | out |
Variables
| Name | Unit | Description |
|---|---|---|
held | 1 | Last sampled input |
Equations
der(held) = 0 when trigger > 0.5 then reinit(held, u) y = held