Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LTspice syntax problem

Flyback

Well-Known Member
Hi,
How do i make the time of a "Pulse" source equal to the voltage of a node in LTspice?
The attached LTspice wont work. Do you know how to solve?
 

Attachments

  • LTspice syntax.png
    LTspice syntax.png
    21.2 KB · Views: 61
  • volt.asc
    780 bytes · Views: 53
It is unlikely that you will be able to do what you want in that way. The fields in the pulse source must be numbers or parameters that can be resolved into a number BEFORE the beginning of the simulation. If you are trying to create a PWM signal with a fixed frequency and a variable duty cycle that will respond to a control voltage, there are better ways to accomplish that.
 
You could use something like this, where the duty cycle varies with v(a) :-
1708806348000.png
 
I am an LTspice newbie and just learned how to do this
1708809231391.png
 

Attachments

  • pwm_volt.asc
    1.2 KB · Views: 47
Using two interpolated pulses to make two sawtooths with 1000:1 T ratio = 10ms:10us compared with an arbitrary IF statement to make a PWM signal.

LT_PWM.jpg



For those curious why I use Win7 x64 16GB instead of Win 10/11, it's because I like lean and fast on my 10 yr old PC.

1708814915991.png
 

Attachments

  • pwm_sawtooth.asc
    1.2 KB · Views: 44
Last edited:

Latest threads

New Articles From Microcontroller Tips

Back
Top