Force Actuator
COLUMNS
module-attribute
Headers for output data from force sensor
ForceActuator
ForceActuator(
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),
touch_force_threshold: float = 2 * G,
touch_timeout: int = 300,
from_top: bool = True,
baudrate: int = 115200,
verbose: bool = False,
**kwargs,
)
ForceSensor provides methods to read out values from a force sensor
ATTRIBUTE | DESCRIPTION |
---|---|
baseline |
baseline readout at which zero newtons is set
TYPE:
|
calibration_factor |
calibration factor of device readout to newtons
TYPE:
|
displacement |
machine displacement
TYPE:
|
end_stop |
whether the end stop is triggered
TYPE:
|
home_displacement |
starting displacement of home position
TYPE:
|
precision |
number of decimal places to print force value
TYPE:
|
threshold |
force threshold to stop movement
TYPE:
|
force |
force experienced
TYPE:
|
limits |
lower and upper limits of movement
TYPE:
|
METHOD | DESCRIPTION |
---|---|
clearCache |
clear most recent data and configurations |
disconnect |
disconnect from device |
getForce |
get the force response |
home |
home the actuator |
isFeasible |
checks and returns whether the target displacement is feasible |
measure |
measure the stress-strain response of sample |
move |
move the actuator by desired distance. Alias of moveBy() method |
moveBy |
move the actuator by desired distance |
moveTo |
move the actuator to desired displacement |
reset |
reset the device |
setThreshold |
set the force threshold for the machine |
shutdown |
shutdown procedure for tool |
tare |
alias for zero() |
stream |
start or stop feedback loop |
record |
start or stop data recording |
touch |
touch the sample |
waitThreshold |
wait for force sensor to reach the force threshold |
zero |
set the current reading as baseline (i.e. zero force) |
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:
|
atForce
atForce(
force: float,
current_force: float | None = None,
*,
tolerance: float | None = None,
stabilize_timeout: float = 0,
) -> bool
Check if the device is at the target force
PARAMETER | DESCRIPTION |
---|---|
force
|
Target force
TYPE:
|
current_force
|
Current force
TYPE:
|
tolerance
|
Tolerance for force
TYPE:
|
stabilize_timeout
|
Time to wait for the device to stabilize
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
True if the device is at the target force
TYPE:
|
getData
Get data from device
RETURNS | DESCRIPTION |
---|---|
MoveForceData
|
Data from device
TYPE:
|
getDataframe
Get dataframe of data collected
PARAMETER | DESCRIPTION |
---|---|
data_store
|
data store
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
DataFrame
|
pd.DataFrame: dataframe of data collected |
getDisplacement
Get displacement
RETURNS | DESCRIPTION |
---|---|
float
|
Displacement in mm
TYPE:
|
getForce
Get the force response and displacement of actuator
RETURNS | DESCRIPTION |
---|---|
str
|
device response
TYPE:
|
getValue
Get the value readout from device
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: Value readout |
home
Home the actuator
RETURNS | DESCRIPTION |
---|---|
bool
|
whether homing is a success
TYPE:
|
loadProgram
loadProgram(
program: Program,
docstring_parser: Callable[[Any, bool], ProgramDetails]
| None = None,
)
Load a program to the Measurer
PARAMETER | DESCRIPTION |
---|---|
program
|
program to load
TYPE:
|
measure
measure(
*args,
parameters: dict | None = None,
blocking: bool = True,
**kwargs,
) -> DataFrame | None
Run the measurement program
args: positional arguments parameters (dict, optional): dictionary of kwargs. Defaults to None. blocking (bool, optional): whether to block until completion. Defaults to True. *kwargs: keyword arguments
RETURNS | DESCRIPTION |
---|---|
DataFrame | None
|
pd.DataFrame|None: dataframe of data collected |
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
Start or stop data recording
PARAMETER | DESCRIPTION |
---|---|
on
|
whether to start recording data
TYPE:
|
saveData
Save data to file
PARAMETER | DESCRIPTION |
---|---|
filepath
|
path to save file
TYPE:
|
stream
Start or stop feedback loop
PARAMETER | DESCRIPTION |
---|---|
on
|
whether to start loop to continuously read from device
TYPE:
|
touch
touch(
force_threshold: float = 0.1,
displacement_threshold: float | None = None,
speed: float | None = None,
from_top: bool = True,
record: bool = False,
timeout: int = None,
) -> bool
Apply the target force
PARAMETER | DESCRIPTION |
---|---|
force_threshold
|
target force. Defaults to 0.1.
TYPE:
|
displacement_threshold
|
target displacement. Defaults to None.
TYPE:
|
speed
|
movement speed. Defaults to None.
TYPE:
|
from_top
|
whether compression direction is towards negative displacement. Defaults to True.
TYPE:
|
record
|
whether to record data. Defaults to False.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
whether movement is successful (i.e. force threshold is not reached)
TYPE:
|
waitThreshold
Wait for force sensor to reach the threshold
PARAMETER | DESCRIPTION |
---|---|
displacement
|
target displacement
TYPE:
|
timeout
|
timeout duration in seconds. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
actual displacement upon reaching threshold
TYPE:
|