SPARK MAX Software Resources

All of the software resources for the SPARK MAX can be found below.

Table of Contents


SPARK MAX Client Application

Update, configure, and test your SPARK MAX Motor Controller with the SPARK MAX Client application.

Latest SPARK MAX Client - Version 1.0.0

The SPARK MAX Client will not work with SPARK MAX beta units distributed by REV to the SPARK MAX beta testers. It is only compatible with units received after 12/21/2018.

System Requirements

  • Windows 10 recommended
  • Internet connection for automatic updates

Installation Instructions

  1. Download the SPARK MAX Client installer above.
  2. Run the installer. Windows may require approval to install the application.
  3. Once installed, run the application. If prompted, be sure to grant network access. Without network access, the client software won't be able to download the latest SPARK MAX firmware and client updates.

    windowsfirewall.png

Drivers

The SPARK MAX uses two sets of drivers to operate: one for normal operation and one for updating firmware/recovering a bricked device. The device firmware update (DFU) drivers can be downloaded and installed separately here if you are having trouble updating your SPARK MAX firmware:

Troubleshooting

As we get feedback from users and identify exact causes for issues, please look back here for troubleshooting help. If you are running into issues running the SPARK MAX Client try the following BEFORE contacting support@revrobotics.com:

  • Try running the SPARK MAX Client as an Administrator
  • Make sure that Windows is fully up-to-date. Some computers have Windows Update disabled and need to be updated manually.
  • Check the Device Manager and verify that the SPARK MAX shows up as one of the following two devices with no caution symbols:
    • Normal operating mode: Device Manager -> Ports (COM & LPT) -> USB Serial Device (COMx)
    • Recovery mode: Device Manager -> Universal Serial Bus Controllers -> STM Device in DFU Mode
      • If the device shows up with errors or as STM32 BOOTLOADER, try installing the DFU drivers separately.

 


SPARK MAX Firmware Updates

It is recommended to keep your SPARK MAX up-to-date with the latest firmware. The SPARK MAX Client application will automatically download the latest firmware, but you can also download the firmware manually below:

Latest Firmware - Version

 

MD5:

This firmware will not work with SPARK MAX beta hardware units distributed by REV to the SPARK MAX Beta testers. It is only compatible with units received after 12/20/2018.

Latest Firmware Change Log - Version 1.1.33

  • Fixes issue that causes a Gate Driver Fault if the NEO is spinning at a certain speed during power up.
    • e.g. while still moving after a breaker trips for more than ~1.4s after breaker recovery.
  • Fixes issue where configuration data can be corrupted under a unique set of conditions, including loss of power while configuration settings are being saved to flash memory.
    • Issue symptoms: Controller cannot be controlled by a normal address and would report a firmware version of 0.0.0 in the Client, even after a successful firmware update. Updating a controller that is in this state to 1.1.33 will recover the controller.

Previous Firmware Change Log - Version 1.1.31

  • Adds new Smart Velocity mode - uses same constrains as the Smart Motion mode but outputs velocity instead of position. This is not a motion profiling mode, but rather provides acceleration limiting as opposed to simple ramp rates.
  • Improvements to heartbeat implementation.
  • CAN ID of 0 now considered 'unconfigured' and will not be enabled.
  • Changes the default output range for all PID slots to be [-1,1] instead of [0,0]
  • Changes setpoint commands to 'stick' instead of relying on periodic frames from the controller.
  • Follow mode can now persists through a power-cycle.
  • Periodic Status 2 (position data) frame rate default changed from 50ms to 20ms.
  • Watchdog changed to 220ms.
  • Proportional blink codes while driving now have a minimum blink rate (minimum is same as 10% applied output blink rate).
  • Fault flag 'over voltage' replaced with 'IWDT Reset'.
  • Velocity and Position conversion factors are now used for all internal PID calculations.

This firmware update requires an API update. Please see the API Information section for the latest updates. The table below outlines the compatibility between firmware versions and API versions:

  API
LabVIEW - 1.0.0-26
Java - 1.0.28
C++ - 1.0.27
LabVIEW - 1.1.8
Java - 1.1.8 (or newer)
C++ - 1.1.8 (or newer)
Firmware 1.1.26 (or newer) Not Compatible Compatible
1.0.385 (or older) Compatible Not Compatible

 

Previous Firmware Change Log - Version 1.1.26 (beta)

Previous Firmware Change Log - Version 1.0.385

  • Fixes PWM control issue introduced by version 1.0.384.

