From 7bdea9644cff856d75b71b5c8c21f943560264fb Mon Sep 17 00:00:00 2001 From: torque Date: Wed, 14 Aug 2024 14:51:47 -0700 Subject: [PATCH] main: change default polling intervals The serial interface on the MD-01 seems to be extremely slow (this is with USB serial, though the RS232 ports probably have the exact same issue. It seems that sending requests too quickly may negatively impact the performance of the controller/rotator (i.e. makes it shake more)? I'm not exactly sure this is the correct conclusion, since our timings do not compensate for the actual communication time with the MD-01 (i.e. the 100ms poll rate sends the next request at least 100ms after it has received a reply). However, based on empirical testing, running these at a lower pace (perhaps particularly, the command frequency?) seems to make a big difference in the amount of shake observed. We will need to keep an eye on this over time. --- src/main.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.zig b/src/main.zig index e856191..9eda383 100644 --- a/src/main.zig +++ b/src/main.zig @@ -80,8 +80,8 @@ pub const RotInt = struct { offsets: AzEl = .{ .az = 0, .el = 0 }, requested_posture: AzEl = .{ .az = 0, .el = 0 }, current_posture: AzEl = .{ .az = 0, .el = 0 }, - poll_interval: u64 = 100, - command_freq: u8 = 10, + poll_interval: u64 = 500, + command_freq: u8 = 4, pollcount: u9 = 0, state: State = .initial,