• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. Spectre setting for comparator-based PWM

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 125
  • Views 14673
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Spectre setting for comparator-based PWM

greatqs
greatqs over 10 years ago

All,

I'm simulating a circuit with sinusoid being open-loop PWM modulated (natural sampled). Theoretically, the open-loop PWM modulation should be linear (no direct in-band signal harmonics). However, when I did the Spectre simulation with sweeping the reltol parameter, I found the distortion after anti-aliasing filtered and FFT is very big ( < 80dB) highly dependent on reltol with significant numerical noise floor. The THD gets flat (~140dB) until I set 'reltol' to some ridiculous value (method=gear2only, errpreset=conservative, reltol=1e-9).

I suspect this relates to Spectre time step algorithm to handle sharp zero-crossing points with good enough time step "accuracy" as I observed "numerical" jitter before in some frequency divider design which can be workaround by time step algorithm (i.e. LVLTIM) in other simulator.

Does anyone has experience on this and could share some lights?

Thanks,

QS

 

  • Cancel
  • ShawnLogan
    ShawnLogan over 10 years ago

    Dear QS,

    The amount of distortion you measure will be a function of both your time domain zero crossings accuracy as well as there record size of the FFT. I am not sure if you have done experiments to determine which is limiting your distortion.

    I might suggest that in lieu of forcing reltol to a small value, you set the value of simulation parameter maxstep to a value that will provide your desired level of time accuracy for the zero-crossings. Otherwise, the maximum integration time step is determined by TSTOP and the value of errpreset - which may cause the time step to exceed the level of accuracy you desire in the time domain simulation.

    Let me know if my thoughts are not clear to you!

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    A common cause of distortion in the FFT is caused by interpolation error when you are performing the FFT. Without knowing what the signals look like before you do the FFT, it's hard to know whether this will be the case, but ensuring that you minimise this interpolation error is easily achieved and is not costly.

    In general I would disagree with Shawn's suggestion of controlling maxstep. Forcing maxstep to be small is a good way of slowing the simulation down significantly (whereas tightening the reltol whilst loosening lteratio can tighten accuracy without vastly increasing the number of time steps). If you are reducing the timestep to reduce interpolation error, you would be better off using strobeperiod. If you are using the dft() function in ADE (which is a Fast Fourier Transform, always using a power of two number of points, regardless of the number you specify - it will use a power of two), then setting strobeperiod as a transient option such that the strobe points match the sample points for the FFT will cause the simulator to solve at the points you are sampling rather than them being interpolated between two simulated points either side of the sample point - this can significantly improve the accuracy of what you see in the FFT.

    Normally you only see the strobe points saved, but if you want to see the other points too, you also need to set strobeoutput=all. This isn't on the tran options form (despite it having been available in spectre for a number of releases now - I really must get around to ensuring that gets fixed) - so you have to go to the Misc tab (I think that's what it's called) of the tran options form, and find the field Additional Parameters (might be Additional Arguments), and type in strobeoutput=all.

    In general there aren't many cases where I set maxstep; one of the few is when simulating oscillators - but for most other driven circuits its not necessary or advisable.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 10 years ago
    Dear Andrew and QS,

    I apologize for my potential suggestion to utilize maxstep in your application QS. As most of my simulations are focused on various types of oscillators, I set this option frequently to provide the level of measurement accuracy I need.

    My apologies again for any confusion I caused.

    Shawn
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Shawn,

    No need to apologise - I'm very glad that you provide help to others on the forums. We all (including me) have things we can learn now and again!

    Note that the primary reason I use maxstep with oscillators is to help ensure enough points for the oscillator to actually start properly. I would probably use the PSS or HB analysis to analyse oscillators with sufficient accuracy (shooting PSS also controls maxstep in the shooting interval, but that is mainly to ensure spectral accuracy at high harmonics of the PSS fundamental). I don't normally use maxstep to control accuracy of the oscillator though - I'd use the accuracy parameters for that. But hey, your mileage may vary ;-)

    Kind Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information