Previous Firmware Change Log - Version 1.0.384

  • Fixes GetPostition() randomly returning 0.
  • Fixes momentary velocity spike when accelerating from 0 speed.
  • Fixes issue related to rapid control mode switching by the user.
  • Fixes issue related to extreme low voltage CAN bus operation.
  • Adds conversion for motor temperature.
  • Improvement to "Has Reset" flag.
  • Improvements to brownout fault indicator.
  • Improvements to brownout behavior.

Firmware Update Instructions

Follow the steps below to update the firmware on your SPARK MAX:

  1. Connect your SPARK MAX Motor Controller to your computer with a USB C cable.
  2. Open the REV SPARK MAX Client application.
  3. If your SPARK MAX is running outdated firmware, you will be notified with a pop-up window like the one pictured below:

    Outdated Firmware Warning

  4. Click OK and then navigate to the Firmware tab. The client application should display the current firmware version on the screen:

    firmwaretab.png

  5. Click Load Firmware and select the latest firmware file in the firmware directory that the client created on startup. If there isn't a firmware directory, you can also navigate to a file that was downloaded manually. Click Open once the appropriate firmware file is selected:

    firmwarefileselection.png

  6. If this is the first time updating firmware on your SPARK MAX, there will be additional instructions to follow in the grey window before the firmware can be updated (pictured below). Otherwise, the firmware will download and verify automatically.

    recoveryupdate.png

  7. Once completed, the new firmware version number will be displayed under Current Firmware:

    firstfirmwareupdatecomplete.png

Factory Images

When updating the SPARK MAX Firmware we recommend using the SPARK MAX Client and the latest firmware file listed above. When updating normally, key configuration parameters, such as the CAN ID, will be preserved through an update, preventing the need to reconfigure every time you update. In some rare instances it may be beneficial to completely reinstall the factory firmware and reset all configuration parameters. Factory images can be found below:


Smart Motion Beta Release

Due to the number of new features planned for the next release of the SPARK MAX Software, the initial release will be a beta. Additional documentation on new modes is in progress and features are subject to change, however changes will be kept to a minimum. Major new features include:

REV Smart Motion

Trapezoidal Motion Profiling is now available on-board the SPARK MAX. This feature combines the built-in velocity PID controller with user-defined constraints to provide easy and smooth motion for mechanisms such as elevators and arms, all on-board the SPARK MAX.

Voltage Compensation

Add even more repeatability to your autonomous by using the built-in voltage compensation mode. With this mode, you can now set a maximum voltage and scale all of your outputs accordingly.

Built-in PID controller improvements

Set maximum integral values, filter noisy derivative terms, pre-load the sensor position, and more.

Check out the release notes below for a complete list of firmware changes and improvements. As always, you can track our development on our public Trello board.

Beta Release Software Links

Note: Upgrading to this firmware version will clear most parameters flashed into the controller, except CAN ID, Motor Type, Sensor Type, Idle Mode, and Input Deadband.

Release Notes

Firmware
  • Adds new Smart Motion mode utilizing trapezoidal motion profiling
  • Improvements to velocity decoding for low speeds and associated PID control loops requiring control at low speeds
  • Improvements to gate driver fault handling
  • Adds voltage compensation mode
  • Adds ability to set the stored sensor position
  • Adds ability to set the maximum PID integral accumulator value to prevent integral windup
  • Adds ability to set the PID I accumulator value
  • Adds filter function to PID derivative value
  • Adds closed-loop current control
  • Adds closed-loop ramp rate separate from open-loop
  • Adds ability to follow Phoenix 4.11 motor controllers
    • Note: This feature depends on the firmware of the Phoenix controllers, and is not controlled by REV. We will do our best to build this functionality, but this is not an officially supported feature.
  • Adds ability to set a unit conversion for both velocity and position units
  • Adds ability to reset to factory defaults
  • Improvements to smart current limits
  • Improvements to current data sent over CAN
  • Improvements to internal settings table implementation
  • Calling the constructor no longer resets the encoder count. This must be done manually by running CANEncoder.setPosition()
API
  • Version 1.1.5
    • Adds method to stop any REV periodic frames before enabling heartbeat
    • Improvements to heartbeat protocol
    • Moved all heartbeat implementation into its own dependency called by C++ and Java through JNI
    • Removed setControlFrameRate() call and removed repeating packets
      • Updates to control frames are now as fast/slow as the user calls Set() or SetReference()
    • Updates to doxygen/javadocs comments
    • Maven artifacts now include source for both Java and C++
  • Version 1.1.3
    • Improvements to setInverted()
    • New API calls for new firmware features
    • Better error message in Java when CAN is not connected
    • Documentation updates are in progress.

Special Thanks

We appreciate the assistance from the community for feedback, contributing, and testing these new features, especially Team 195 The CyberKnights.


API Information

Below you will find information on how to download and install the SPARK MAX APIs for LabVIEW, Java, and C++.

