Create an object to control a motor driver.
A connection to the motor driver will be attempted upon creation but this is asynchronous and is not available immediately after creation. If the connection fails reconnection will be attempted automatically.
the path to the (USB) serial port. eg /dev/ttyACM0
or COM1
.
Optional connection options. See Options
type for details.
The address of the Sabertooth.
Flag indicating if console.log debug messages are enabled.
The number of retry attempts for get requests.
Maximum motor output as proportion of battery input.
Motor current denoise exponential moving average factor.
The path for the USB serial port this SabertoothUSB is connected to.
The timeout for get requests, in ms.
Get the battery/source voltage.
Get the last error that occurred in the connection to the motor driver.
Get the output current for the specified motor channel, in Amps. This is a noisy signal and may vary by up to several amps. Positive current values indicate energy is being drawn from the battery, and negative values indicate energy is being regenerated into the battery.
Get the output rate for the specified motor channel, in range [-1, 1].
Get the output transistor temperature for the specified motor channel, in degrees centigrade.
Returns true iff the USB serial connection to the motor driver is open and working.
Sets the current limit for the specified motor output channel.
the motor channel(s), either 1
, 2
, or *
for all channels.
the new current limit on Amps, in range (0, 100], or -1 to use the default limit.
Controls the mixed-mode (differential) drive rate.
Note that the given rate is scaled by the maxMotorOutputRate
.
the new drive rate for the motors, in range [-1, 1] for maximum reverse to maximum forward respectively.
Enables or disables freewheeling for the specified motor output(s).
the motor channel(s), either 1
, 2
, or *
for all motors.
True to enable freewheeling, false to disable freewheeling.
Controls the specified motor output(s).
This sets the output of the motor channel as a fraction of the battery voltage.
Note that the given rate is scaled by the maxMotorOutputRate
.
the motor channel(s), either 1
, 2
, or *
for all motors.
the new rate for the motor(s), in range [-1, 1] for maximum reverse to maximum forward respectively.
Controls the specified power output, if the power output is configured as a controllable output.
the power channel(s), either 1
, 2
, or *
for all channels.
the new rate for the power output(s), in range [-1, 1]
Sets the ramping for the specified motor output channel.
the motor channel(s), either 1
, 2
, or *
for all channels.
The ramping value, between -16383 (fast) and 2047 (slow).
Controls the mixed-mode (differential) turn rate.
the new turn rate for the motors, in range [-1, 1] for maximum left to maximum right respectively.
Generated using TypeDoc
Controls USB-enabled Sabertooth motor drivers running in Packet Serial mode.
See https://www.dimensionengineering.com/datasheets/USBSabertoothPacketSerialReference.pdf
Note: Only Checksum protection is implemented, not CRC.