Control Interfaces

The SPARK Flex can be controlled by three different interfaces: servo-style PWM, Controller Area Network (CAN), and USB. The following sections describe the operation and protocols of these interfaces. For more details on the physical connections, see Control Connections.

PWM Interface

The SPARK Flex can accept a standard servo-style PWM signal as a control for the output duty cycle. Even though the PWM port is shared with the CAN port, SPARK Flex will automatically detect the incoming signal type and respond accordingly. For details on how to connect a PWM cable to the SPARK Flex, see CAN/PWM Connections.

The SPARK Flex responds to a factory default pulse range of 1000 µs to 2000 µs. These pulses correspond to full-reverse and full-forward rotation, respectively, with 1500 µs (±5% default input deadband) as the neutral position, i.e. no rotation. The input deadband is configurable with the REV Hardware Client or the CAN interface. The table below describes how the default pulse range maps to the output behavior.

If a valid signal isn't received within a 60 ms window, the SPARK Flex will disable the motor output and either brake or coast the motor depending on the configured Idle Mode. For details on the Idle Mode, see Idle Mode - Brake/Coast Mode.

CAN Interface

The SPARK Flex can be connected to a robot CAN network. CAN is a bi-directional communications bus that enables advanced features within the SPARK Flex.

SPARK Flex must be connected to a CAN network that has the appropriate termination resistors at both endpoints. Please see the FIRST Robotics Competition Robot Rules for the CAN bus wiring requirements.

Even though the CAN port is shared with the PWM port, SPARK Flex will automatically detect the incoming signal type and respond accordingly.

Each device on the CAN bus must be assigned a unique CAN ID number. Out of the box, SPARK Flex is assigned a device ID of 0. This ID is considered "unconfigured" and must be assigned to a unique number from 1 to 62. CAN IDs can be changed by connecting the SPARK Flex to a Windows computer and using the REV Hardware Client.

Additional information about the CAN accessible features and how to access them can be found in the SPARK Flex API Information section.

USB Interface

The SPARK Flex can be configured and controlled through a USB connection to a computer running the REV Hardware Client.

More information coming soon!

Last updated