This example shows how to use Simulink® Design Optimization™ to tune an all-pass filter of a Phase Lock Loop. The filter includes a second-order low pass filter and a feedthrough gain. The feedthrough gain and the second order filter coefficients are tuned to apply a steady-state input to the Voltage Controlled Oscillator (VCO).
Requires Signal Processing Toolbox™.
phaselock_demo model using the command below and run the simulation. The simulation produces an unoptimized input to the VCO and the initial data for optimization.
Double-click the Scope block to view the unoptimized input to the VCO.
Loop Optimizer block to view constraints on the input to the VCO. The constraints represent a step response with 0.1 second rise-time and 20 percent overshoot.
You can launch Response Optimization Tool using the Apps menu in the Simulink toolstrip, or the
sdotool command in MATLAB. You can launch a pre-configured optimization task in Response Optimization Tool by first opening the model and by double-clicking on the orange block at the bottom of the model. From the Response Optimization Tool, press the Plot Model Response button to simulate the model and show how well the initial design satisfies the design requirements.
We start the optimization by pressing the Optimize button from the Response Optimization Tool. The plots are updated to indicate that the design requirements are now satisfied.
The solid curve shows the final optimized input to the VCO.
% Close the model bdclose('phaselock_demo')