What are some guidelines for the "ptp2 config" parameters for servo control?
There is no exact formula on how to set the servo parameters for the best result, especially if you do not know what the PDV you want to overcome looks like.
In the case of G.8261 here are a few rules of thumb.
1. If you know that you will always have a significant “floor” of packets that have minimum delay, you can use the engineered network mode (ptp2 config -n e). That will lock the servo to only use a minimum set of statistics. The engineered network mode can avoid jumps in offset you might experience when the servo jumps between using the minimum, average or median set of statistics. However, if there is no significant amount of packets that passes through with minimum delay, it's better to stay at the default generic network mode (ptp2 config -n g)
2. If there are periods of very large PDV, it might be better for the servo to go into holdover. When this should happen is basically controlled by the quality threshold (ptp2 config -q <value>). The quality threshold defines the allowed variation in nsec on the statistic parameter (min, ave or med) before going into holdover. The default is 1500 nsec. Lowering this value will allow less variation on the statistical parameter before going into holdover. If the PDV “bursts” are short, setting this to e.g. 500 nsec might give a better result if the servo has difficulties regulating during some periods. Remember that the TCXO has worse holdover performance and should theoretically use a higher quality threshold.
3. A shorter startup time constant (ptp2 config -s) will allow for a shorter time until synchronization. But if there is significant PDV also during the startup phase, having a too short time constant will make it difficult for the servo to converge. There might also a risk of oscillation at the switch between startup and main time constant if the difference is too large. The shift from startup to main time constant happens when the servo goes from not synchronized to synchronized.