Skip to main content

Module control

Module control 

Source
Expand description

Digital control: IIR filters (Butterworth, Chebyshev Type I), PID controller.

Provides biquad (second-order section) cascade filters designed via the bilinear transform, and a discrete-time PID controller with anti-windup and derivative filtering. All code is no-std compatible with no complex feature dependency — pole computation uses real arithmetic only.

§Examples

use numeris::control::{butterworth_lowpass, BiquadCascade};

// 4th-order Butterworth lowpass at 1 kHz, 8 kHz sample rate
let mut lpf: BiquadCascade<f64, 2> = butterworth_lowpass(4, 1000.0, 8000.0).unwrap();
let y = lpf.tick(1.0); // filter one sample
use numeris::control::Pid;

// PID controller at 100 Hz with output clamping
let mut pid = Pid::new(2.0_f64, 0.5, 0.1, 0.01)
    .with_output_limits(-10.0, 10.0);
let u = pid.tick(1.0, 0.0); // setpoint=1, measurement=0

Structs§

Biquad
A single second-order section (biquad) filter using Direct Form II Transposed.
BiquadCascade
A cascade of N biquad (second-order) sections.
Pid
Discrete-time PID controller with anti-windup and derivative filtering.

Enums§

ControlError
Errors from filter design functions.

Functions§

butterworth_highpass
Design a Butterworth highpass filter as a cascade of N biquad sections.
butterworth_lowpass
Design a Butterworth lowpass filter as a cascade of N biquad sections.
chebyshev1_highpass
Design a Chebyshev Type I highpass filter as a cascade of N biquad sections.
chebyshev1_lowpass
Design a Chebyshev Type I lowpass filter as a cascade of N biquad sections.