Current API version by Language
LabVIEW 1.1.9
Java 1.1.9
C++ 1.1.9

 

Latest API Change Log - Version 1.1.9 - LabVIEW

  • Fixes potential hang in Follow.vi in the case that an error is on the input terminal. Java/C++ unaffected.

Previous API Change Log - Version 1.1.9 - Java/C++ Only

  • Fixes loop overrun issues in Java/C++. LabVIEW unaffected.

Previous API Change Log - Version 1.1.8 - All Languages

  • Adds Smart Velocity Mode
  • Fixes inversion issues for IMaxAccum and Output Range
  • Updates heartbeat implementation
  • Adds default slotID for setDFilter() functions
  • Update heartbeat rate from 50ms to 25ms
  • Changes fault flag for Overvoltage to IWDTReset

This API update also requires a firmware update. Please see the SPARK MAX Firmware Updates section for the latest updates. The table below outlines the compatibility between firmware versions and API versions:

  API
LabVIEW - 1.0.26
Java - 1.0.28
C++ - 1.0.27
LabVIEW - 1.1.8 (or newer)
Java - 1.1.8 (or newer)
C++ - 1.1.8 (or newer)
Firmware 1.1.26 (or newer) Not Compatible Compatible
1.0.385 (or older) Compatible Not Compatible

Previous API Change Log - Version 1.1.5 (beta) - Java/C++ - Version 1.1.4 (beta) - LabVIEW

LabVIEW API

Latest LabVIEW API - Version 1.1.9

LabVIEW API Installation Instructions

  1. Download the latest API package from the download link above.
  2. Make sure LabVIEW for FRC 2019 is installed and updated.
  3. Open the REV SPARK MAX LabVIEW Package. The NI Package Manager should automatically open.
  4. Click Next:

    nipackagemanager.png

  5. Once the installation is complete, you will be able to access the REV SPARK MAX VIs in the LabVIEW Functions Pallet -> WPI Robotics Library -> Third Party -> REV Robotics -> SPARK MAX.

    sparkmaxpallet.png

Java API

Java API Installation Instructions

Online Installation

You can use the online method to install the REV Robotics Java API if your development machine is connected to the internet:

  1. Open your robot project in VSCode.
  2. Click on the WPI icon in the corner to open the WPI Command Pallet.
  3. Select Manage Vendor Libraries.
  4. Select Install new library (online).
  5. Enter the following installation URL and press ENTER:

    https://www.revrobotics.com/content/sw/max/sdk/REVRobotics.json

Offline Installation

Latest Java API - Version 1.1.9

  1. Download and unzip the latest SPARK MAX Java API into the C:\Users\Public\frc2019\ directory.
  2. Follow the Adding an offline-installed Library instructions from WPI.

Java API Documentation

For a list and description of all classes:

C++ API

C++ API Installation Instructions

Online Installation

You can use the online method to install the REV Robotics C++ API if your development machine is connected to the internet:

  1. Open your robot project in VSCode.
  2. Click on the WPI icon in the corner to open the WPI Command Pallet.
  3. Select Manage Vendor Libraries.
  4. Select Install new library (online).
  5. Enter the following installation URL and press ENTER:

    https://www.revrobotics.com/content/sw/max/sdk/REVRobotics.json

Offline Installation

Latest C++ API - Version 1.1.9

  1. Download and unzip the latest SPARK MAX C++ API into the C:\Users\Public\frc2019\ directory.
  2. Follow the Adding an offline-installed Library instructions from WPI.

C++ API Documentation

For a list and description of all classes:


SPARK MAX Code Examples

At the link below you will find code examples in LabVIEW, Java, and C++ for common SPARK MAX control modes. We will be adding examples as we develop them, so please check back regularly. Examples included as of 2/6/19:

  • LabVIEW
    • Arcade Drive with CAN
    • Arcade Drive with PWM
    • Get and Set Parameters
    • Limit Switch
    • Position Closed-loop Control
    • Reading Encoder Values
    • Smart Motion Example (new)
    • Velocity Closed-loop Control
  • Java
    • Get and Set Parameters
    • Limit Switch
    • Motor Follower
    • Position Closed-loop Control
    • Reading Encoder Values
    • Smart Motion Example (new)
    • Tank Drive with CAN
    • Velocity Closed-loop Control
  • C++
    • Arcade Drive with CAN
    • Arcade Drive with PWM
    • Get and Set Parameters
    • Limit Switch
    • Position Closed-loop Control
    • Reading Encoder Values
    • Smart Motion Example (new)
    • Velocity Closed-loop Control

Even though some examples may only exist in a particular language, they can be a good place to start as the APIs are very similar between languages.