Visible to Intel only — GUID: mkx1667813263287
Ixiasoft
Visible to Intel only — GUID: mkx1667813263287
Ixiasoft
31.3. Genlock Controller IP Functional Description
The PFD measures differences between the VCXO input clock (vcxo_clk) and selected reference clock (ref_clk) to produce an error value e(t).
The PID LPF receives the error and accumulates it to produce an output control value c(t) that is proportional to the error. This output control value passes into the PWM DAC that converts it to a series of pulses that drives the external VCXO via a simple external resistor-capacitor (RC) network. The rate of pulses determines a voltage level on the VCXO, which changes the VCXO frequency. Therefore, the PFD output error changes as it is based on the new VCXO clock frequency (hence the feedback). The algorithm continues until the IP minimizes the error value.
The IP aims to reduce the error between the VCXO clock and the reference clock to zero indicating that the clocks must be at the same frequency.
The IP includes a profiler module, which allows measuring receive and transmit pixel clock frequency values. The profiler calculates the latency between receive and transmit SOF toggle pulses. It provides a general purpose output (GPO) bus, which you can map to LEDs to visualize the status of the genlock system.
Generally, the control loop operates in Phase mode or Frequency mode.
In Phase mode, the control loop aims to reduce the delta between the VCXO and selected reference clock measurements to remain in sync. In Frequency mode, the control loop aims to reduce the rate of change between the VCXO and selected reference clock measurements.
The choice of mode depends on requiring hard and soft genlock and the input to output video latencies.
The following factors contribute to the configuration parameters you select for your design:
- VCXO performance (base frequency, sweep range, reaction time)
- RC performance
- Nominal differences between VCXO and reference clocks, including ppm tolerances
- Rate of tracking required
- Stability (jitter) of reference clocks
- Additional error, jitter, and frequency changes that PLLs introduce between the VCXO and FPGA
Tuning the control loop must ensure the loop is stable and lock reasonably quickly. You should test your design using CPU programmable features (such as PID gains) to find the best solution.
PID Controller
The PID controller uses three control terms (proportional, integral, and derivative) to achieve an optimal response to a measured input. The IP reads the difference between the reference and VCXO clock frequencies. It generates a corrective output to modulate the VCXO frequency to match that of the reference clock.
- Kp is proportional term which includes a gain factor K. Changes in e(t) cause the proportional effort to react accordingly. No error equates to no proportional effort.
- Ki denotes the integral term that also includes a gain factor K. The IP integrates e(t) values (post gain) over time. They represent the past historic values of the control effort. The integral stops growing when you eliminate e(t).
- Kd is the derivative term that can estimate the future trend based on the current rate of change in e(t). Again, it includes a gain factor K.
You must tune the gain values to balance the terms to produce the required step response to the error input. The step response needs to be accurate but also respond timely to achieve lock.
For the genlock controller IP, e(t) is:
e(t) = reference clock counter – vcxo clock counter
It can be positive or negative depending on which clock is faster. It uses 2’s complement maths.
Depending on the ppm differences, e(t) should be of a sufficient value to allow the controller to work using a feedback loop. Consequently, the IP samples e(t) periodically instead of continuously. The period depends on many factors like ppm differences, VCXO reaction time, and lock time.
For the proportional gain, high values produce a large change on the output for a given change to e(t). These high values can cause large over and under shoots of the ideal output value and the control loop can become unstable. However, if the gain is too small, the controller can be less responsive and take a long time to achieve lock.
The integral term is the sum of the sampled e(t) (post gain) over time. The IP uses this term to accelerate towards the ideal output value. As with the proportional term, too high gain can cause over and under shoots and too small causes a slow response time.
In this IP, e(t) experiences jitter from both the recovering input clocks and over time because of temperature. Therefore, it never stays at zero and likely drifts or wobbles around. The IP ensures that at this time small changes in e(t) produce small enough changes to the output to ensure accuracy and achieve genlock. But it must not introduce excessive output jitter that may break any standards specifications (such as SDI).