API Reference v9.1.0
ServoTunerclass
Module: zaber_motion.ascii
Exposes the capabilities to inspect and edit an axis' servo tuning.
Requires at least Firmware 6.25 or 7.00.
The following example illustrates how you can obtain an instance of this type:
from zaber_motion.ascii import Connection
from zaber_motion.ascii import ServoTuner
connection = Connection.open_serial_port('COM3')
device = connection.get_device(1)
axis = device.get_axis(1)
servo_tuner = ServoTuner(axis)Index
pProperties
Constructor
ServoTuner(axis)Creates instance of ServoTuner for the given axis.
Arguments
| Name | Type | Description |
|---|---|---|
| axis | Axis | The axis that will be tuned. |
Properties
p
Methods
m
servo_tuner.get_pid_tuning(paramset)Gets the PID representation of this paramset's servo tuning.
Arguments
| Name | Type | Description |
|---|---|---|
| paramset | ServoTuningParamset | The paramset to get tuning for. |
Return Value
PidTuning The PID representation of the current tuning.m
servo_tuner.get_simple_tuning(paramset)Get the simple tuning parameters for this device.
Arguments
| Name | Type | Description |
|---|---|---|
| paramset | ServoTuningParamset | The paramset to get tuning for. |
Return Value
SimpleTuning The simple tuning parameters.m
servo_tuner.get_simple_tuning_param_definitions()Gets the parameters that are required to tune this device.
Return Value
List[SimpleTuningParamDefinition] The tuning parameters.m
servo_tuner.get_startup_paramset()Get the paramset that this device uses by default when it starts up.
Return Value
ServoTuningParamset The paramset used when the device restarts.m
servo_tuner.get_tuning(paramset)Get the full set of tuning parameters used by the firmware driving this axis.
Arguments
| Name | Type | Description |
|---|---|---|
| paramset | ServoTuningParamset | The paramset to get tuning for. |
Return Value
ParamsetInfo The raw representation of the current tuning.m
servo_tuner.load_paramset(to_paramset, from_paramset)Load the values from one paramset into another.
Arguments
| Name | Type | Description |
|---|---|---|
| to_paramset | ServoTuningParamset | The paramset to load into. |
| from_paramset | ServoTuningParamset | The paramset to load from. |
m
servo_tuner.set_pid_tuning(paramset, p, i, d, fc)Sets the tuning of a paramset using the PID method.
Arguments
| Name | Type | Description |
|---|---|---|
| paramset | ServoTuningParamset | The paramset to get tuning for. |
| p | float | The proportional gain. Must be in units of N/m for linear devices, and N⋅m/° for rotary devices. |
| i | float | The integral gain. Must be in units of N/(m⋅s) for linear devices, and N⋅m/(°⋅s) for rotary devices. |
| d | float | The derivative gain. Must be in units of N⋅s/m for linear devices, and N⋅m⋅s/° for rotary devices. |
| fc | float | The cutoff frequency. Must be in units of Hz. |
Return Value
PidTuning The PID representation of the current tuning after your changes have been applied.m
servo_tuner.set_simple_tuning(paramset, tuning_params, load_inertia, load_inertia_units = Units.NATIVE, carriage_inertia = None, carriage_inertia_units = Units.NATIVE, motor_inertia = None, motor_inertia_units = Units.NATIVE, enable_feed_forward = True)Set the tuning of this device using the simple input method.
Arguments
| Name | Type | Description |
|---|---|---|
| paramset | ServoTuningParamset | The paramset to set tuning for. |
| tuning_params | List[ServoTuningParam] | The params used to tune this device. To get what parameters are expected, call GetSimpleTuningParamList. All values must be between 0 and 1. |
| load_inertia | float | The mass loaded on the stage, excluding the mass of the carriage itself. Unless specified by the LoadInertiaUnits parameter, this is in units of kg for linear devices, and kg⋅m² for rotary devices. |
| load_inertia_units | UnitsAndLiterals | The units the load mass was supplied in. |
| carriage_inertia | Optional[float] | The mass of the carriage itself. If not supplied, the product's default mass will be used. Unless specified by the CarriageInertiaUnits parameter, this is in units of kg for linear devices, and kg⋅m² for rotary devices. |
| carriage_inertia_units | UnitsAndLiterals | The units the carriage mass was supplied in. |
| motor_inertia | Optional[float] | The inertia of the motor. Unless specified by the MotorInertiaUnits parameter, this is in units of kg⋅m². |
| motor_inertia_units | UnitsAndLiterals | The units the motor inertia was supplied in. |
| enable_feed_forward | bool | Whether to enable the inertial feed-forward term. |
m
servo_tuner.set_startup_paramset(paramset)Set the paramset that this device uses by default when it starts up.
Arguments
| Name | Type | Description |
|---|---|---|
| paramset | ServoTuningParamset | The paramset to use at startup. |
m
servo_tuner.set_tuning(paramset, tuning_params, set_unspecified_to_default = False)Set individual tuning parameters. Only use this method if you have a strong understanding of Zaber specific tuning parameters.
Arguments
| Name | Type | Description |
|---|---|---|
| paramset | ServoTuningParamset | The paramset to set tuning of. |
| tuning_params | List[ServoTuningParam] | The params to set. |
| set_unspecified_to_default | bool | If true, any tuning parameters not included in TuningParams are reset to their default values. |