The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 25th, 2024, 10:34am
Pages: 1 2 
Send Topic Print
Any advice for PSS converge? (Read 16105 times)
sharpmental
Junior Member
**
Offline



Posts: 14

Any advice for PSS converge?
Feb 09th, 2015, 10:51pm
 
I am building a Verilog-A model for BUCK circuit. I am using spectre and spectreRF.
In transient simulation it works. I want to show how verilog-A works in PSS simulation, but it is hard to make it converge in PSS simulation.

1. I use abstime to generate PWM signal. So the PWM_clk module is markded with (* instrument_model*).
2. I also use absdelay to generate a nonoverlap switch signal. So the NonOverlap module is markded with (* instrument_model*).
3. if I open the loop and set the feedback voltage, it converged in PSS.
4. In transient, its stability is proved, reasonable small ringing with load/input step.

One warning is on the compensate net. It has 10nF compensation cap to GND. And the GM stage model has limited rout and its output current is limited with tanh function. I don't see how the simulator would calculate this net to be Giga volt.

Is there any general advise?
Back to top
 
 
View Profile   IP Logged
sharpmental
Junior Member
**
Offline



Posts: 14

Re: Any advice for PSS converge?
Reply #1 - Feb 10th, 2015, 10:54pm
 
Now I can loss some tolerance to make it converge. But the AC/STB result is wrong.
The structure is in the attached picture. The compensation net work is not shown there.
I checked the PSS result, it seems most net are in their correct value.
Back to top
 

system-structure.jpg
View Profile   IP Logged
sharpmental
Junior Member
**
Offline



Posts: 14

Re: Any advice for PSS converge?
Reply #2 - Feb 10th, 2015, 10:56pm
 
But the stb and ac (break ac at fb net) result is all like this:
Back to top
 

simfail-1.png
View Profile   IP Logged
Frank Wiedmann
Community Fellow
*****
Offline



Posts: 677
Munich, Germany
Re: Any advice for PSS converge?
Reply #3 - Feb 11th, 2015, 12:32am
 
Back to top
 
 
View Profile WWW   IP Logged
rfidea
Senior Member
****
Offline



Posts: 159
Europe
Re: Any advice for PSS converge?
Reply #4 - Feb 14th, 2015, 2:21pm
 
Maybe kicking in open doors, but Cadence helpdesk says that 95% of all their PSS convergence questions is solve by longer tstab... Maybe worth trying.
Back to top
 
 
View Profile   IP Logged
sheldon
Community Fellow
*****
Offline



Posts: 751

Re: Any advice for PSS converge?
Reply #5 - Feb 15th, 2015, 6:01pm
 
RFIdea,

  The suggestion for longer tstab is valid. However, DC-to-DC
Converters provide some unique challenges. Other areas to
consider and investigate:

1) It is difficult to tell from the block diagram, but the clock
   generator needs to have some delay so both power devices
   are not on at the same time. Improper timing can generate
   large current spikes at the instant of switching resulting in
   convergence issues. Typically, real power devices would also
   be unhappy at the high current density.  

2) If you are including effects such as the power supply bond wire,
   then the power supply bypass network should be included. Since
   a DC-to-DC converters have negative resistance at the power
   supply input -R*L can oscillations that result in convergence
   issues.

3) Yes, loosening tolerances is also an approach that I use when
   simulating DC-to-DC Converters, however, you should check
   the waveforms to verify that they are correct, and periodic.    

  Rather than generic longer tstab, run a transient simulation and
look at the duty cycle of the DC-to-DC converter at the output of
the comparator and set tstab based on the settling of the duty cycle.

  Modeling of DC-to-DC Converters is not trivial. However if you
careful, the results can be useful.  

                                                                         Sheldon
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Any advice for PSS converge?
Reply #6 - Feb 18th, 2015, 12:21pm
 
You have a hidden state problem. Using instrument_module does not make the hidden state problem go away, it just disables the hidden state warning and allows the analysis to continue.

I don't know why $abstime would raise a hidden state warning. It is clearly not state. But using absdelay is asking for trouble. I recommend you reforumulate your model to avoid use of the absdelay function.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
sharpmental
Junior Member
**
Offline



Posts: 14

Re: Any advice for PSS converge?
Reply #7 - Mar 3rd, 2015, 6:40pm
 
Hi Sheldon, Ken,

Thanks for your idea.

I use a nonoverlap block to generate clock edge, so as in the real circuit, both switch won't open at the same time.
This block is where I have to use the "instrument" declare.

I read from Cadence papers, it says the function absdelay is not supported in PSS simulation. So i think this module has to be "instrument" block.

Here is the main code of my nonoverlap module:

analog begin

@(initial_step) begin
   polar1 = V(in, gnd)>vth?1:0;
   polar2 = polar1;
end

   V(net1, gnd) <+ absdelay(V(in, gnd), overlaptime*0.5);
   polar1 = V(in, gnd)>vth?1:0;
   polar2 = V(net1, gnd)>vth?1:0;
   
V(out, gnd) <+ V(vcc, gnd)*(polar1&&polar2);
V(outb, gnd) <+ V(vcc, gnd)*(!(polar1||polar2));

end

Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Any advice for PSS converge?
Reply #8 - Mar 3rd, 2015, 9:42pm
 
You cannot use absdelay, regardless of whether you label the module as an instrument module or not. Replace it with an RC delay.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
sharpmental
Junior Member
**
Offline



Posts: 14

