pub struct PressureControl {
pub active: bool,
pub in_tolerance: bool,
pub error: bool,
pub state: StateMachine,
/* private fields */
}Expand description
A closed-loop PID pressure/force controller for Profile Position (PP) axes.
This function block uses an Exponential Moving Average (EMA) filter to smooth
incoming load cell data. It calculates a PID output which is clamped to a safe
maximum step size and issued as a small, incremental move_absolute target
to the drive every cycle.
Fields§
§active: boolTrue when the block is actively executing and controlling the axis.
in_tolerance: boolTrue when the current load has been within config.tolerance of the target
for at least config.settling_time seconds.
error: boolTrue if a fault occurred (e.g., axis error). Check state.error_code.
state: StateMachineInternal state machine for operation sequencing and error reporting.
Implementations§
Source§impl PressureControl
impl PressureControl
Sourcepub fn call(
&mut self,
axis: &mut impl AxisHandle,
execute: bool,
target_load: f64,
current_load: f64,
config: &PressureControlConfig,
dt: f64,
)
pub fn call( &mut self, axis: &mut impl AxisHandle, execute: bool, target_load: f64, current_load: f64, config: &PressureControlConfig, dt: f64, )
Execute the pressure control loop.
axis: The handle to the PP axis.execute: Set to true to engage the controller. On a falling edge, the axis halts.target_load: The desired pressure/force (e.g., lbs or Newtons).current_load: The raw, instantaneous reading from the load cell.config: Tuning and safety parameters.dt: The cycle time delta in seconds (e.g., 0.001 for 1ms).
Trait Implementations§
Source§impl Clone for PressureControl
impl Clone for PressureControl
Source§fn clone(&self) -> PressureControl
fn clone(&self) -> PressureControl
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PressureControl
impl Debug for PressureControl
Auto Trait Implementations§
impl Freeze for PressureControl
impl RefUnwindSafe for PressureControl
impl Send for PressureControl
impl Sync for PressureControl
impl Unpin for PressureControl
impl UnsafeUnpin for PressureControl
impl UnwindSafe for PressureControl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more