Skip to content

Commit b3c3713

Browse files
committed
Refine dead zone logic in PID controller
- Updated the handling of the dead zone in the PID controller to allow full signal response above the dead zone, improving control accuracy. - Adjusted comments for clarity regarding the purpose of the dead zone in noise suppression.
1 parent 49c90e1 commit b3c3713

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/semian/pid_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ def calculate_p_value(current_error_rate)
148148
# Within dead zone: suppress noise
149149
delta_error = 0.0
150150
else
151-
# Above dead zone: react to excess only
152-
delta_error = raw_delta - dead_zone
151+
# Above dead zone: full signal, dead zone only silences noise
152+
delta_error = raw_delta
153153
end
154154

155155
delta_error - (1 - delta_error) * @rejection_rate

0 commit comments

Comments
 (0)