This post describes the uses and classifications of constants.
Constants are widely used as components of control logic and algorithms, such as coefficients in formulas and threshold values in conditional branching. Depending on how the value is determined, they are classified as follows.
Logical constants
A constant calculated based on design specifications or logical basis, and refers to a value that is uniquely determined theoretically.
Usage Example:
Fixed timeout value in communication protocols (e.g., ACK waiting time)
Matching constants
Constants that are tuned to match the performance and behavior in the expected operating environment through actual machine testing or simulation. They are optimized through post-implementation tuning.
Example of use:
Correction factor for fuel injection amount in engine control. (corresponding to environmental temperature)
Calibration constants
A constant set for the purpose of compensating for variations in hardware, sensors, and other components that have individual differences. It is set for each individual product at the manufacturing stage or at the time of shipment to achieve uniform operating characteristics.
Example of use:
Zero-point compensation value for each sensor (e.g., offset for acceleration sensors)
Study value (reference)
In this section, training values are not strictly constant, but may be treated as constant under certain conditions. They are variables that are learned and updated from real data in the operating environment and are used in adaptive algorithms.
Example of use:
A/F learning in engine control