1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Fixed-point arithmetic support for PID-style control on MCUs without FPU.
//!
//! Provides Q-format newtype wrappers around [`fixed::FixedI32`] types.
//! All types implement [`crate::core::scalar::PidScalar`], enabling use with
//! `pid::standard::Pid` and related algorithms without floating-point hardware.
//!
//! # Scope
//! Only algorithms that do NOT require transcendental functions (sin, cos, exp,
//! sqrt, etc.) are compatible. Currently: `Pid`, `DerivativeFilter`, `AntiWindupMethod`.
//! Algorithms using `ControlScalar` (KF, EKF, Butterworth, FOC, flatness, etc.)
//! are NOT compatible with fixed-point types.
//!
//! # Available Q-Format Types
//! - [`Q15_16`]: ±32768 range, ~0.0000153 resolution (general-purpose PID)
//! - [`Q3_29`]: ±4 range, ~1.86e-9 resolution (high-precision normalized signals)
//! - [`Q7_24`]: ±128 range, ~5.96e-8 resolution (medium-range precision)
//!
//! Note: `Q1_31` (I1F31) is excluded because the signed fixed-point type with
//! 1 integer bit cannot represent `ONE` (range is [-1, 1)), which would corrupt
//! the multiplicative identity required by `PidScalar`.
//!
//! # Example
//! ```rust,ignore
//! use oxictl::core::fixed_point::{Q15_16, fixed_from_f32_saturating};
//! ```
pub use ;
pub use FixedError;
pub use ;