Re: timer system - any thoughts?




Paul Carpenter wrote:
>"Lanarcam" wrote:
> >Paul Carpenter wrote:
> >> System time may be changed because of operator action or potentially
> >> software does how to adjust for losing/gaining time over a time period
> >> or you have a second source to synchronise time and date (e.g. radio clock
> >> or network time).
> >
> >In this case what is often done instead of changing the system time
> >abruptly upon reception of a synchronisation message is to speed up
> >or down the system timer by modifying temporarily the value of the
> >counter until the system time is synchronized again. In that way
> >events are not missed.
>
> Yes depending on application, would not want a heating system controller
> on the coldest day of year need system time change to go through the
> whole weekend of on/off, as time was 'speeded' up.

The progressive adjustment of the system time is of course limited to
the cases where the difference between internal time and source time
is below a certain threshold. For instance if the difference is below
one second you can adjust progressively otherwise you make an
abrupt update. However when the hardware is fit and if the sytem
time has already been synchronized at least once you should only
see deviations due to the drift of the timer, except for changes
due to daylight saving time.

> For whatever reason
> it was wrong in the first place (even operator error of setting wrong
> time in the first place).

If the system time can be set both by an operator and by an external
clock you can use validity flags. For instance the time is valid only
when it has first been synchronized by an external clock. It becomes
invalid again if no synchronization message is received for a preset
period of time.

> Sometimes if a bunch of events have been
> missed you have two choices (depending on application) just skip missed
> events, or another is only action last. If a whole bunch has been missed
> then some applications (brewing beer as an example) may mean throw away
> what the process is and reset.

You could also in some cases have the system time independant of
the actual time, except for drift compensation. External clock
sources give warnings about exceptional events and you can use them
to discard changes and consider only the deviation.

> Each application has its different issues and what to do with missed
> or potentially missed events and all mthods of time changes must be
> thought through before assigning thoughts to the scheduler software
> design.

.



Relevant Pages

  • Re: timer system - any thoughts?
    ... >>> Thanks for the info. Can you elaborate on the schedule logic? ... Similarly what to do if the system time ... > is changed and you have missed events. ... > or you have a second source to synchronise time and date (e.g. radio clock ...
    (comp.arch.embedded)
  • Re: timer system - any thoughts?
    ... >> Also look at the source for things like 'cron' timed task scheduling. ... Similarly what to do if the system time ... >> or you have a second source to synchronise time and date (e.g. radio clock ... Sometimes if a bunch of events have been ...
    (comp.arch.embedded)
  • Re: Time until synchronized
    ... The time source is not a special one (specifically modem clocks) for ... consistently within 128ms of the system time. ... the output of ntpq peers and ntpq rv 0 and rv ... If you don't get your first synchronise within ...
    (comp.protocols.time.ntp)