TRIPDT and TRIPDV Parameters

I am trying to add TRIPDT and TRIPDV parameters to a behavioral voltage source in QSPICE, but when the simulation runs, it returns an error:

Warning: Ignoring unknown instance parameter “TRIPDT” of device B1.

To add these, I right-clicked on the source and selected the “Add New Attribute” option. Is there any way to add these parameters, or something with an equivalent effect, to behavioral sources in QSPICE?

1 Like

Those are LTspice parameters, which helped when implementing logic with B-devices. QSPICE doesn’t expect logic in B-devices, so I didn’t implement them in the QSPICE B-devices.

I am curious about this topic too, @Engelhardt.

I am starting out with Qspice and was attempting to make a Duty-to-PWM generator. The way I would normally do this in ltspice is with a BV source + the tripdt & tripdv parameters like @rankin said. I tried that here, but it looks like Qspice isn’t increasing the sampling frequency at the crossover event (so the PWM waveform has a very slow falling edge). I recreated the same thing with a Schmitt comparator, and a custom c-code block. All of them result in the same thing (different hysteresis values - so they’re slightly different results).

I can get a better result by forcing a max step size… but that kind of defeats the point.

Questions is – if not tripdt and tripdv, how would I go about building a circuit like this one? Maybe Qspice is doing something intelligent that I’m failing to understand?

The Schmitt device accepts ttol, the temporal tolerance. Add an attribute ttol=1n to it. It’s the analog B-devices that don’t get a temporal tolerance anymore.

Thanks @Engelhardt - confirmed that works. Picture attached.

Follow-up question - Is any type of temporal tolerance supported for the c-code blocks? I looked through the documentation but couldn’t find anything. I can think of quite a few instances where it’d be really useful, so I’d be pretty happy to hear if it’s supported.

Yes, the C-code blocks give the utmost in temporal control, but they are written inside the code. Look inside the PracticalSMPS.qsch example.

Thanks for the quick response. I am used to using b-sources for logical functions in LTspice, but it seems like figuring out how to use code blocks to accomplish the same functions would be better in the long term.

I too encountered this problem recently and at the suggestion of a colleague, I set the maximum timestep to a value on the order of the desired rise and fall time and the situation seemingly improved. I like this explanation better than the original one I hypothesized.

BRUCE108