Problem with generation of triangular wave

Status
Not open for further replies.

mANmAN01

New Member
Hi! I am working with comparator (In LTspice). I have to compare a sine wave and a triangular wave. The triangular wave should be at 2kHz frequency. So this should be the configuration for triangular wave:


However, the results show that it is not a 2kHz frequency:-


Last time I checked, 0.0005s was 2kHz. But not in LTspice. Why is it so?
 
Do you have a typo in the setup?

The rise and fall are 0.0025 seconds each; 2.5mS
 
Your rise and fall times are out by a factor of 10.
Welcome to ETO!
 
Use:

PULSE(-1 1 0 250u 250u 1n 250u)

Or



View .meas results in error log.

eT
 
Last edited:
i don't have a machine in front of me that has LTSpice on it, so i can't verify this, but i think you can use the PWL (piecewise linear) source also
 
eTech is right. You can use a pulse source with very slew rate limited edges to generate a triangular waveform. You have got it right. You just have the slew rate set to 2.5ms when it should be 0.25ms (250us). 0us ON and 500us off time and this gives you a triangular waveform... or use PWL
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…