Hello,(adsbygoogle = window.adsbygoogle || []).push({});

I am trying to develop a software control algorithm to compensate for oscillator imperfections/frequency drift. I have a NTP server which I can get a pretty good estimation (@1Hz) of the "true" time and compare it to my system's time. I can differentiate the offset-error to calculate the time-drift (which is related to frequency error). I can then update my local real-time-clock (RTC) hardware to indicate the new frequency, the RTC will perform clock compensation with this new frequency. Once I can control the time-drift error to 0, my local clock matches very closely to the "true" time. If the oscillator drifts (due to temperature change or something), the control algorithm should detect it and compensate.

I've got this working fairly well with a SW PID controller, but the noise in the frequency-error is enough to cause the oscillation to swing around too much. I need to do some filtering/averaging to really get a good gauge of the true oscillator frequency, but doing this requires some delay. What I am noticing is that the PID controller will try to do a very small amount of change on the control signal, but due to the delay it will not see the effect of this for several samples. On the very next sample, the PID controller then tries to do additional change, still not seeing any difference. This gradual change starts to snowball. My control system starts to oscillate badly because it eventually tries to compensate for the previous over-compensation. It's actually worse than me not averaging at all...

I can reduce the effect by slowing down my controller dynamics, but I have to slow it down to a crawl to get it to be worthwhile. At that point the controller is awful and takes way too long to converge.

I was wondering if anyone has any suggestions for dealing with this?

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Discrete Control System with Time Delay

Loading...

Similar Threads - Discrete Control System | Date |
---|---|

What does the Navier-Stokes equation look like after time discretization? | Dec 2, 2016 |

Zero order hold -- Discrete control systems | May 28, 2015 |

Is a sine signal a continous signal (analog signal) or a digital signal (discrete signal)? | Oct 13, 2014 |

Discrete fourier transform data of 2 different sampling frequencies | Jul 10, 2014 |

Discrete Fourier Transform question | Mar 30, 2013 |

**Physics Forums - The Fusion of Science and Community**