I’m creating a converter circuit in Qspice and would like to obtain the duty ratio (Duty) from the waveform.
Since there doesn’t seem to be a direct way to measure the Duty, I tried to get the on-time instead using the following command, but it didn’t return the on-time shown in the waveform.
I used “last” because I want to know the Duty after the circuit reaches steady state.
Could you please tell me the correct command to use?
meas ton trig V(xx)=0.9 rise=last targ V(xx)=0.9 fall=last
I don’t encrypt my work; you can always view how I implement my subcircuit in the netlist. To do so, go to View > Netlist, and you can study how it is implemented.
Well, I didn’t think about having “cshunt”…, PWM measurement highly depends on circuit timing, and “cshunt” will mess things up!
Well, actually, the best approach is always to use a C++ block for this type of processing.
I have uploaded a pulse analyzer that can provide you with frequency, duty cycle, and pulse count. This is definitely better than using a subcircuit with native devices and should be more reliable.