Actuated Sensor
This module provides a class for the actuated sensor.
ATTRIBUTE | DESCRIPTION |
---|---|
MAX_SPEED |
Maximum speed
TYPE:
|
READ_FORMAT |
Format for reading data
TYPE:
|
MoveForceData |
NamedTuple for move force data
TYPE:
|
CLASS | DESCRIPTION |
---|---|
ActuatedSensor |
Actuated sensor class |
ForceDisplacement |
Stress-Strain program |
Documentation last updated: 2025-02-22
ActuatedSensor
ActuatedSensor(
port: str,
limits: Iterable[float] = (-30.0, 0),
force_threshold: float = 10000,
stabilize_timeout: float = 1,
force_tolerance: float = 0.01,
*,
home_displacement: float = -1.0,
max_speed: float = MAX_SPEED,
steps_per_second: int = 6400,
calibration_factor: float = 1.0,
correction_parameters: tuple[float] = (1.0, 0.0),
baudrate: int = 115200,
verbose: bool = False,
**kwargs,
)
Bases: LoadCell
Actuated sensor class
ATTRIBUTE | DESCRIPTION |
---|---|
force_threshold |
Force threshold
TYPE:
|
home_displacement |
Home position
TYPE:
|
limits |
Lower and upper limits for the actuator
TYPE:
|
max_speed |
Maximum speed
TYPE:
|
program |
program to run
TYPE:
|
displacement |
current displacement
TYPE:
|
baseline |
Baseline value
TYPE:
|
buffer |
data buffer for the device
TYPE:
|
buffer_df |
data buffer as a DataFrame
TYPE:
|
records |
records for the device
TYPE:
|
records_df |
records as a DataFrame
TYPE:
|
record_event |
event for recording data
TYPE:
|
runs |
dictionary of runs
TYPE:
|
n_runs |
number of runs
TYPE:
|
connection_details |
connection details for the device
TYPE:
|
device |
device object that communicates with physical tool
TYPE:
|
flags |
flags for the class
TYPE:
|
is_busy |
whether the device is busy
TYPE:
|
is_connected |
whether the device is connected
TYPE:
|
verbose |
verbosity of class
TYPE:
|
METHOD | DESCRIPTION |
---|---|
connect |
Connect to the device |
getData |
Get data from device |
getDataframe |
Get data as a DataFrame |
atDisplacement |
Check if the device is at the target displacement |
getDisplacement |
Get displacement |
zero |
Set current reading as baseline |
home |
Move the actuator to the home position |
move |
Move the actuator to the target displacement and apply the target force |
moveBy |
Move the actuator by desired distance |
moveTo |
Move the actuator to desired displacement |
touch |
Apply the target force |
run |
Run the program |
Initialize the actuated sensor
PARAMETER | DESCRIPTION |
---|---|
port
|
Serial port
TYPE:
|
limits
|
Lower and upper limits for the actuator
TYPE:
|
force_threshold
|
Force threshold
TYPE:
|
stabilize_timeout
|
Time to wait for the device to stabilize
TYPE:
|
force_tolerance
|
Tolerance for
TYPE:
|
home_displacement
|
Home position
TYPE:
|
max_speed
|
Maximum speed
TYPE:
|
steps_per_second
|
Steps per second
TYPE:
|
calibration_factor
|
Calibration factor
TYPE:
|
correction_parameters
|
Polynomial correction parameters
TYPE:
|
baudrate
|
Baudrate for serial communication
TYPE:
|
verbose
|
Print verbose output
TYPE:
|
atDisplacement
Check if the device is at the target displacement
PARAMETER | DESCRIPTION |
---|---|
displacement
|
Target displacement
TYPE:
|
current_displacement
|
Current displacement. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
True if the device is at the target displacement
TYPE:
|
getData
Get data from device
RETURNS | DESCRIPTION |
---|---|
MoveForceData
|
displacement, value, end_stop
TYPE:
|
getDisplacement
Get displacement
RETURNS | DESCRIPTION |
---|---|
float
|
Displacement in mm
TYPE:
|
home
Move the actuator to the home position
RETURNS | DESCRIPTION |
---|---|
bool
|
whether movement is successful
TYPE:
|
move
Move the actuator to the target displacement and apply the target force
PARAMETER | DESCRIPTION |
---|---|
by
|
distance in mm
TYPE:
|
speed
|
movement speed. Defaults to 0.375.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
whether movement is successful
TYPE:
|
moveBy
Move the actuator by desired distance
PARAMETER | DESCRIPTION |
---|---|
by
|
distance in mm
TYPE:
|
speed
|
movement speed. Defaults to 0.375.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
whether movement is successful
TYPE:
|
moveTo
Move the actuator to desired displacement
PARAMETER | DESCRIPTION |
---|---|
to
|
displacement in mm
TYPE:
|
speed
|
movement speed. Defaults to 0.375.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
whether movement is successful
TYPE:
|
record
record(
on: bool,
show: bool = False,
clear_cache: bool = False,
*,
callback: Callable | None = None,
**kwargs,
)
Record data from the device
PARAMETER | DESCRIPTION |
---|---|
on
|
whether to record data
TYPE:
|
show
|
whether to show data. Defaults to False.
TYPE:
|
clear_cache
|
whether to clear the cache. Defaults to False.
TYPE:
|
callback
|
callback function to process data. Defaults to None.
TYPE:
|
stream
Stream data from the device
PARAMETER | DESCRIPTION |
---|---|
on
|
whether to stream data
TYPE:
|
show
|
whether to show data. Defaults to False.
TYPE:
|
callback
|
callback function to process data. Defaults to None.
TYPE:
|
touch
touch(
force_threshold: float = 0.1,
displacement_threshold: float | None = None,
speed: float | None = None,
from_top: bool = True,
) -> bool
Apply the target force
PARAMETER | DESCRIPTION |
---|---|
force_threshold
|
target force
TYPE:
|
displacement_threshold
|
target displacement
TYPE:
|
speed
|
movement speed
TYPE:
|
from_top
|
whether to move from the top or bottom
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
whether movement is successful (i.e. force threshold is not reached)
TYPE:
|
ForceDisplacement
ForceDisplacement(
instrument: ActuatedSensor | None = None,
parameters: dict | None = None,
verbose: bool = False,
)
Bases: Program
Stress-Strain program
run
run(
force_threshold: float = 10,
displacement_threshold: float = -20,
speed: float | None = None,
stepped: bool = False,
*,
step_size: float = 0.1,
step_interval: float = -5,
pullback: float = 0,
clear_cache: bool = True,
) -> DataFrame
Run the program
PARAMETER | DESCRIPTION |
---|---|
force_threshold
|
Force threshold
TYPE:
|
displacement_threshold
|
Displacement threshold
TYPE:
|
speed
|
Movement speed
TYPE:
|
stepped
|
Stepped movement
TYPE:
|
step_size
|
Step size
TYPE:
|
step_interval
|
Step interval
TYPE:
|
pullback
|
Pullback distance
TYPE:
|
clear_cache
|
Clear data cache
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
DataFrame
|
pd.DataFrame: Data as a DataFrame |