From e4393c2e5ae348f5a08429630c2d6b2f4e42a4e4 Mon Sep 17 00:00:00 2001 From: torque Date: Wed, 10 Jul 2024 12:43:11 -0700 Subject: [PATCH] config: change default control loop interval On an unloaded rotator, this fixes the rapid relay toggling without needing to implement debouncing. An additional configuration validation should probably be added: the rotator rotates in azimuth about 6 deg per second. If the control loop speed is too slow or the controller angle tolerance is small enough, then the controller will never be able settle (imagine that the loop interval is 1 second. That means the rotator will move approximately 6 degrees every loop iteration, so it will always overshoot. --- src/Config.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config.zig b/src/Config.zig index 399f47d..8bc8cf9 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -114,7 +114,7 @@ controller: ControllerConfig = .{ .elevation_input = .{ .channel = .diff_23, .range = .@"5 V" }, .azimuth_outputs = .{ .increase = .{ .io = 0 }, .decrease = .{ .io = 1 } }, .elevation_outputs = .{ .increase = .{ .io = 2 }, .decrease = .{ .io = 3 } }, - .loop_interval_ns = 50_000_000, + .loop_interval_ns = 100_000_000, .parking_posture = .{ .azimuth = 180, .elevation = 90 }, .angle_tolerance = .{ .azimuth = 1, .elevation = 1 }, .angle_offset = .{ .azimuth = 0, .elevation = 0 },