Increase default first step threshold to 20 us.

Most PHC drivers implement stepping (ADJ_SETOFFSET) by reading the
clock, adjusting the value by the offset and writing it back. This is
not perfectly accurate and if the operation is slow (e.g. due to PCIe
latencies), the error can be in microseconds.

Increase the default first step threshold from 100 nanoseconds to 20
microseconds to step only when the initial offset is larger than
the error in the step.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2014-03-18 18:25:13 +01:00 committed by Richard Cochran
parent 61de819d56
commit 2b099cfa06
6 changed files with 7 additions and 7 deletions

View File

@ -49,7 +49,7 @@ pi_integral_scale 0.0
pi_integral_exponent 0.4 pi_integral_exponent 0.4
pi_integral_norm_max 0.3 pi_integral_norm_max 0.3
step_threshold 0.0 step_threshold 0.0
first_step_threshold 0.0000001 first_step_threshold 0.00002
max_frequency 900000000 max_frequency 900000000
clock_servo pi clock_servo pi
sanity_freq_limit 200000000 sanity_freq_limit 200000000

View File

@ -49,7 +49,7 @@ pi_integral_scale 0.0
pi_integral_exponent 0.4 pi_integral_exponent 0.4
pi_integral_norm_max 0.3 pi_integral_norm_max 0.3
step_threshold 0.0 step_threshold 0.0
first_step_threshold 0.0000001 first_step_threshold 0.00002
max_frequency 900000000 max_frequency 900000000
clock_servo pi clock_servo pi
sanity_freq_limit 200000000 sanity_freq_limit 200000000

View File

@ -106,7 +106,7 @@ Specify the integral constant of the PI controller. The default is 0.3.
Specify the step threshold of the servo. It is the maximum offset that Specify the step threshold of the servo. It is the maximum offset that
the servo corrects by changing the clock frequency instead of stepping the the servo corrects by changing the clock frequency instead of stepping the
clock. The clock is stepped on start regardless of the option if the offset is clock. The clock is stepped on start regardless of the option if the offset is
larger than 100 nanoseconds (unless the larger than 20 microseconds (unless the
.BI \-F .BI \-F
option is used). It's specified in seconds. The value of 0.0 disables stepping option is used). It's specified in seconds. The value of 0.0 disables stepping
after the start. The default is 0.0. after the start. The default is 0.0.
@ -115,7 +115,7 @@ after the start. The default is 0.0.
Specify the step threshold applied only on the first update. It is the maximum Specify the step threshold applied only on the first update. It is the maximum
offset that is corrected by adjusting clock. It's specified in seconds. The offset that is corrected by adjusting clock. It's specified in seconds. The
value of 0.0 disables stepping on start. value of 0.0 disables stepping on start.
The default is 0.0000001 (100 nanoseconds). The default is 0.00002 (20 microseconds).
.TP .TP
.BI \-R " update-rate" .BI \-R " update-rate"
Specify the slave clock update rate when running in the direct synchronization Specify the slave clock update rate when running in the direct synchronization

View File

@ -565,7 +565,7 @@ static void usage(char *progname)
" -P [kp] proportional constant (0.7)\n" " -P [kp] proportional constant (0.7)\n"
" -I [ki] integration constant (0.3)\n" " -I [ki] integration constant (0.3)\n"
" -S [step] step threshold (disabled)\n" " -S [step] step threshold (disabled)\n"
" -F [step] step threshold only on start (0.0000001)\n" " -F [step] step threshold only on start (0.00002)\n"
" -R [rate] slave clock update rate in HZ (1.0)\n" " -R [rate] slave clock update rate in HZ (1.0)\n"
" -N [num] number of master clock readings per update (5)\n" " -N [num] number of master clock readings per update (5)\n"
" -O [offset] slave-master time offset (0)\n" " -O [offset] slave-master time offset (0)\n"

View File

@ -355,7 +355,7 @@ The maximum offset the servo will correct by changing the clock
frequency instead of stepping the clock. This is only applied on the first frequency instead of stepping the clock. This is only applied on the first
update. It's specified in seconds. When set to 0.0, the servo won't step update. It's specified in seconds. When set to 0.0, the servo won't step
the clock on start. the clock on start.
The default is 0.0000001 (100 nanoseconds). The default is 0.00002 (20 microseconds).
This option used to be called (and can still be set by) This option used to be called (and can still be set by)
.BR pi_f_offset_const . .BR pi_f_offset_const .
.TP .TP

View File

@ -25,7 +25,7 @@
#define NSEC_PER_SEC 1000000000 #define NSEC_PER_SEC 1000000000
double servo_step_threshold = 0.0; double servo_step_threshold = 0.0;
double servo_first_step_threshold = 0.0000001; /* 100 nanoseconds */ double servo_first_step_threshold = 0.00002; /* 20 microseconds */
int servo_max_frequency = 900000000; int servo_max_frequency = 900000000;
struct servo *servo_create(enum servo_type type, int fadj, int max_ppb, int sw_ts) struct servo *servo_create(enum servo_type type, int fadj, int max_ppb, int sw_ts)