interim-docs-update #3
Reference in New Issue
Block a user
Delete Branch "interim-docs-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
- Create pkg/interfaces/pid for generic PID controller interfaces: - ProcessVariable: abstract input (value + timestamp) - Source: provides process variable samples - Output: controller output with P/I/D components and clamping info - Controller: generic PID interface with setpoint/gains - Tuning: configuration struct for all PID parameters - Create pkg/pid as standalone PID controller implementation: - Thread-safe with mutex protection - Low-pass filtered derivative to suppress high-frequency noise - Anti-windup on integral term - Configurable output clamping - Presets for common use cases: rate limiting, PoW difficulty, temperature control, motor speed - Update pkg/ratelimit to use generic pkg/pid.Controller: - Limiter now uses pidif.Controller interface - Type assertions for monitoring/debugging state access - Maintains backward compatibility with existing API The generic PID package can now be used for any dynamic adjustment scenario beyond rate limiting, such as blockchain PoW difficulty adjustment, temperature regulation, or motor speed control. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>