Electronics-Related.com
Forums

another LT Spice question

Started by John Larkin June 13, 2013
On Fri, 14 Jun 2013 06:48:40 -0700, John Larkin
<jjlarkin@highNOTlandTHIStechnologyPART.com> wrote:

>On Fri, 14 Jun 2013 08:34:07 -0500, Tim Wescott <tim@seemywebsite.please> wrote: > >>On Thu, 13 Jun 2013 18:26:09 -0700, John Larkin wrote: >> >>> It's churlish to complain about something free and as good as LT Spice, >>> but some sort of Valof(C1) operator would be nice, and an integration >>> operator. >> >>LTSpice does have an integration operator for it's behavioral supplies. >>In fact, it has a few -- one Laplace transform operator, and two time- >>domain integrators (one rolls over, the other limits). I've used them to >>simulate microprocessor control of a PWM generator in a power supply. >> >>I can't remember more details than that, though -- try searching the >>manual on "integrat": that'll get you both "integrate" and "integrator". > > >.MEASURE includes an integration function, but I don't understand .MEAS. I put >one in my sim, but I don't see its output. > >.MEAS TRAN res1 FIND V(VCC) AT=50u > >It's supposed to "print" the result. Where?
I've just been told by Helmut that LTspice does not have a .PRINT statement like all other Spice variants. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.
John Larkin wrote:
> On Thu, 13 Jun 2013 19:46:38 -0500, John S <Sophi.2@invalid.org> > wrote: > >> On 6/13/2013 6:22 PM, John Larkin wrote: >>> >>> I have this circuit driving a pulsed laser. I want to compute the >>> energy dumped into the laser and the energy stored in the power supply >>> capacitors. The ballpark is 120 amps into a 20 volt laser for a few >>> hundred microseconds. >>> >>> What I did was create a "B" behavioral current source whose equation >>> is I = V(LASER) * I(LASER) which represents power, and dump that >>> into a 1 farad cap. The voltage on the cap is then energy in joules, >>> and I can probe/plot that just like any other node. This works [1]. >>> >>> Then, for the cap energy, I made a behavioral voltage source >>> >>> V = 0.5 * 1m * V(VCC)**2 >>> >>> where the 1m is because it's a 1000 uF cap. That gives me a probe-able >>> node scaled 1 volt per joule. That works, but if I change the cap >>> value I have to edit the equation. The nicer version is >>> >>> V = 0.5 * C1 * V(VCC)**2 >>> >>> but Spice barfs on the C1 bit. Is there a way to put the cap value >>> into the equation? >>> >>> >>> Too bad there's no integration operator available in the equations. >>> >>> [1] except that it initializes to -250 megavolts. Putting a 1 ohm >>> resistor across the cap fixes that. >> .param c1 1m >> V = 0.5 * {c1} * V(VCC)**2 > > Yeah, that works. Of course, I have to set the value of the cap too, > to {C1}. > > Kinda klunky, but works. I have a 20 uF ceramic in parallel with the > 1000uF alum, but it's easier to ignore it and tolerate the 2% error. > > It's churlish to complain about something free and as good as LT > Spice, but some sort of Valof(C1) operator would be nice, and an > integration operator. >
I use the .PARAM statement all the time. LTSpice can produce these nice multi-color plots with it, those are the (few) times when I have to admit that a Windows OS has benefits over DOS.
> I often wind up building my own test equipment on my schematic, rather > than doing math. >
Same here. Until last week, when I had to start solving equations in complex notation and some only worked if I used letter-A paper sideways and wrote in a very small font. Last time I did that was nineteen-sumpthin, and now that feels like doing 100 push-ups 30 years after boot camp. -- Regards, Joerg http://www.analogconsultants.com/
On Fri, 14 Jun 2013 09:30:27 -0700, Joerg <invalid@invalid.invalid>
wrote:

>John Larkin wrote:
[snip]
> >> I often wind up building my own test equipment on my schematic, rather >> than doing math. >> > >Same here. Until last week, when I had to start solving equations in >complex notation and some only worked if I used letter-A paper sideways >and wrote in a very small font. Last time I did that was >nineteen-sumpthin, and now that feels like doing 100 push-ups 30 years >after boot camp.
Rather than having to redraw every time, I create symbols that perform the various test functions I need, and add them to my personal symbol library. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.
On Thu, 13 Jun 2013 16:22:15 -0700, John Larkin
<jlarkin@highlandtechnology.com> wrote:

[snip]
> > >Too bad there's no integration operator available in the equations. >
Function available in behavioral model... idt(x[,ic[,a]]) Integrate x, optional initial condition ic, reset if a is true (Page 103 of SCAD_4 Manual) ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.
Jim Thompson wrote:
> On Fri, 14 Jun 2013 09:30:27 -0700, Joerg <invalid@invalid.invalid> > wrote: > >> John Larkin wrote: > [snip] >>> I often wind up building my own test equipment on my schematic, rather >>> than doing math. >>> >> Same here. Until last week, when I had to start solving equations in >> complex notation and some only worked if I used letter-A paper sideways >> and wrote in a very small font. Last time I did that was >> nineteen-sumpthin, and now that feels like doing 100 push-ups 30 years >> after boot camp. > > Rather than having to redraw every time, I create symbols that perform > the various test functions I need, and add them to my personal symbol > library. >
Sometimes I do that as well. But not possible on this project. I have to develop algorithms with which later some highly non-linear sensor parameter is extracted through a labyrinth of parasitic R's, L's and C's. All while keeping in mind that the computing horsepower of a PC is not infinite. I could hand it to college kids and they'd probably be faster doing this sort of math. But that would feel like handing over the steering wheel. Men don't do that :-) -- Regards, Joerg http://www.analogconsultants.com/
On Fri, 14 Jun 2013 10:05:24 -0700, Joerg <invalid@invalid.invalid>
wrote:

>Jim Thompson wrote: >> On Fri, 14 Jun 2013 09:30:27 -0700, Joerg <invalid@invalid.invalid> >> wrote: >> >>> John Larkin wrote: >> [snip] >>>> I often wind up building my own test equipment on my schematic, rather >>>> than doing math. >>>> >>> Same here. Until last week, when I had to start solving equations in >>> complex notation and some only worked if I used letter-A paper sideways >>> and wrote in a very small font. Last time I did that was >>> nineteen-sumpthin, and now that feels like doing 100 push-ups 30 years >>> after boot camp. >> >> Rather than having to redraw every time, I create symbols that perform >> the various test functions I need, and add them to my personal symbol >> library. >> > >Sometimes I do that as well. But not possible on this project. I have to >develop algorithms with which later some highly non-linear sensor >parameter is extracted through a labyrinth of parasitic R's, L's and >C's. All while keeping in mind that the computing horsepower of a PC is >not infinite. > >I could hand it to college kids and they'd probably be faster doing this >sort of math. But that would feel like handing over the steering wheel. >Men don't do that :-)
When I encounter non-linear requirements, I usually resort to tables, so my measurement part just calls up a table. (You'll remember my tool that can digitize a graph in a data sheet, straight from the graphics?) ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.
Jim Thompson wrote:
> On Fri, 14 Jun 2013 10:05:24 -0700, Joerg <invalid@invalid.invalid> > wrote: > >> Jim Thompson wrote: >>> On Fri, 14 Jun 2013 09:30:27 -0700, Joerg <invalid@invalid.invalid> >>> wrote: >>> >>>> John Larkin wrote: >>> [snip] >>>>> I often wind up building my own test equipment on my schematic, rather >>>>> than doing math. >>>>> >>>> Same here. Until last week, when I had to start solving equations in >>>> complex notation and some only worked if I used letter-A paper sideways >>>> and wrote in a very small font. Last time I did that was >>>> nineteen-sumpthin, and now that feels like doing 100 push-ups 30 years >>>> after boot camp. >>> Rather than having to redraw every time, I create symbols that perform >>> the various test functions I need, and add them to my personal symbol >>> library. >>> >> Sometimes I do that as well. But not possible on this project. I have to >> develop algorithms with which later some highly non-linear sensor >> parameter is extracted through a labyrinth of parasitic R's, L's and >> C's. All while keeping in mind that the computing horsepower of a PC is >> not infinite. >> >> I could hand it to college kids and they'd probably be faster doing this >> sort of math. But that would feel like handing over the steering wheel. >> Men don't do that :-) > > When I encounter non-linear requirements, I usually resort to tables, > so my measurement part just calls up a table. > > (You'll remember my tool that can digitize a graph in a data sheet, > straight from the graphics?) >
Yeah, but there ain't no graphics for this here system. -- Regards, Joerg http://www.analogconsultants.com/
On Fri, 14 Jun 2013 11:14:06 -0700, Joerg <invalid@invalid.invalid>
wrote:

>Jim Thompson wrote: >> On Fri, 14 Jun 2013 10:05:24 -0700, Joerg <invalid@invalid.invalid> >> wrote: >> >>> Jim Thompson wrote: >>>> On Fri, 14 Jun 2013 09:30:27 -0700, Joerg <invalid@invalid.invalid> >>>> wrote: >>>> >>>>> John Larkin wrote: >>>> [snip] >>>>>> I often wind up building my own test equipment on my schematic, rather >>>>>> than doing math. >>>>>> >>>>> Same here. Until last week, when I had to start solving equations in >>>>> complex notation and some only worked if I used letter-A paper sideways >>>>> and wrote in a very small font. Last time I did that was >>>>> nineteen-sumpthin, and now that feels like doing 100 push-ups 30 years >>>>> after boot camp. >>>> Rather than having to redraw every time, I create symbols that perform >>>> the various test functions I need, and add them to my personal symbol >>>> library. >>>> >>> Sometimes I do that as well. But not possible on this project. I have to >>> develop algorithms with which later some highly non-linear sensor >>> parameter is extracted through a labyrinth of parasitic R's, L's and >>> C's. All while keeping in mind that the computing horsepower of a PC is >>> not infinite. >>> >>> I could hand it to college kids and they'd probably be faster doing this >>> sort of math. But that would feel like handing over the steering wheel. >>> Men don't do that :-) >> >> When I encounter non-linear requirements, I usually resort to tables, >> so my measurement part just calls up a table. >> >> (You'll remember my tool that can digitize a graph in a data sheet, >> straight from the graphics?) >> > >Yeah, but there ain't no graphics for this here system.
Do you have an equation? Or a PWL representation? ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.
On Friday, June 14, 2013 1:22:15 AM UTC+2, John Larkin wrote:
> I have this circuit driving a pulsed laser. I want to compute the > > energy dumped into the laser and the energy stored in the power supply > > capacitors. The ballpark is 120 amps into a 20 volt laser for a few > > hundred microseconds. > > > > What I did was create a "B" behavioral current source whose equation > > is I = V(LASER) * I(LASER) which represents power, and dump that > > into a 1 farad cap. The voltage on the cap is then energy in joules, > > and I can probe/plot that just like any other node. This works [1]. > > > > Then, for the cap energy, I made a behavioral voltage source > > > > V = 0.5 * 1m * V(VCC)**2 > > > > where the 1m is because it's a 1000 uF cap. That gives me a probe-able > > node scaled 1 volt per joule. That works, but if I change the cap > > value I have to edit the equation. The nicer version is > > > > V = 0.5 * C1 * V(VCC)**2 > > > > but Spice barfs on the C1 bit. Is there a way to put the cap value > > into the equation? > > > > > > Too bad there's no integration operator available in the equations. > > > > [1] except that it initializes to -250 megavolts. Putting a 1 ohm > > resistor across the cap fixes that. >
I'm normally using Cadence PSpice. In probe you just write s(var) to integrate. d(var) to differentiate. I suggest you read the manual from start to end, that will save you a lot of time in the future. If you need the total power, write this in the Measurement Results; YatlastX(s(w(var)))/Max(Time) Regards Klaus
Jim Thompson wrote:
> On Fri, 14 Jun 2013 11:14:06 -0700, Joerg <invalid@invalid.invalid> > wrote: > >> Jim Thompson wrote: >>> On Fri, 14 Jun 2013 10:05:24 -0700, Joerg <invalid@invalid.invalid> >>> wrote: >>> >>>> Jim Thompson wrote: >>>>> On Fri, 14 Jun 2013 09:30:27 -0700, Joerg <invalid@invalid.invalid> >>>>> wrote: >>>>> >>>>>> John Larkin wrote: >>>>> [snip] >>>>>>> I often wind up building my own test equipment on my schematic, rather >>>>>>> than doing math. >>>>>>> >>>>>> Same here. Until last week, when I had to start solving equations in >>>>>> complex notation and some only worked if I used letter-A paper sideways >>>>>> and wrote in a very small font. Last time I did that was >>>>>> nineteen-sumpthin, and now that feels like doing 100 push-ups 30 years >>>>>> after boot camp. >>>>> Rather than having to redraw every time, I create symbols that perform >>>>> the various test functions I need, and add them to my personal symbol >>>>> library. >>>>> >>>> Sometimes I do that as well. But not possible on this project. I have to >>>> develop algorithms with which later some highly non-linear sensor >>>> parameter is extracted through a labyrinth of parasitic R's, L's and >>>> C's. All while keeping in mind that the computing horsepower of a PC is >>>> not infinite. >>>> >>>> I could hand it to college kids and they'd probably be faster doing this >>>> sort of math. But that would feel like handing over the steering wheel. >>>> Men don't do that :-) >>> When I encounter non-linear requirements, I usually resort to tables, >>> so my measurement part just calls up a table. >>> >>> (You'll remember my tool that can digitize a graph in a data sheet, >>> straight from the graphics?) >>> >> Yeah, but there ain't no graphics for this here system. > > Do you have an equation? Or a PWL representation? >
Equations, yes. But revealing the architecture would result in a whizzing bullet. No PWL, it's too complex for that. -- Regards, Joerg http://www.analogconsultants.com/