Options
All
  • Public
  • Public/Protected
  • All
Menu

sabertooth-usb

Index

Type aliases

Channel: 1 | 2 | "*"
Options: { address?: number; baudRate?: number; debug?: boolean; maxGetAttemptCount?: number; maxMotorOutputRate?: number; motorCurrentDenoiseAlpha?: number; timeout?: number }

Sabertooth USB connection options.

Type declaration

  • Optional address?: number

    The address of the Sabertooth. Default is 128.

  • Optional baudRate?: number

    Serial baud rate, options are 2400, 9600, 19200, 38400 and 115200. Default is 38400.

  • Optional debug?: boolean

    Flag to enable debug console.log messages. Default is false.

  • Optional maxGetAttemptCount?: number

    The number of times to attempt a get request. Default is 3.

  • Optional maxMotorOutputRate?: number

    Maximum motor output as proportion of battery input, in range [0, 1]. Default is 0.95 (95%). Set to 1 to disable maximum output rate compensation.

    The actual output motor voltage for a given input drive rate is non-linear above approximately a 95% drive rate; the output motor voltage is capped at approximately 95% of the battery voltage (see image below).

    When maxMotorOutputRate is set to a value < 1, a given drive rate is adjusted by scaling it with rate * maxMotorOutputRate. This provides for a linear relationship between the input drive rate and the actual motor output voltage.

    Plot of input drive rate vs output voltage

  • Optional motorCurrentDenoiseAlpha?: number

    Motor current denoise exponential moving average factor. Range is (0, 1]. Larger value means less de-noising. Set to 1 to disable denoising. Default is 0.1.

  • Optional timeout?: number

    The timeout for get requests, in ms. Default is 1000. 0 indicates timeout is disabled.

SingleChannel: 1 | 2

Functions

  • listSabertoothDevices(): Promise<PortInfo[]>
  • Get a list of the avilable Sabertooth devices. The return is an array of objects with fields like:

    manufacturer: 'Dimension Engineering',
    serialNumber: '1600DB368EC8',
    pnpId: 'usb-Dimension_Engineering_Sabertooth_2x32_1600DB368EC8-if01',
    locationId: undefined,
    vendorId: '268b',
    productId: '0201',
    path: '/dev/ttyACM0'

    Returns Promise<PortInfo[]>

Generated using TypeDoc