mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
STM32 clock sync defaults
This commit is contained in:
parent
803222dcc3
commit
4a761b44bb
@ -43,10 +43,10 @@ struct UtcSyncParams
|
||||
{
|
||||
float p = 0.01; ///< Correction PPM per 1 usec error
|
||||
float i_fwd = 0.0001;
|
||||
float i_rev = i_fwd * 10.0;
|
||||
float rate_error_corner_freq = 0.05;
|
||||
float i_rev = i_fwd * 5.0;
|
||||
float rate_error_corner_freq = 0.01;
|
||||
float max_rate_correction_ppm = 300;
|
||||
float lock_thres_rate_ppm = 10.0;
|
||||
float lock_thres_rate_ppm = 2.0;
|
||||
uavcan::UtcDuration lock_thres_offset = uavcan::UtcDuration::fromMSec(4);
|
||||
uavcan::UtcDuration min_jump = uavcan::UtcDuration::fromMSec(10); ///< Min error to jump rather than change rate
|
||||
};
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
|
||||
*/
|
||||
|
||||
#include <crdr_chibios/sys/sys.h>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <uavcan_stm32/clock.hpp>
|
||||
@ -188,6 +189,9 @@ static void updateRatePID(uavcan::UtcDuration adjustment)
|
||||
rate_correction_ppm = std::min(rate_correction_ppm, utc_sync_params.max_rate_correction_ppm);
|
||||
|
||||
utc_correction_nsec_per_overflow = (USecPerOverflow * 1000) * (rate_correction_ppm / 1e6F);
|
||||
|
||||
lowsyslog("$ adj=%f rate_err=%f int=%f ppm=%f\n",
|
||||
adj_usec, utc_inv_rate_error_ppm, utc_integrated_error, rate_correction_ppm);
|
||||
}
|
||||
|
||||
void adjustUtc(uavcan::UtcDuration adjustment)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user