Re: Any advice for PSS converge?
Reply #9 - Mar 16th, 2015, 11:29pm
 
Ken,

Yes, with the RC delay. this module could run PSS now. I also changed some other modules with this method.
Now, I still has the hidden state problem in the PWM signal block. It should generate a ramp up signal with certain period.  
I think about it for several days. It seems I have to save the "state" in a variable so to tell the voltage(current) should increase(charge) or decrease (discharge), that cause the hidden state problem.

Do you give me some suggestions on such period signals?
Back to top
 
 
View Profile   IP Logged
sharpmental
Junior Member
**
Offline



Posts: 14

Re: Any advice for PSS converge?
Reply #10 - Mar 16th, 2015, 11:30pm
 
Here is my code to describe it as current charge:

PWMvol = PWMref>V(VCC, GND)?V(VCC, GND):PWMref;

   @(cross(V(VPWM, GND), -1)) begin
       slope = PWMvol/(cycle-falltime);
   end

   @(cross(V(VPWM, GND)-PWMvol, +1)) begin
       slope = -PWMvol/falltime;
   end

     V(VPWM,GND) <+ idt(slope, 0);
Back to top
 
 
View Profile   IP Logged
sharpmental
Junior Member
**
Offline



Posts: 14

Re: Any advice for PSS converge?
Reply #11 - Mar 16th, 2015, 11:32pm
 
And here is the code to describe it as voltage:

PWMvol = PWMref>V(VCC, GND)?V(VCC, GND):PWMref;

   @(timer(0, cycle)) begin
       slope = PWMvol/(cycle-falltime);
       wstart = $abstime;
       polar = 1;
   end

   @(timer(cycle-falltime, cycle)) begin
       slope = -PWMvol/falltime;
       wstart = $abstime;
       polar = -1;
   end
   
   xout = (1+polar)*0.5*slope*($abstime- wstart)+(1-polar)*0.5*(2.5 + slope*($abstime- wstart));

   V(VPWM) <+ xout;
end

Both version use variable to save state, so both failed in RF.  :'(
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Any advice for PSS converge?
Reply #12 - Mar 17th, 2015, 11:29am
 
To eliminate hidden state, you need to eliminate the possibility that a variable is not assigned a value before it is used. So, you can use event statements, but you should not assign values to variable within them. This limitation can make modeling very difficult. But I have found that if you are creative, you can often work around this limitation.

If I were you I would recommend you try using idtmod. With idtmod you can easily make a sawtooth wave without hidden state. Now, you appear to want a triangle wave rather than a sawtooth, but you can get a symmetric triangle wave by passing a bipolar sawtooth through an absolute value function. By adding an offset, and replacing the absolute value with an if statement that scales the signal differently for each polarity, you should be able to build an asymetric  triangle wave generator that is free of hidden state.

When you get it please share it. If it looks robust and generally useful, I will add it to the models page.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
sharpmental
Junior Member
**
Offline



Posts: 14

Re: Any advice for PSS converge?
Reply #13 - Mar 18th, 2015, 10:20pm
 
Hi Ken,

Yes, i got it now. There is really different direction to think about it.

1st I try to use 2 idt and idtmod. It works but I find when the simulation goes to 5mS or more, some error accumulated. The PWM signal either goes higher and higher or lower and lower. I am not sure if it is the simulator or something else wrong in my system.

Then from your explain, using $abstime should be OK for RF simulation. So I think I can use the operator % to check the time instead of save the "current start time".

Here is my code:

// VerilogA for dc_pwm, veriloga

`include "constants.vams"
`include "disciplines.vams"
module dc_pwm(VPWM, GND, VCC);
output VPWM;
electrical VPWM;
input GND;
electrical GND;
input VCC;
electrical VCC;

parameter real cycle = 20u;
parameter real falltime = 1u;
parameter real PWMref = 2.5;
parameter integer DEBUG = 0;

real xout;
real slope;
real wstart;
real wtime;
real polar;

real PWMvol;

analog begin
   @(initial_step) begin
       PWMvol = PWMref>V(VCC, GND)?V(VCC, GND):PWMref;
       wstart = 0;
       wtime = 0;
       polar = 1;
   end

   PWMvol = PWMref>V(VCC, GND)?V(VCC, GND):PWMref;//the high level of PWM singal

   wstart = $abstime-($abstime%cycle); //cycle start
   wtime = $abstime%cycle; //remain time
   polar = (wtime<(cycle-falltime))?1:-1; // rising or falling part
   slope = (polar>0)?(PWMvol/(cycle-falltime)):(-PWMvol/falltime); // slope
   
   xout = (1+polar)*0.5*slope*($abstime- wstart)+(1-polar)*0.5*(PWMvol + slope*($abstime- wstart - cycle + falltime));

   V(VPWM) <+ xout;
   
@(final_step) begin
   $strobe("Module = %M, slope = %g, wtime = %g, wstart=%g, time is %g", slope, wtime, wstart, $abstime);
end
end

endmodule
Back to top
 
 
View Profile   IP Logged
sharpmental
Junior Member
**
Offline



Posts: 14

Re: Any advice for PSS converge?
Reply #14 - Mar 18th, 2015, 10:26pm
 
Now my BUCK model works in PSS+PSTB, without any "instrument_module" declare.
But the PSTB and PAC result is still wrong.  :-[
There is still no gain, phase is flat at 180C.
So this is still "on going".
Back to top
 
 
View Profile   IP Logged
Pages: 1 2 
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.