You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kalman-filter added
- a debug servo has been also added
- settings interface and timeutils have been extended
- documentation updated
- CLI cmd: addend conversion fixed
Copy file name to clipboardExpand all lines: manual/servo.dox
+114-2Lines changed: 114 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
# Clock servo
4
4
5
+
## Interface
6
+
5
7
The flexPTP requires a clock servo to calculate how to tune the clock in steady state. A proper servo must define the following four functions:
6
8
7
9
1. A function that initializes the servo. No parameters are passed. (refer to `PTP_SERVO_INIT()`)
@@ -13,8 +15,118 @@ Clock servo functions must be passed to the flexPTP core by filling the servo-re
13
15
14
16
Here we want to highlight that a servo init function is not constrained to only initialize the core of a controller. The developer is highly encouraged to include e.g. logging or debug functionality also in the controller.
15
17
16
-
## Examples
18
+
## Bundled controllers
19
+
20
+
Currently, the library ships with two (plus one) different, predefined servos.
21
+
22
+
### PID-controller
23
+
24
+
_CMake: `set(FLEXPTP_SERVO "PID")`_
25
+
26
+
A simple PID-controller is implemented in the following sources: pid_controller.c, pid_controller.h
27
+
28
+
Parameters and default values (all parameters are unit-less):
29
+
30
+
| Name | Value |
31
+
| ----- | ----- |
32
+
| `K_P` | 0.238 |
33
+
| `K_I` | 0 |
34
+
| `K_D` | 3.0 |
35
+
36
+
Custom parameter values can be set in the `flexptp_options.h` by redefining each macro.
37
+
38
+
#### CLI commands
39
+
40
+
This servo defines the following CLI commands:
41
+
42
+
```
43
+
ptp servo params [Kp Ki Kd] Set or query Kp, Ki, and Kd servo parameters
44
+
ptp servo log internals {on|off} Enable or disable logging of servo internals
45
+
```
46
+
47
+
#### Example usage definitions
48
+
49
+
To use this servo, set the servo definition macros the following way:
The library offers a robust Kalman-filter-based servo as well defined in the following sources: kalman_filter.c, kalman_filter.h. This implementation is based on the paper [Performance Analysis of Kalman-Filter-Based Clock Synchronization in IEEE 1588 Networks](https://ieeexplore.ieee.org/document/5934411) by Giada Giorgi and Claudio Narduzzi.
65
+
66
+
The controller can be tuned along three parameters (\f$\sigma_{\theta}\f$, \f$\sigma_{\gamma}\f$, \f$\sigma_{C(t)}\f$) that are described in the paper.
67
+
68
+
Parameters and default values:
69
+
70
+
| Name | Value | Unit |
71
+
| --------------------- | ----- | --------- |
72
+
| `SIGMA_THETA_SQUARED` | 1E-16 | \f$s^2\f$ |
73
+
| `SIGMA_GAMMA_SQUARED` | 1E-12 | \f$s^2\f$ |
74
+
| `SIGMA_CT_SQUARED` | 1E-10 | \f$s^2\f$ |
75
+
76
+
Custom parameter values can be set in the `flexptp_options.h` by redefining each macro.
77
+
78
+
#### CLI commands
79
+
80
+
This servo defines the following CLI commands:
81
+
82
+
```
83
+
ptp servo st [var|default] Set or get sigma_theta^2 (s^2)
84
+
ptp servo sg [var|default] Set or get sigma_gamma^2 (s^2)
85
+
ptp servo stm [var|default] Set or get sigma_theta_m^2 (s^2)
86
+
```
87
+
88
+
#### Example usage definitions
89
+
90
+
To use this servo, set the servo definition macros the following way:
0 commit comments