Skip to content

Pulsar SDK

Commands and parameters

Pulsar SDK distinguishes real-time commands (sent during DRIVE_ACTIVE) from device parameters (configuration limits, gains, watchdog settings, and read-only metadata).

Primary commands

A standalone actuator accepts a scalar command whose unit depends on the configured mode (TORQUE: N·m, VELOCITY: rad/s, POSITION: rad, IMPEDANCE: rad):

actuator.set_command(0.5)
actuator.set_command(0.5)?;

Commands must be finite and are accepted only in DRIVE_ACTIVE.

Mode-specific command fields and feedforwards

To send feedforward torques, gains, or impedance fields alongside the primary setpoint, pass a mapping containing COMMAND (ControlParam::Command in Rust):

from pulsar_sdk import ControlParams

# Position mode with torque feedforward:
actuator.set_command({
    ControlParams.COMMAND: 0.5,
    ControlParams.TORQUE_FEEDFORWARD: 1.4,
})
use std::collections::BTreeMap;

use pulsar_rs_sdk::ControlParam;

// Position mode with torque feedforward:
actuator.set_control(&BTreeMap::from([
    (ControlParam::Command, 0.5),
    (ControlParam::TorqueFeedforward, 1.4),
]))?;

(In Rust, scalar commands use set_command(f64) and mapped commands use set_control(&ControlValues).)

Omitted optional fields (or NaN) leave the actuator's current firmware value unchanged.

Field (Python / Rust) Allowed modes
COMMAND / Command all modes (required)
D_AXIS_CURRENT_KP, D_AXIS_CURRENT_KI / DAxisCurrentKp, DAxisCurrentKi torque
Q_AXIS_CURRENT_KP, Q_AXIS_CURRENT_KI / QAxisCurrentKp, QAxisCurrentKi torque
FEEDFORWARD_GAIN / FeedforwardGain velocity, position, impedance
VELOCITY_KP, VELOCITY_KI / VelocityKp, VelocityKi velocity, position
TORQUE_FEEDFORWARD / TorqueFeedforward velocity, position, impedance
POSITION_KP / PositionKp position
IMPEDANCE_STIFFNESS, IMPEDANCE_DAMPING, IMPEDANCE_INERTIA impedance
IMPEDANCE_VELOCITY_COMMANDED, IMPEDANCE_ACCELERATION_COMMANDED impedance

Group and platform command batches

Selected command batches may include a subset of members; omitted actuators retain their previous command:

arm.set_commands({
    "shoulder": {ControlParams.COMMAND: 0.2, ControlParams.TORQUE_FEEDFORWARD: 0.8},
    "elbow": {ControlParams.COMMAND: -0.2},
})
use std::collections::BTreeMap;

use pulsar_rs_sdk::ControlParam;

arm.set_commands(&BTreeMap::from([
    (
        "shoulder".into(),
        BTreeMap::from([
            (ControlParam::Command, 0.2),
            (ControlParam::TorqueFeedforward, 0.8),
        ]),
    ),
    (
        "elbow".into(),
        BTreeMap::from([(ControlParam::Command, -0.2)]),
    ),
]))?;

Direct batch failures report CommandTransmissionError (Python) or SdkErrorKind::CommandTransmission (Rust) with successful_members identifying writes completed before the failure.

Parameters

Read and write device parameters with typed enums:

from pulsar_sdk import Parameters

values = actuator.read_parameters((
    Parameters.TORQUE_LIMIT,
    Parameters.POSITION_KP,
    Parameters.COMMAND_TIMEOUT_S,
    Parameters.CRITICAL_ERROR_FALLBACK,
))

actuator.set_parameters({
    Parameters.TORQUE_LIMIT: 5.0,
    Parameters.POSITION_KP: 2.0,
})
use std::collections::BTreeMap;

use pulsar_rs_sdk::{NumericValue, Parameter};

let values = actuator.read_parameters(&[
    Parameter::TorqueLimit,
    Parameter::PositionKp,
    Parameter::CommandTimeoutS,
    Parameter::CriticalErrorFallback,
])?;

actuator.set_parameters(&BTreeMap::from([
    (Parameter::TorqueLimit, NumericValue::Float(5.0)),
    (Parameter::PositionKp, NumericValue::Float(2.0)),
]))?;

Online limit updates during DRIVE_ACTIVE (3.1.0 / 1.1.0)

General parameters can only be written while drive output is inactive (INIT_CONFIG or CONFIG_AND_TELEM). Starting in 3.1.0 / 1.1.0, all 9 limit parameters can be written online during DRIVE_ACTIVE without disabling the actuator:

  • TORQUE_LIMIT / TorqueLimit
  • POSITION_LIMIT_MIN, POSITION_LIMIT_MAX / PositionLimitMin, PositionLimitMax
  • VELOCITY_LIMIT_MIN, VELOCITY_LIMIT_MAX / VelocityLimitMin, VelocityLimitMax
  • POSITION_PROFILE_VELOCITY_MIN, POSITION_PROFILE_VELOCITY_MAX
  • VELOCITY_PROFILE_ACCELERATION_MIN, VELOCITY_PROFILE_ACCELERATION_MAX

If a set_parameters mapping sent during DRIVE_ACTIVE contains any non-limit parameter, the entire call is rejected before transmission. Physical set_parameters calls accept at most 12 values per call so every write fits in a single firmware frame.

Unified group and platform parameter updates

Apply one parameter map across every actuator in a group or platform:

robot.set_parameters({Parameters.TORQUE_LIMIT: 5.0}, unify=True)
robot.set_parameters_unified(&BTreeMap::from([
    (Parameter::TorqueLimit, NumericValue::Float(5.0)),
]))?;

Use dedicated methods for MODE (set_mode), COMMAND (set_command/set_control), gain presets (set_torque_gain_preset/set_velocity_gain_preset), PCP_ADDRESS (set_address), TELEMETRY_RATE_HZ (configure), and flash persistence (save_parameters).

See the Python API reference and Rust API reference for the complete parameter list.