Compare commits

...

2 Commits

Author SHA1 Message Date
1a541c71ea
main: full redraw on initial connection
This seems to help if rotint is started before rotctld (which just
crashes on mac).
2024-08-14 15:26:06 -07:00
7bdea9644c
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.
2024-08-14 14:51:47 -07:00
2 changed files with 7 additions and 3 deletions

View File

@ -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,
@ -121,6 +121,8 @@ pub const RotInt = struct {
self.warn("rotator connected", .{});
self.sendRotatorCommand(.get_position);
self.state = .rotator_connected;
self.vx.queueRefresh();
self.draw() catch {};
},
.rotator_ready => if (self.state == .rotator_connected) {
self.warn("rotator ready", .{});

View File

@ -218,7 +218,9 @@ pub const Client = struct {
_ = result catch |err| {
self.rotint.warn("connect failed {}", .{err});
// retry bayeb
// Note: this loops instantaneously if the target address is on localhost
// and is not being listened on. Actually just straight up crashes on macOS.
// Probably need to use a timer to handle this better
return .rearm;
};