Simulation of crystal oscillator circuit a Simscape does not converge
8 views (last 30 days)
Show older comments
Hi all,
I'm trying to simulate the effect of load capacitors on a oscillator circuit using the Crystal Simscape block. This is in fact a simple Pierce oscillator, see e.g. https://www.elprocus.com/pierce-oscillator-working-and-its-applications/

I'm following Guidelines for oscillator design on https://www.st.com/resource/en/application_note/cd00221665-oscillator-design-guide-for-stm8afals-stm32-mcus-and-mpus-stmicroelectronics.pdf to parametrize the passives and added an initial voltage to the crystal to (hopefully) start the oscillation.

Unfortunately, the model does not run at all:
Error:An error occurred during simulation and the simulation was terminated
Caused by:
['crystal_model_simplified/Solver Configuration']: Transient initialization at time 7.414431651271723e-06, solving for consistent states and modes, failed to converge.
Nonlinear solver: failed to converge, residual norm too large.
Here is the set of components with unconverged equations:
'crystal_model_simplified/Inverter'
Equation location is:
'ee.ic.logic.logic_1ip_eqn'(no line number info)
'crystal_model_simplified/Crystal'
Equation location is:
'foundation.electrical.elements.inductor' (line 34)
Equation location is:
'foundation.electrical.elements.inductor' (line 34)
'crystal_model_simplified/Inverter'
Equation location is:
'foundation.electrical.elements.capacitor' (line 36)
The model is attached.
Do you have ideas what's going wrong?
Thanks!
Answers (1)
Steve Miller
on 24 Mar 2025
While I can't say for sure what is going wrong, if I set Rf to 1e9 the simulation runs to completion and the value on the Scope looks unchanged. Perhaps look at the quantities you care about and see if that modification is acceptable.
0 Comments
See Also
Categories
Find more on Electrical Sensors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!