How can you trigger or scale a PWL waveform in LTspice?

Start a PWL Sequence using a trigger:

Figure 5 shows an example of a PWL waveform that depends on a trigger condition. You can make the waveform start when a condition (V(trig) > 1) becomes true. And the waveform is disabled when the expression is false.

Example:
The waveform repeats while the trigger condition is true:

PWL REPEAT FOREVER (0 0 1m 1 2m 1 3m 0) ENDREPEAT TRIGGER V(trig)>1

The sequence runs only when the node voltage V(trig) exceeds 1 V.


Figure 5. PWL waveform with a trigger condition defined.

Stretching or Shrinking a PWL Waveform:

You can scale the waveform in time or amplitude.
PWL parameters TIME_SCALE_FACTOR and VALUE_SCALE_ FACTOR can be used to stretch or shrink the waveform.
Figure 6 shows the original waveform with half the period length and twice the amplitude:

PWL TIME_SCALE_FACTOR=0.5 VALUE_SCALE_FACTOR=2 REPEAT FOREVER (0 0 1m 1 2m 1 3m 0) ENDREPEAT


Figure 6. Scaling a waveform in both time and voltage (or current) values.

Related Articles:
What is LTspice?
An Introduction to LTSpice
What is a Piecewise Linear (PWL) function in LTspice and when it should be used?
How can you repeat PWL waveform in LTspice?
LTspice Tips - Mathematical Integration
LTspice Tips - Plot Manually Entered Functions