Commit ac6542d1 authored by Alessandro Rubini's avatar Alessandro Rubini

servo: remove needless ofm_filter

The "offset from master" filter was "a simple two-sample average" as
documented in the header, and the result of such average is used only
in the PI controller.

Thus, by averaging we have no effect at all in the I component and
only a spread over two samples of the P component for each sample.  In
practice, it has no effect at all.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent da37d310
......@@ -71,19 +71,11 @@ struct pp_frgn_master {
* are used in servo.c src, where specific function for time setting of the
* machine are implemented.
*
* pp_ofm_fltr: The FIR filtering of the offset from master input is a simple,
* two-sample average
*
* pp_owd_fltr: It is a variable cutoff/delay low-pass, infinite impulse
* response (IIR) filter. The one-way delay filter has the difference equation:
* s*y[n] - (s-1)*y[n-1] = x[n]/2 + x[n-1]/2,
* where increasing the stiffness (s) lowers the cutoff and increases the delay.
*/
struct pp_ofm_fltr {
Integer32 nsec_prev;
Integer32 y;
};
struct pp_owd_fltr {
Integer32 nsec_prev;
Integer32 y;
......@@ -95,7 +87,6 @@ struct pp_servo {
TimeInternal s_to_m_dly;
Integer32 obs_drift;
struct pp_owd_fltr owd_fltr;
struct pp_ofm_fltr ofm_fltr;
};
/*
......
......@@ -57,7 +57,6 @@ void pp_servo_got_resp(struct pp_instance *ppi)
TimeInternal *s_to_m_dly = &SRV(ppi)->s_to_m_dly;
TimeInternal *owd = &DSCUR(ppi)->oneWayDelay;
TimeInternal *ofm = &DSCUR(ppi)->offsetFromMaster;
struct pp_ofm_fltr *ofm_fltr = &SRV(ppi)->ofm_fltr;
struct pp_owd_fltr *owd_fltr = &SRV(ppi)->owd_fltr;
Integer32 adj;
int s;
......@@ -152,16 +151,6 @@ void pp_servo_got_resp(struct pp_instance *ppi)
/* update 'offsetFromMaster', (End to End mode) */
sub_TimeInternal(ofm, m_to_s_dly, owd);
if (ofm->seconds) {
/* cannot filter with secs, clear filter */
ofm_fltr->nsec_prev = 0;
goto adjust;
}
/* filter 'offsetFromMaster' */
ofm_fltr->y = (ofm->nanoseconds + ofm_fltr->nsec_prev) / 2;
ofm_fltr->nsec_prev = ofm->nanoseconds;
ofm->nanoseconds = ofm_fltr->y;
if (OPTS(ppi)->max_rst) { /* If max_rst is 0 then it's OFF */
if (ofm->seconds) {
pp_diag(ppi, servo, 1, "%s aborted, offset greater "
......@@ -178,7 +167,6 @@ void pp_servo_got_resp(struct pp_instance *ppi)
}
}
adjust:
if (ofm->seconds) {
TimeInternal time_tmp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment