Author Topic: LTSpice PWM Input Signal Creation for Motor Soft Start  (Read 4239 times)

0 Members and 1 Guest are viewing this topic.

Offline electrovangaTopic starter

  • Contributor
  • Posts: 21
  • Country: de
LTSpice PWM Input Signal Creation for Motor Soft Start
« on: October 23, 2023, 10:16:07 am »
Hello,
I want to create a PWM signal start from 10% till 70% by increamenting 2% per cycle in LTSpice.
My signal frequency is 980Hz. How can I model it in LTSpice?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: LTSpice PWM Input Signal Creation for Motor Soft Start
« Reply #1 on: October 23, 2023, 10:55:58 am »
That's fairly trivial - two voltage sources, one set up as a triangle wave of the desired frequency, and the other as a ramp, and a comparator.  In the attached sim I am using UniversalOpAmp2 as the comparator as the A device differential Schmidt is prone to glitching and I didn't want to use a specific comparator IC.
 
The following users thanked this post: electrovanga

Online iMo

  • Super Contributor
  • ***
  • Posts: 4791
  • Country: pm
  • It's important to try new things..
Re: LTSpice PWM Input Signal Creation for Motor Soft Start
« Reply #2 on: October 23, 2023, 11:07:34 am »
In past I clocked in (with a pulse voltage source with your 980Hz freq) a digital counter and based on its output values (ie. "a DAC" in math like VAL=D0*0.01+D1*0.02+D2*0.04.. etc) I made other calculations which were then fed into the schematics where needed (as the "parameter" or directly as the "voltage")..
 

Offline drago462

  • Contributor
  • Posts: 10
  • Country: es
Re: LTSpice PWM Input Signal Creation for Motor Soft Start
« Reply #3 on: November 21, 2023, 07:43:00 am »
Creating a PWM signal in LTSpice can be a bit tricky since LTSpice doesn't naturally loop or increment values in a straightforward way. What you'll want to do is set up a voltage source with a pulse function. Start with your duty cycle at 10% of your signal's period (which is 1/980 seconds). Then, you'll need to manually adjust this in steps, or use the 'STEP' command in LTSpice to simulate different cycles with increasing duty cycles. If you're comfortable with scripting, you could even script the creation of a PWL file with your desired pattern and import that into LTSpice. It's a bit of a workaround, but it should get you that varying PWM signal you're after.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf