Only this pageAll pages
Powered by GitBook
1 of 80

REV ION Brushless

Loading...

Loading...

Loading...

NEO Brushless Motors

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

SPARK Flex Motor Controller

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

SPARK MAX Motor Controller

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

REVLib

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Tips and Tricks

Loading...

Legacy Documentation

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Docking a SPARK Flex

When docked with a SPARK Flex the NEO Vortex's phase and sensor connections are kept securely together. This eliminates intermediate wiring that can fail if not secured properly.

Docking Materials

Docking the NEO Vortex with the SPARK Flex is simple and only requires the following materials and tools:

  • NEO Vortex Brushless Motor

  • SPARK Flex Motor Controller

  • Docking Hardware

    • 4 - M3 x 25 mm Socket Head Screws (included with SPARK Flex)

  • 2.5 mm Hex Key

Docking Procedure

Follow these steps to ensure a secure and proper docking:

  1. Ensure that power is disconnected from the SPARK Flex.

  2. Align the motor phase bullets between the NEO Vortex and SPARK Flex.

  3. Allowing the bullets to guide the two together, press the NEO Vortex and SPARK Flex together until their bodies meet. There may be a small gap between the motor and the controller opposite the bullets. This is normal.

  4. Insert the included docking screws into the counterbored Docking Screw Clearance Holes on the SPARK Flex.

  5. Using the 2.5 mm Hex Key, tighten the four screws evenly in a crisscross pattern until the screws are tight and secure. The screw heads should be sub-flush from the mounting face of she SPARK Flex. If you have a torque wrench, the ideal torque is 11.5 ±0.9 in-lb (1.3 ±0.1 Nm).

DO NOT run the motor without the docking screws installed. These screws ensure a robust and secure electrical connection, and doing so may cause damage to the system.

Undocking Procedure

Follow these steps to undock the NEO Vortex and SPARK Flex:

  1. Ensure that power is disconnected from the SPARK Flex.

  2. Completely remove the four docking screws from the assembly.

  3. Gently pull the NEO Vortex and SPARK Flex apart until the bullets release. Try to maintain their relative orientation to each other while pulling them apart.

NEO Vortex

NEO Vortex Overview

Features

  • High-resolution encoder

  • Integrated motor parameter and calibration memory

  • Through-hex bore with taper for numerous quick-change shafts

  • No motor wires - reliable and robust docking connections for motor phases and sensor

  • Dual sensor, direct contact winding temperature sensing

  • 560KV (RPM per volt)

  • 640 Watts (375 @ 40A)

  • #10-32 threaded holes on a 2in bolt circle

  • The motor and motor controller's silhouette fits behind a standard 2in rectangular tube

  • 1/2in hex through-bore rotor compatible with any length hex shaft or application-specific Vortex Shafts:

    • 8mm keyed

    • Falcon compatible spline

    • MAXSwerve with integrated key

    • 7-tooth 20DP gear

    • MAXPlanetary input

    • Others to be announced

NEO Vortex Anatomy

Motor Specifications

Parameter
Value and Units

Nominal Operating Voltage

12 V

Motor Kv

565 Kv

Free Speed

6784 RPM

Free Running Current

3.6 A

Stall Current

211 A

Stall Torque

3.6 Nm

Peak Output Power

640 W

Typical Output Power at 40 A

375 W

Pole Pairs

7

Encoder Resolution with SPARK MAX

42 Counts per rev.

Encoder Resolution with SPARK Flex †

7168 Counts per rev.

†

A firmware update will be required to access higher resolution encoder data.

Mechanical Specifications

Parameter
Value and Units

Docked Body Length †

79.7 mm

Docked Mounting Footprint - Narrow Side Width

2 in

Docked Mounting Footprint - Rounded Side Diameter

60 mm

Docked Spindle Offset Depth

19.7 mm

Docking Hardware ‡

M3 SHCS x 25 mm

Rotor Diameter

50 mm

Spindle Bore

1/2 in hex with 7.5° half-angle taper

Shaft Retention Counter Bore Diameter

17.75 mm

Shaft Retention Counter Bore Depth

4 mm

Weight

447 g (0.99 lbs)

†

When docked with SPARK Flex Motor Controller or NEO Vortex Solo Adapter.

‡

Docking hardware included with SPARK Flex or Vortex Solo Adapter.

NEO Vortex Motor Curve

The is a high-power, high-performance, and high-resolution sensored brushless motor from REV Robotics. It features a dockable controller interface that can be mounted directly to the or a allowing control from any brushless motor controller, like the SPARK MAX. Its through-bore rotor is the heart of its unique interchangeable shaft system, facilitating easy integration with various robot mechanisms.

All of our motor testing was performed on .

NEO Vortex Brushless Motor (REV-21-1652)
SPARK Flex Motor Controller (REV-11-2159)
NEO Vortex Solo Adapter (REV-11-2828)
our in-house dynamometer

Brushless DC Motor Basics

DC Motors consist of two major parts, the part that rotates, or the “rotor”, and the part that is stationary, or the “stator”. A DC motor uses these parts to convert electrical energy into rotational mechanical energy using electricity and permanent magnets. Two types of DC motors are used in FIRST Robotics Competition: Brushed DC Motors and Brushless DC motors. Both types are useful in various robot applications, and both have their trade-offs.

Brushless vs. Brushed Motor Basics

Operating a brushed DC motor is simple; provide DC electrical power and the motor spins. In a brushed motor, the rotor consists of electrical winding wires and the stator consists of permanent magnets. Since the electrical part is spinning, there needs to be a way to connect the external power wires to the spinning rotor. This is accomplished through conductive “brushes” that make contact with the stator, automatically sequencing the power to make the rotor spin. Brushes make it easy on us, but they produce extra friction which reduces the efficiency of the motor.

Brushless DC motors don’t have brushes. They still have both electrical winding wires and permanent magnets, but the locations are flipped. The stator now consists of the electrical parts, and the spinning rotor consists of the magnets. This means there is no more brush friction within the motor, making a brushless motor more power-efficient. However, you can’t just give it DC power and expect it to spin. Without the brushes doing the sequencing for us, you must use a specialized motor controller that is designed for brushless motors to properly sequence the power and get the rotor spinning.

The REV NEO Brushless Motor runs an 8mm keyed output shaft which allows for an easy transition from CIM-style brushed motors into brushless.

Swap a set of NEO Brushless Motors into your drivetrain or use one in an elevator to save weight and maintain peak performance. When paired with the SPARK MAX, you can use the integrated hall-effect sensors to calculate incremental position or speed from the NEO.

Key Terms

Stall Torque is measured when the motors RPM is zero and the motor is drawing its full Stall Current. This value is the maximum torque the motor is ever capable of outputting. Keep in mind the motor is not capable of outputting this torque for an indefinite period of time. Waste energy will be released into the motor as heat. When the motor is producing more waste heat than the motor body is capable of dissipating the motor will eventually overheat and fail.

Stall Current is the maximum amount of current the motor will draw. The stall current is measured at the point when the motor has torque that the RPM goes down to zero. This is also the point at which the most waste heat will be dissipated into the motor body.

Free Speed is the angular velocity that a motor will spin at when powered at the Operating Voltage with zero load on the motor’s output shaft. This RPM is the fastest angular velocity the motor will ever spin at. Once the motor is under load its angular velocity will decrease.

Operating Voltage is the expected voltage that the motor will experience during operation. If a robot is built using a 12 volt battery the Operating Voltage of the motor will be 12 volts. When controlling the RPM of the motor the DC speed controller will modulate the effective voltage seen by the motor. The lower the voltage seen by the motor the slower it will spin. DC motors have a maximum rated voltage if this voltage is exceeded the motor will fail prematurely.

The key metrics defined above are interrelated. Take some time to familiarize yourself with the definitions and how they connect together.

General Application Information

In order to ensure that an electric motor lasts as long as possible a few rules of thumb should be kept in mind:

  1. Smooth loading - large torque spikes or sudden changes in direction can cause excess wear and premature failure of gearbox components. This is only an issue when the torque spike exceeds the rated stall torque of the motor. When shock loading is necessary, it is best to utilize mechanical braking or a hard stop that absorbs the impact instead of the motor.

  2. Overheating - when a motor is loaded at near its maximum operating torque it will produce more waste heat than when operating at a lower operating torque. If this heat this allowed to build up the motor can wear out prematurely or fail spontaneously.

  3. Poorly supported output shaft, most motor output shafts are not designed to take large thrust forces or forces normal to the shaft. Bearings need to be used to support the axle when loads in these directions are expected.

REV ION Brushless

The Brushless Revolution

In the fall of 2018, the NEO Brushless Motor and SPARK MAX Motor Controller became the first brushless motor and compatible ESC (Electronic Speed Controller) designed to meet the unique demands of the FRC community. Since then, REV Robotics has been working to continue the Brushless Revolution by releasing products and software features based on our customer's most popular feedback.

The Next Generation of Motors and Controllers

NEO Vortex Brushless Motor

The NEO Vortex Brushless Motor is a high-power, high-performance, and high-resolution sensored brushless motor from REV Robotics. It features a dockable controller interface that can be mounted directly to a SPARK Flex Motor Controller or a NEO Vortex Solo Adapter allowing control from any brushless motor controller, like the SPARK MAX. Its through-bore rotor is the heart of its unique interchangeable shaft system, facilitating easy integration with various robot mechanisms.

SPARK Flex Motor Controller

The SPARK Flex Motor Controller is a new smart motor controller from REV Robotics. Its dockable form factor allows direct mounting onto a NEO Vortex to simplify wiring and maintain flexibility. Improving upon the foundation of the SPARK MAX, new features of the SPARK Flex Motor Controller include 3-phase current sensing, reverse polarity protection, and an expanded data port with additional interfaces. When docked to an adapter, the SPARK Flex can control any existing NEO or compatible brushless/brushed DC motor.

Incredible Power Density and Integrated USB Control

SPARK MAX Motor Controller

The SPARK MAX Motor Controller is your first step for getting advanced brushed and brushless DC motor control in a small, easy-to-use package. SPARK MAX is a true all-in-one controller that will push the envelope for FRC teams. Test prototypes and tune parameters without needing the full control system, only using a computer running the REV Hardware Client and a USB C Cable!

NEO V1.1 Brushless Motor

The NEO V1.1 Brushless Motor offers an incredible power density due to its compact size and reduced weight. As it is designed to have similar performance characteristics and matching mounting features, NEO V1.1 can be a drop-in replacement for CIM-style motors. This motor is perfect for your FRC Robot, Industrial platform or Warehouse robot, Electric skateboards, and more! The NEO V1.1 has been optimized to work with the SPARK MAX Motor Controller to deliver best-in-class performance and feedback.

NEO 550 Brushless Motor

The NEO 550 Brushless Motor is the smallest member of the NEO family of brushless motors. Its output power and small size are designed to make NEO 550 the perfect motor for intakes and other non-drivetrain robot mechanisms. Mounting holes and pilot match a standard 550 series motor, making it natively compatible with many existing off-the-shelf gearboxes.

If there is a question that is not answered by this space, send our support team an email; support@revrobotics.com. We are always happy to help point you in the right direction!

Vortex Shafts

NEO Vortex Shaft Features

Vortex shafts feature a 1/2 in hex section for transferring torque, and a locating taper section for effortless self-centering. When the shaft is secured with a #10-32 Shaft End Screw, the taper keeps your shaft perfectly centered as it's drawn in and locked into place within the NEO Vortex Spindle.

NEO Vortex Shaft Anatomy

NEO Vortex Shaft Options

Product Photo
Name, SKU, and Function

The NEO Vortex's 1/2in hex through-bore motor spindle is compatible with any length hex shaft.

The Vortex Shaft - 20 DP Gear - 7 T is addendum shifted to an 8 T pitch diameter. This allows you to calculate center-to-center distances as if it were an 8 T gear rather than a 7 T.

Vortex Shaft - MAXPlanetary Input Kit

Frequently Asked Questions

NEO Vortex

What are some best practices for using the NEO Vortex in a build?

NEO Vortex Tips and Tricks
  1. When seating your Vortex with a SPARK Flex or Solo Adapter make sure your have aligned the bullet connectors and data connectors. They should seat near completely with hand pressure then secured with screws. Do not over tighten.

  2. Do not over tighten the the shaft screw when using a Vortex Shaft.

  3. The Vortex is an outrunner, so make sure there are not wires or components that can touch the spinning rotor.

  4. If the Vortex is used in an application that you are not using a shaft screw, make sure cover the shaft opening on the top of the Vortex to prevent dust and debris from falling into the Vortex spindle.

What Smart Current Limit should I set for my NEO Vortex?

SPARK Flex

Are there any quick tips for getting the most from a SPARK Flex?

SPARK Flex Tips and Tricks
  1. Be sure to clean the SPARK Flex's surface with compressed air and remove any dirt or metal debris from the surrounding wire connections. If particulates find their way into the wire connectors you may experience intermittent connection issues.

  2. Maintain sufficient wire management to avoid critical wires from being strained and ripped out. Before your team puts the robot on the field, give all wires one last smart tug to ensure everything is secure for the match.

  3. Remember to update your SPARK Flex to the latest firmware when connecting your robot through the REV Hardware Client.

SPARK MAX

What is your best advice for using a SPARK MAX?

SPARK MAX Best Practices
  1. Ensure the firmware installed on your SPARK MAXs is the latest version! You can do this using the REV Hardware Client.

  2. Keep your wire management neat. Wires need to be protected and organized so they are can not be clipped by mechanisms or become an entanglement risk.

  3. Protect the SPARK MAX from debris and impacts. Use the included port covers or tape over the data port when not in use.

  4. Regularly inspect your SPARK MAX and its wires for a secure connection and damage.

How do I run an encoder with the SPARK MAX?

We have a documentation page that can help!

My SPARK MAX isn't working, where do I start?

Don't panic! Take a step back and assess the current situation.

What does the LED on my SPARK MAX indicate?

The Status LED indicates the operation mode or fault status of your SPARK MAX

Should I change the factory default setting for Smart Current Limit?

Your Smart Current Limit will depend on the motor being controlled and what it is driving.

Generally, the following ranges work well:

  • NEO V1.1: 40 A - 60 A

  • NEO 550: 20 A - 40 A

Can I run a NEO Vortex with a SPARK MAX?

Why don't the settings save on my SPARK MAX?

NEO V1.1

What are general best practices for the NEO V1.1?

REV's NEO V1.1 Tips and Tricks
  1. Use care when removing the sensor wire from a SPARK MAX. Firmly gripping all 6 of the wires as close to the JST connector as possible and pulling evenly generally gives best results. If needed you can also use a small tool to pry or grab the plastic notches of the JST Connector.

  2. Periodically check the NEO's phase and data wires for noticeable damage to the wire insulation or connectors. Exposed wire on your robot runs the risk of a possible short to your system.

  3. Keep the NEO clear from any debris, especially those that could get caught in the mechanism it is driving or affect your wiring.

  4. Route all wires with proper strain relief to avoid damage or unintentional disconnects from tension.

What Smart Current Limit should I set for my NEO V1.1?

Generally we recommend 40A - 60A

Say for example you have four NEO v1.1s assigned as the main drive motors on MAXSwerve Modules for your robot, and the Smart Current Limit is set to 60A. If your robot is pushing against an object causing the NEO v1.1s to experience stalling, potential motor failure would occur at approximately 105 seconds due to the build up of thermal energy. Realistically, setting the Smart Current Limit to 20A and gradually increasing the amperage enough to break traction with the ground is adequate.

Another example would be if you have one NEO v1.1, and your team has decided to set the Smart Current Limit past the recommended 60A for an arm mechanism. While the the motor is capable of preforming past 60A, if your arm mechanism is stuck on some game structure the window of motor failure is shorter than 105 seconds.

How do I make a NEO V1.1 compatible with the new SPARK FLEX Motor Controllers?

We have a solution coming soon! The SPARK Flex Dock will...

The SPARK Flex Dock will allow a SPARK Flex to control any existing NEO or compatible brushless/brushed DC motor by converting it to a standalone motor controller!

Can I run a NEO V1.1 on 24V?

This is possible but we strongly recommend...

Before running a NEO V1.1 at a 24V, we recommend first confirming that the motor controller that will drive it can also work at 24V as well.

When a NEO is run at higher voltages, its specifications will also scale. All of the data listed on the product page and motor testing was run at 12V, so, when running a NEO at 24V you would need to double the values.

For example:

  • Free Speed @ 12V - 5676 RPM

  • Free Speed @ 24V - 11352 RPM

NEO 550 FAQ

What are general best practices for the NEO 550?

REV's NEO 550 Tips and Tricks
  1. Use care when removing the sensor wire from a SPARK MAX. Firmly gripping all 6 of the wires as close to the JST connector as possible and pulling evenly generally gives best results. If needed you can also use a small tool to pry or grab the plastic notches of the JST Connector.

  2. Periodically check the NEO 550's phase and data wires for noticeable damage to the wire insulation or connectors. Exposed wire on your robot runs the risk of a possible short to your system.

  3. Keep the NEO 550 clear from any debris, especially those that could get caught in the mechanism it is driving or affect your wiring.

  4. Route all wires with proper strain relief to avoid damage or unintentional disconnects from tension.

What Smart Current Limit should I set for my NEO 550?

Generally we recommend 20A - 40A

Say for example you have four NEO 550s assigned as the steering motors on MAXSwerve Modules for your robot, and the Smart Current Limit is set to 40A. If field debris impedes your robot is from completing its turn causing the NEO 550 to experience stalling, potential motor failure would occur at approximately 27 seconds due to the build up of thermal energy. However, setting the Smart Current Limit to 20A increases this window to 220 seconds, which should withstand most stall encounters.

Quick Links

SPARK Motor Controllers

NEO Brushless Motors

NEO V1.1 Links

NEO V1.1

NEO V1

NEO 550 Links

1/2 in Hex Shaft - Any Length ()

Vortex Shaft - 8 mm () The 8mm Vortex Shaft, compatible with the , empowers you to utilize the NEO Vortex Brushless Motor with any 8mm keyed shaft component. This interchangeability also means that the NEO Vortex matches the output of a , making it a seamless drop-in replacement for your designs.

Vortex Shaft - MAXSwerve Integrated Key () The Vortex Shaft - MAXSwerve Integrated Key gives users the ability to drive a MAXSwerve Module without the need for the MAXSwerve Key. This eliminates a potential point of failure in the MAXSwerve since the key is machined directly into the 8mm shaft.

Vortex Shaft - 20 DP Gear - 7 T () The Vortex Shaft - 20 DP Gear - 7 T offers users the unique ability to achieve substantial gear reductions directly from the motor. This gear features a 7 T 20 DP design that is typically too small for an 8mm keyed input. However, it becomes possible when integrated into the motor shaft.

() Working seamlessly with the MAXPlanetary Vortex Input Stage, the Vortex Shaft - MAXPlanetary Input Coupler reduces gearbox length for more efficient designs. Note that the MAXPlanetary Vortex Input Stage is required for this setup.

Vortex Shaft - Falcon Compatible Spline () The Vortex Shaft - Falcon Compatible Spline gives users the ability to drive components that have a falcon spline bore.

The default Smart Current Limit is 80A, which is acceptable for most applications when driven by a SPARK Flex however...

We recommend utilizing our and to help calculate what the best current to torque ratio for your application will be.

Ensure you've set a proper for your motor and what it will be driving.

Check out !

A good place to start isolating the root issue would be to go through our documentation.

See our reference table on the to find the LED behavior that matches your SPARK MAX. Both color and speed of the blinking pattern are important to note!

A new SPARK MAX's Smart Current Limit default setting is 80A, but may need to be less. We recommend utilizing our locked-rotor testing data or the table below to decide what to set your Smart Current Limit to for your robot: and.

You will need to purchase one of our
Be sure to always click Persist Perimeters (formerly: Burn Flash) to through the REV Hardware Client!

A SPARK MAX's parameters can also be overwritten within your code, so ensure you also burn flash after any changes in your program too. Any settings that had been modified and not persisted will reset when the SPARK MAX is power cycled.

MAXPlanetary Gearbox Cartridges are pre-lubricated and sealed. If during maintenance you find that a cartridge needs more grease, we recommend using a Molybdenum Grease to apply more lubrication such as or.

But this setting will be dependent on the application you've assigned to the NEO v1.1. Is the motor acting as the main drive motor on a MAXSwerve Module? Or is it actuating the elbow on your arm mechanism? Please briefly reference our .

UltraPlanetary Gearbox Cartridges are pre-lubricated and sealed. If during maintenance you find that a cartridge needs more grease, we recommend using a Molybdenum Grease to apply more lubrication such as or .

When pressing a pinion on your NEO 550 shaft, taken care to not over press the pinion or dislodge the motor's shaft. Take a look at our for assistance.

But this setting will be dependent on the application you've assigned to the NEO 550. Is the motor being used as a steering motor on a swerve drive? Or is the motor being utilized to articulate a part of your intake? Please briefly reference our

SPARK Flex Links

General Resources

Software Resources

SPARK MAX Links

General Resources

Software Resources

Motor Comparison and Testing

NEO Vortex Links

Check out our documentation on the and the for more information.

Smart Current Limit
Using Encoders with the SPARK MAX
Troubleshooting - SPARK MAX
SPARK MAX Status LED Patterns
Locked-Rotor Testing for the NEO (REV-21-1650)
NEO 550 (REV-21-1651)
NEO Vortex Solo Adapters (REV-11_2828)
NEO Vortex Solo Adapter
SPARK MAX
save the settings
Synthetic NLGI #2 Molybdenum Grease
MOLYKOTE® G-2008 Synthetic Tool Gear Grease
NEO Motor Locked Rotor Testing
Stay tuned to our website for updates on its release!
Synthetic NLGI #2 Molybdenum Grease
MOLYKOTE® G-2008 Synthetic Tool Gear Grease
NEO 550 Motor Locked Rotor Testing
motor curves
specifications

Installing a Shaft

Shaft Installation Materials

Installing a Vortex Shaft is simple and requires the following materials and tools:

  • NEO Vortex (docked or undocked)

  • Desired Vortex Shaft

  • #10-32 Shaft End Screw

  • 5/32 in Hex Key

Shaft Installation Procedure

Follow these steps to ensure a secure shaft installation:

  1. Insert the shank of the desired shaft into the Vortex Spindle from the front mounting face of the motor.

  2. While inserting, you may need to rotate the shaft or rotor slightly to align the hexagonal portion of the shank with the hexagonal bore of the spindle.

  3. Once the shaft is fully inserted, install the Shaft End Screw through the back side of the spindle and thread into the shank.

  4. Tighten the Shaft End Screw with the 5/32 in hex key to draw the taper into a locked and centered position. If you have a torque wrench, the ideal torque is 25 ±5 in-lb (2.8 ±0.6 Nm).

Visually check for concentricity by rotating the motor rotor. If the shaft is not concentric, remove it, rotate its orientation, and reseat in the spindle.

Shaft Removal Procedure

  1. Remove the Shaft End Screw with the 5/32 in hex key.

  2. Remove the Vortex Shaft from the motor.

While the Vortex Shaft taper is designed to self release, it may still need a gentle tap to help it along. Be sure to tap the shaft itself and not the rotor. You can partially back out the Shaft End Screw and tap it to push the shaft out.

Multiple SKU
REV-21-2807
REV ION System
NEO Brushless Motor V1.1
REV-21-2848
REV-21-6800
REV-21-2130
REV-21-2827
NEO V1.1 Overview
Pinion Pressing Guide
NEO V1 Overview
NEO 550 Overview
Pinion Pressing Guide
NEO Vortex Overview
Docking a SPARK Flex
Installing a shaft
NEO Vortex Specifications
Motor Curves - NEO Vortex
NEO V1 Specifications
Motor Curves - NEO V1
Pinion Pressing Guide
NEO V1.1 Specifications
Motor Curves - NEO V1.1

NEO V1

NEO V1 Overview

The REV NEO Brushless Motor (REV-21-1650) is the first brushless motor designed to meet the unique demands of the FRC community. Offering an incredible power to weight ratio along with it's compact size it's designed to be a drop-in replacement for CIM-style motors as well as an easy install with mounting options.

Features

  • Drop-in replacement for CIM-style motors

  • Shielded out-runner construction

  • Front and rear ball bearings

  • High-temperature neodymium magnets

  • High-flex silicone motor wires

  • Integrated motor sensor

    • 3-phase hall sensors

    • Motor temperature sensor

Wiring Connections

CAUTION: Improperly wiring the connectors can cause severe motor damage and is not covered by the warranty. DO NOT connect the motor directly to the battery.

Motor Specifications

Parameter
Value and Units

Nominal Operating Voltage

12 V

Motor Kv

473 Kv

Free Speed`

5676 RPM

Free Running Current

1.8 A

Stall Current

105 A

Stall Torque

2.6 Nm

Peak Output Power

406 W

Typical Output Power at 40 A

380 W

Hall-Sensor Encoder Resolution

42 counts per rev.

Mechanical Specifications

Parameter
Value and Units

Output Shaft Diameter

8mm (keyed)

Output Shaft Length

35mm (1.38in)

Output Pilot

19.05mm (0.75in)

Body Length

58.25mm (2.3in)

Body Diameter

60mm (2.36in)

Weight

0.938 lbs (0.425 kg)

NEO V1 Motor Curve

The only difference between the NEO V1 and NEO V1.1 are external changes to the motor's housing.

All of our motor testing was performed on our in-house dynamometer.

Pinion Pressing Guides

NEO V1.1 Pinion Pressing Guide

Needed Materials

  • NEO V1.1 (REV-21-1650)

  • 1 - 10-32 x 3/8in long Socket Head Screw

  • Press Fit Pinion

  • Arbor Press

Steps

1) Take a 10-32 x 3/8in long socket head screw and screw it into the back of the motor finger tight.

DO NOT USE AN ALLEN WRENCH OR POWER TOOL The screw is intended to support the end of the NEO's shaft while pressing on the pinion. Tightening the support screw with an Allen wrench or power tool may damage the motor and/or shaft.

2) Using a flat arbor press plate, balance the motor with that screw down on the arbor press

3) Proceed with pressing the pinion as usual. When complete, ensure that you remove the 10-32 socket head screw from the back of the NEO.

Do not attempt to run the NEO while a screw is still attached to the back of the motor. Not removing the screw will damage the motor and/or shaft.

NEO V1.0 Pinion Pressing Guide

Needed Materials

  • NEO V1.0 (REV-21-1650)

  • A high-quality 1.5mm Allen Key (i.e. WERA Tools, Bondhus)

  • Loctite 242

  • Arbor Press

Steps

1) Locate the first of three screws holding the back can to the front plate of the motor.

2) Using a high-quality 1.5mm Allen Key, remove the bolt and set aside. Repeat this for the other two bolts around the back can. Make sure the Allen Key is fully seated in the bolt head during removal.

3) Remove the back can. Set it and the three bolts aside for reassembly after pressing on the pinion.

4) Place the NEO upright in the arbor press. Make sure to hold the bottom of the motor flat against the press plate, supporting the bottom of the shaft.

5) Press on pinion. After pinion is pressed on reattach the back can. We recommend using Loctite 242 to complete the reassembly.

NEO Vortex Solo Adapter

The NEO Vortex Solo Adapter (REV-11-2828), allows teams to seamlessly integrate the NEO Vortex Brushless Motor with a SPARK MAX. This adapter breaks out the motor sensor connector and phase wire connections for simple backward compatibility.

While the NEO Vortex Solo Adapter allows you to use the motor independently, it may not fully support certain advanced functionalities of the NEO Vortex Brushless Motor.

Specifications

Parameter
Value and Units

Phase Wire Gauge

12 AWG

Encoder Port Connector

JST PH 6-pin

Through Bore Diameter

16.5 mm (0.649 in)

Mounting Footprint Narrow Side Width

2 in

Mounting Footprint Rounded Side Diameter

60 mm

Mounting Holes

#10-32 on 2 in bolt circle

Mounting Hole Maximum Depth

0.25 in

Body Length (Not Docked)

28.2 mm

Docking Hardware

M3 SHCS x 25 mm

Kit Contents

The following items are included with each NEO Vortex Solo Adapter

SKU
Product Name
QTY

REV-21-2828

NEO Vortex Solo Adapter

1

REV-21-3204-PK4

M3 x 25mm Socket Head Screw - 4 Pack

1 Pack, 4 Screws

6-Pin JST Cable

1

Docking a NEO Vortex Solo Adapter

When docked with a NEO Vortex Solo Adapter a NEO Vortex can be controlled with a SPARK MAX.

Docking Materials

Docking the NEO Vortex with the SPARK Flex is simple and only requires the following materials and tools:

  • NEO Vortex Brushless Motor

  • NEO Vortex Solo Adapter

  • Docking Hardware

    • 4 - M3 x 25 mm Socket Head Screws (included with SPARK Flex)

  • 2.5 mm Hex Key

Docking Procedure

Follow these steps to ensure a secure and proper docking:

  1. Ensure that power is disconnected from the NEO Vortex Solo Adapter.

  2. Align the motor phase bullets between the NEO Vortex and NEO Vortex Solo Adapter.

  3. Allowing the bullets to guide the two together, press the NEO Vortex and NEO Vortex Solo Adapter together until their bodies meet. There may be a small gap between the motor and the controller opposite the bullets. This is normal.

  4. Insert the included docking screws into the counterbored Docking Screw Clearance Holes on the NEO Vortex Solo Adapter.

  5. Using the 2.5 mm Hex Key, tighten the four screws evenly in a crisscross pattern until the screws are tight and secure. The screw heads should be sub-flush from the mounting face of she NEO Vortex Solo Adapter. If you have a torque wrench, the ideal torque is 11.5 ±0.9 in-lb (1.3 ±0.1 Nm).

DO NOT run the motor without the docking screws installed. These screws ensure a robust and secure electrical connection, and doing so may cause damage to the system.

Undocking Procedure

Follow these steps to undock the NEO Vortex and NEO Vortex Solo Adapter:

  1. Ensure that power is disconnected from the NEO Vortex Solo Adapter.

  2. Completely remove the four docking screws from the assembly.

  3. Gently pull the NEO Vortex and NEO Vortex Solo Adapter apart until the bullets release. Try to maintain their relative orientation to each other while pulling them apart.

NEO V1.1

NEO V1.1 Overview

Features

  • Drop-in replacement for CIM-style motors

  • Shielded out-runner construction

  • Front and rear ball bearings

  • High-temperature neodymium magnets

  • High-flex silicone motor wires

  • Integrated motor sensor

    • 3-phase hall sensors

    • Motor temperature sensor

New to NEO V1.1

  • A tapped #10-32 hole on the end of the shaft, allowing teams to retain pinions on the shaft without using external retaining rings

  • A tapped #10-32 hole on the back housing of the motor, making it no longer necessary to remove the motor housing to press pinions

  • Additional holes on the front face of the motor for added mounting flexibility

Wiring Connections

CAUTION: Improperly wiring the connectors can cause severe motor damage and is not covered by the warranty. DO NOT connect the motor directly to the battery.

Motor Specifications

Parameter
Value and Units

Nominal Operating Voltage

12 V

Motor Kv

473 Kv

Free Speed`

5676 RPM

Free Running Current

1.8 A

Stall Current

105 A

Stall Torque

2.6 Nm

Peak Output Power

406 W

Typical Output Power at 40 A

380 W

Hall-Sensor Encoder Resolution

42 counts per rev.

Mechanical Specifications

Parameter
Value and Units

Output Shaft Diameter

8mm (keyed)

Output Shaft Length

35mm (1.38in)

Output Pilot

19.05mm (0.75in)

Body Length

58.25mm (2.3in)

Body Diameter

60mm (2.36in)

Weight

0.938 lbs (0.425 kg)

Phase Wire Length

5.91in (150mm)

Phase Wire Gauge

12AWG

Sensor Cable Length

11.81in (300mm)

Sensor Cable Gauge

24AWG

NEO V1.1 Motor Curve

Getting Started with the SPARK Flex
Troubleshooting
Status LED Patterns
SPARK Flex Specifications
Getting Started with the REV Hardware Client
REVLib API and Installation
Getting Started with the SPARK MAX
Troubleshooting
Status LED Patterns
SPARK MAX Specifications
SPARK MAX Data Port Pinout
Using Encoders with the SPARK MAX
REVLib API and Installation
MAXSwerve Calibration
SPARK MAX Code Examples
Motor Comparison
Dynamometer Testing

Connecting the NEO V1.1 Brushless motor is fairly straightforward. Follow the guide at, and don't forget to connect your sensor wire; the motor will not spin without it!

Check out the for additional information! Please read the and ensure you understand how to set an appropriate before using your NEO Brushless Motor.

​​

​​

​​

​​

​​

The REV is the initial update on the first brushless motor designed to meet the unique demands of the FIRST Robotics Competition community. NEO V1.1 offers an incredible power density due to its compact size and reduced weight, and it's designed to be a drop-in replacement for CIM-style motors, as well as an easy install with many mounting options. The built-in hall-effect encoder guarantees low-speed torque performance while enabling smart control without additional hardware. NEO V1.1 has been optimized to work with the to deliver incredible performance and feedback.

Connecting the NEO V1.1 Brushless motor is fairly straightforward. Follow the guide at, and don't forget to connect your sensor wire; the motor will not spin without it!

All of our motor testing was performed on .

Check out the for additional information! Please read the and ensure you understand how to set an appropriate before using your NEO Brushless Motor.

Wiring the Spark Max
NEO Brushless Motor V1.1 (REV-21-1650)
SPARK MAX Motor Controller (REV-21-2158)
Wiring the Spark Max
our in-house dynamometer

SPARK Flex Dock

SPARK Flex Dock Overview

When connected to a SPARK Flex Dock (REV-11-2858) the SPARK Flex can control any existing NEO or compatible brushless/brushed DC motor.

SPARK Flex Dock Features & Specifications

Coming soon!

NEO 550 Specifications
Motor Curves - NEO 550
Pinion Pressing guide
NEO Vortex Comparisons
NEO V1.1 Comparisons

NEO 550

NEO 550 Overview

The REV NEO 550 Brushless Motor runs a 0.12in output shaft which, when combined with its 550-style mounting features, allows for easy installation in many off-the-shelf gearboxes.

Its small size and weight make it easy to put power where you need it, whether that is on intakes, end-effectors, or other weight-sensitive mechanisms. However, keep in mind that this motor has a lower thermal mass than a NEO, CIM, or Mini CIM, and thus it may not be ideal for some drivetrain applications.

Wiring Connections

CAUTION: Improperly wiring the connectors can cause severe motor damage and is not covered by the warranty. DO NOT connect the motor directly to the battery.

Features

  • Mounting features match other 550 series DC motors

  • Front and rear ball bearings

  • High-temperature neodymium magnets

  • High-flex silicone motor wires

  • Integrated motor sensor (3-phase hall sensors)

  • Motor temperature sensor

Motor Specifications

Parameter
Value and Units

Nominal Operating Voltage

12 V

Motor Kv

917 Kv

Free Speed`

11000 RPM

Free Running Current

1.4 A

Stall Current

100 A

Stall Torque

0.97 Nm

Peak Output Power

279 W

Hall-Sensor Encoder Resolution

42 counts per rev.

Mechanical Specifications

Parameter
Value and Units

Output Shaft Diameter

0.125in (3.175mm)

Output Shaft Length

0.267in (7mm)

Output Pilot

0.512in (13mm)

Body Length

1.752in (44.5mm)

Body Diameter

1.378in (35mm)

Weight

0.142 kgs (0.313 lbs)

Phase Wire Length

5.91in (150mm)

Phase Wire Gauge

14AWG

Sensor Cable Length

11.81in (300mm)

Sensor Cable Gauge

24AWG

NEO 550 Motor Curve

Updated testing from our in-house dynamometer coming soon!

Dynamometer Testing

Dynamometer Characterization

The data for Motor Curves provided in our documentation is generated with an inertia-type dynamometer, or dyno, and then further analyzed by our engineers.

Parts of a Dynamometer

The dynamometer REV Robotics uses consists of the following major components mounted directly to the main shaft:

  • Flywheel - A weighted flywheel supported by ball bearings

  • Encoder - An encoder that collects data during the test

  • Motor Mount - An adjustable system where the motor is equipped with a coupling so its output lines up with the rotational axis of the dynamometer

  • Motor and ESC - The motor and ESC (Electronic Speed Controller or Motor Controller) are always tested as a unit. Some examples of this are the SPARK MAX and NEO or the Falcon 500 Motor and Talon FX ESC

  • Power Supply - A high current power supply system capable of supplying 12V at 200A with minimal voltage sag while handling voltage spikes and braking conditions.

Testing Process

A test starts at rest and consists of applying a constant throttle setting to the motor and motor controller. Generally, this value is 100%, but any value can be used. The motor is allowed to accelerate the flywheel while data is recorded with timestamps.

The data recorded during testing includes:

  • The speed and position of the flywheel encoder

  • The DC current at the input of the ESC

  • The bus voltage at the input of the ESC

  • Any data provided by the ESC, this may vary from controller to controller

    • This is generally collected over CAN

Data Analysis

Using the speed and position data, the acceleration of the flywheel can be calculated throughout the timespan of the test. The moment of inertia of the rotating portion of the dyno is known to a high degree of precision. This includes the flywheel, shaft, hub, motor rotor, couplings, etc. Using the acceleration and moment of inertia, the torque produced by the motor can be calculated.

Calibration

At thousands of RPM, the flywheel and shaft system can generate enough drag to affect the results of the test significantly. To determine the drag in the system from air movement and viscous friction, the dyno is spun up to a very high speed and allowed to freely rotate until it comes to a stop. During this process, speed and position data are recorded and then used to calculate the drag torque. The drag torque is added to the motor torque calculated from each acceleration measurement during a motor test so that our results are calibrated for our specific dyno setup.

Current Limiting

At low speeds, a motor will typically draw more current than the set current limit on its ESC. Current limiting may affect the duty cycle and commutating of the motor, causing the data to deviate from “raw” motor performance. Current limiting processes within an ESC's software can also cause excess noise in current, voltage, and acceleration data collected by the dyno. For these reasons, the low-speed section where current limiting is in effect is usually removed from the data set before characterizing the motor.

Data Characterization

Characterization is accomplished by correlating torque and current with velocity. These relationships are usually extremely linear and a best fit can be used to approximate and extrapolate the motor’s performance outside of the test region. Additional processing can be applied to compensate for voltage drop in the power supply lines at high currents.

REV's in-house Dynamometer

REV Robotics has designed a dynamometer that we are working to make open source and available to the public. In creating this dynamometer, we have focused on using as many off-the-shelf components as possible in an effort to make this design easy for members of the community to build.

Below are some photos of our progress!

Pinion Pressing Guide

NEO 550 Pinion Pressing Guide

Needed Materials:

  • Press Fit Pinion

  • Arbor Press

Steps

1) Place the NEO 550 upright in the arbor press. Make sure to hold the bottom of the motor flat against the press plate, supporting the bottom of the shaft.

2) Place the pinion on the shaft and press. Take care to not over-press on the NEO 550 shaft!

Motor Comparison

This page is intended to highlight the relative comparison between REV ION motors and similar motors from other vendors.

NEO Vortex - Quick Comparison

NEO V1.1 - Quick Comparison

The data shown for NEO V1.1 is also valid for the NEO V1

NEO V1.1 & Kraken X60 Motor Curves

NEO V1.1 & Kraken X60

Parameter
NEO V1.1
Kraken X60
Units

KV

485

523

rpm/V

Free Load Speed

5820

6271

rev/min

Free Load Current

2.065

2.32

A

Stall Current

160

233

A

Stall Torque

3

4.21

Nm

Nominal Voltage

12

12

V

Peak Efficiency

76.54

82

%

Peak Power

456

691

W

Power @ 40 Amps

333

387

W

NEO V1.1 & Falcon 500 V2 Motor Curves

NEO V1.1 & Falcon 500 V2 Data

Parameter
NEO V1.1
Falcon 500 V2
Units

KV

485

541

rpm/V

Free Load Speed

5820

6489

rev/min

Free Load Current

2.065

2.39

A

Stall Current

160

191

A

Stall Torque

3

3.46

Nm

Nominal Voltage

12

12

V

Peak Efficiency

76.54

83.06

%

Peak Power

456

588

W

Power @ 40 Amps

333

376

W

NEO Vortex & NEO V1.1 Motor Curves

NEO Vortex & NEO V1.1 Data

Parameter
NEO V1.1
NEO Vortex
Units

KV

485

565

rpm/V

Free Load Speed

5820

6784

rev/min

Free Load Current

2.065

3.62

A

Stall Current

160

211

A

Stall Torque

3

3.6

Nm

Nominal Voltage

12

12

V

Peak Efficiency

76.54

77

%

Peak Power

456

640

W

Power @ 40 Amps

333

361

W

Interpreting this Data

Values of motor data may vary from manufacturer to manufacturer because of variances in the dynamometer used to test each motor and how that data is analyzed. With each motor shown on this page, REV Robotics performed the same dynamometer testing and analysis of the data collected.

Absolute vs. Relative Data

  • Absolute Values for a specification are determined independently of each similar motor made by other manufacturers. Each of the specifications are determined by a manufacturer's individual testing procedures and methods of analyzing test data.

  • Relative Values for a specification are found by running the same test and analysis on a motor. While the values provided may not match a motor's listed Absolute Values for a given specification, this kind of data helps us compare the motors as fairly as possible.

Motor Curves

NEO Vortex - REV Robotics

NEO V1.1 - REV Robotics

Kraken X60 - WestCoast Products

Falcon 500 V2 - VEX Robotics

SPARK Flex Overview

Feature Highlights:

  • Docking interface for motor phases and sensors

  • USB type C configuration and control

  • PWM and CAN communication

  • Fully integrated power and control wires

  • Enhanced data port with more power, latching connector, and additional serial interfaces

  • Advanced motor control modes include:

    • Velocity

    • Position

    • Current

    • New modes with future firmware updates

  • #10-32 threaded holes on a 2in bolt circle

  • Motor and motor controller's silhouette fits behind a standard 2in rectangular tube

SPARK Flex Resources

General Resources

Software Resources

NEO Motor Data Sheet
NEO Motor Locked Rotor Testing
NEO Motor Data Sheet
NEO Motor Locked Rotor Testing

The REV is the newest member of the NEO family of brushless motors. Its output power and small size are specifically designed to make NEO 550 the perfect motor for intakes and other non-drivetrain robot mechanisms. Mounting holes and pilot match a standard 550 series motor, allowing it to natively mount to many existing off-the-shelf gearboxes.

Connecting the NEO 550 Brushless motors is fairly straightforward. Follow the guide at, and don't forget to connect your sensor wire; the motor will not spin without it!

Out-runner construction (i.e. Rotor housing is compatible with REV Motion Pattern; you can mount metal , , and )

Check out the for additional specifications and charted motor curves. Please read the and ensure you understand how to set an appropriate before using your NEO 550 Brushless Motor.

For more information please see the section below -

NEO Vortex & Kraken X60 Motor Curves

NEO Vortex & Kraken X60 Data

Parameter
NEO Vortex
Kraken X60
Units

KV

565

523

rpm/V

Free Load Speed

6784

6271

rev/min

Free Load Current

3.62

2.32

A

Stall Current

211

233

A

Stall Torque

3.6

4.21

Nm

Nominal Voltage

12

12

V

Peak Efficiency

77

82

%

Peak Power

640

691

W

Power @ 40 Amps

361

378

W

NEO Vortex & Falcon 500 V2 Motor Curves

NEO Vortex & Falcon 500 V2 Data

Parameter
NEO Vortex
Falcon 500 V2
Units

KV

565

541

rpm/V

Free Load Speed

6784

6489

rev/min

Free Load Current

3.62

2.39

A

Stall Current

211

191

A

Stall Torque

3.6

3.46

Nm

Nominal Voltage

12

12

V

Peak Efficiency

77

83.06

%

Peak Power

640

588

W

Power @ 40 Amps

361

376

W

NEO Vortex & NEO V1.1 Motor Curves

The data shown for NEO V1.1 is also valid for the NEO V1

NEO Vortex & NEO V1.1 Data

Parameter
NEO Vortex
NEO V 1.1
Units

KV

565

485

rpm/V

Free Load Speed

6784

5820

rev/min

Free Load Current

3.62

2.065

A

Stall Current

211

160

A

Stall Torque

3.6

3

Nm

Nominal Voltage

12

12

V

Peak Efficiency

77

76.54

%

Peak Power

640

456

W

Power @ 40 Amps

361

333

W

All of our motor testing was performed on .

All of our motor testing was performed on .

All of our motor testing was performed on .

The is a new smart motor controller from REV Robotics. Its dockable form factor allows for direct mounting onto a , simplifying wiring while maintaining flexibility. Improving upon the foundation of the SPARK MAX, new features include 3-phase current sensing, reverse polarity protection, and an expanded Data Port with additional interfaces. When docked to an adapter, the SPARK Flex can control any existing NEO or compatible brushless/brushed DC motor.

All of our motor testing was performed on .

All of our motor testing was performed on .

All of our motor testing was performed on .

NEO 550 Brushless Motor (REV-21-1651)
Wiring the Spark Max
Gears
Sprockets
Pulleys
NEO 550 (REV-21-1651)
our in-house dynamometer
our in-house dynamometer
our in-house dynamometer
our in-house dynamometer
our in-house dynamometer
our in-house dynamometer
Interpreting this Data

SPARK Flex Specifications

The following tables provide the operating and mechanical specifications for the SPARK Flex Motor Controller.

DO NOT exceed the maximum electrical specifications. Doing so will cause permanent damage to the SPARK Flex and will void the warranty.

Main Electrical Specifications

Parameter
Min
Typ
Max
Units

Input Voltage (Nominal)

-

12

-

V

Operating Voltage Range †

6

-

24

V

Absolute Maximum Supply Voltage

-

-

30

V

Continuous Output Current ††

-

-

60

A

Peak Current (2 second surge)

-

-

100A

A

†

6 V minimum for 5 V Data Port output. 4.5 V minimum before full brownout.

††

Continuous current duration tested at 3 minutes.

PWM Input Specifications

Parameter
Min
Typ
Max
Units

Full-reverse Input Pulse

-

1000

-

μs

Neutral Input Pulse †

-

1500

-

μs

Full-forward Input Pulse

-

2000

-

μs

Valid Input Pulse Range

500

-

2500

μs

Input Frequency

50

-

200

Hz

Input Timeout ††

-

50

-

ms

Default Input Deadband †††

-

5

-

Hz

Input High Level

0.5

0.7

0.9

V

†

Neutral corresponds to zero output voltage (0 V) and is either braking or coasting depending on the current idle behavior mode.

††

If a valid pulse isn't received within the timeout period, the SPARK Flex will disable its output.

†††

Input deadband is added to each side of the neutral pulse width. Within the deadband, output state is neutral. The deadband value is configurable using the REV Hardware Client or through the CAN interface.

Data Port Specifications

Parameter
Min
Typ
Max
Units

5V Supply Output Voltage (Vout)

V

5V Supply Output Current †

-

-

500

mA

Digital Input Voltage Range

0

-

5

V

Digital Input High Voltage

1.85

-

-

V

Digital Input Low Voltage

-

-

1.36

V

Analog Input Voltage Range

0

-

Vout

V

†

Available output current may be reduced when the SPARK Flex is powered only by USB and not main power.

Mechanical Specifications

Parameter
Value and Units

Power Wire Gauge

12 AWG

Power Wire Length

450 mm (17.72in)

Control Wire Gauge

26 AWG

Control Wire Length

450 mm (17.72in)

Through Bore Diameter

16.5 mm (0.649 in)

Mounting Footprint Narrow Side Width

2 in

Mounting Footprint Rounded Side Diameter

60 mm

Mounting Holes

#10-32 on 2 in bolt circle

Mounting Hole Maximum Depth

0.25 in

Body Length (Not Docked)

28.2mm

Docking Hardware

M3 SHCS x 25mm

Weight (with Wires & Docking Screws)

130g (0.29lb)

SPARK Flex (REV-11-2159)
NEO Vortex (REV-21-1652)
Getting Started with the SPARK Flex
Troubleshooting
Status LED Patterns
SPARK Flex Specifications
SPARK Flex Data Port Pinout
Getting Started with the REV Hardware Client
REVLib API and Installation
SPARK Flex Data Port Pinout

Power and Motor Connections

SPARK Flex is designed to drive 12V brushed and brushless DC motors at current up to 60A continuously. It features a unique Docking Interface that ensures secure and reliable motor phase and sensor connections, reducing the chance of intermittent or poor connections affecting the commutation of the attached motor.

Power Input

Power input wires are labeled as + and - with red and black wires, respectively, and consist of two 12 AWG ultra-flexible silicone-coated wires extending 45 cm from the motor controller case.

SPARK Flex is intended to operate in a 12 V DC robot system, however it is compatible with any DC power source between 4.5 V and 24 V.

Please note that the 5 V power output of the Data Port requires a 6 V minimum input voltage.

DO NOT exceed the maximum supply voltage of 30 V. Doing so will cause permanent damage to the SPARK Flex and will void the warranty.

When used in high power applications, it is recommended to use a power source that is capable of handling large surge currents, e.g. a 12V lead-acid battery. If the supply voltage drops below 4.5 V the SPARK Flex will brown out, which can result in unexpected behavior. It is also highly recommended to add a fuse or circuit breaker in between your SPARK Flex and its power source to prevent exceeding the maximum current rating.

DO NOT exceed the maximum current ratings:

  • 60A for 3 minutes

  • 100A for 2 seconds

Doing so will cause permanent damage to the SPARK Flex and will void the warranty.

Docking Interface

SPARK Flex is specifically designed to dock with the NEO Vortex Brushless Motor. Docking eliminates the extra connections between the motor and motor controller that are prone to fail due to assembly issues and rough environments.

When docked into a SPARK Flex Dock (coming soon), the motor controller can also drive virtually any 12 V brushed DC motor and the existing NEO & NEO 550 brushless motors.

Instruction on how to dock a SPARK Flex can be found within the documentation of the applicable device:

  • SPARK Flex Dock Instructions - Coming Soon

Be sure to fully install the Docking Screws when docking the SPARK Flex. These screws ensure a robust and secure electrical connection. Operating the SPARK Flex and its attached motor or dock without these screws can cause unintended behavior and damage to the system.

Always dock and undock the SPARK Flex with both main power and USB power disconnected.

Control Connections

CAN/PWM Connections

CAN and PWM control connections share a set of four integrated 26 AWG twisted wires extending 45 cm from the case of the motor controller. Each wire is color coded according to its function:

Wire Color
CAN Function
PWM Function

Yellow

CAN High (CANH)

Signal

Green

CAN Low (CANL)

Ground

The wires are terminated with two 1 x 3, 0.1 in pitch, rectangular connectors, both excluding the center pin. One connector is pinned and the other socketed to facilitate daisy-chaining between multiple CAN devices on the bus when using the CAN interface.

Each matching wire pair is physically connected to its functional counterpart within the device. Even if the SPARK Flex loses power, the CAN bus remains unbroken, leaving downstream devices unaffected.

Pay close attention when daisy-chaining devices, and make sure that the colors match from connector-to-connecter along the entire CAN bus. Mismatched connections can cause difficult-to-diagnose communications issues along the entire bus.

When using the PWM interface, only one of the two connectors should be used. In most systems this will be the socketed connector. Therefore, it is best practice to secure the unused wires and protect the exposed pins by covering them with electrical tape.

USB-C Port

The USB-C Port is located above the CAN/PWM wires of the SPARK Flex. It supports USB 2.0 and can provide 5 V power for the SPARK Flex's internal microcontroller.

While you can configure the SPARK Flex under USB-only power, you will not be able to spin a motor unless main power is also connected.

More information about what can be configured and operated through the USB port can be found in the USB Interface section.

SPARK Flex Feature Description

The SPARK Flex Motor Controller is a fully featured smart motor controller designed to be robust and easy to use yet fully capable of advanced motion control. The following sections describe each feature in detail.

SPARK Flex Connections

Allows for seamless firmware updates and code uploads, facilitating quick and efficient software management through the REV Hardware Client

Allows for integration of additional sensors such as the Through Bore Encoder, analog sensors, absolute encoders, and limit switches.

Ultra-flexible, and Silicone-coated Wires

Status LED Indicator

  • Precisely engineered clearance holes for docking screws provide stable and secure attachment of the SPARK Flex and NEO Vortex to your Mechanism

  • High-current Bullet Connectors facilitate quick and secure connections to the NEO Vortex's phases, ideal for high-performance and high-power applications

  • Robust Motor Interface Connector mates to the NEO Vortex's control systems to ensure efficient, secure, and reliable electrical connections and communication

  • The SPARK Flex features six #10-32 threaded mounting holes on a 2 in bolt circle

Data Port

Located next to the SPARK Flex's power and control input wires, the Data Port allows for extra sensor input and future feature expansion. Connector details can be found below.

Data Port Pinout

Connector Pin
Pin Type
Pin Function

1

Digital

Reserved

2

Power

+5V

3

Analog

Analog Input

4

Digital

Forward Limit Switch Input

5

Digital

External Encoder - B Input

6

Digital

Absolute Encoder - Duty Cycle Input

7

Digital

External Encoder - A Input

8

Digital

Reverse Limit Switch Input

9

Digital

External Encoder - Index Input

10

Power

Ground

SPARK Flex Data Port Break Out Cable

The keyed and locking Data Port connector ensures a secure and aligned fit when plugged into the SPARK Flex Motor Controller. Its JST-PH 6-pin connector is designed to plug directly into the REV Through Bore Encoder, connecting both the quadrature and absolute encoder outputs to the appropriate SPARK Flex Data Port pins. Additional inputs, like Limit Switch and Analog inputs, are broken out to shrouded, 1 x 3 pinned, 0.1in pitch, PWM-style connectors that provide both power and ground in addition to the input signal.

SPARK Flex Data Port Pigtail Cable

Data Port Connector Information

The SPARK Flex Data Port is a 0.05 in pitch, 2 x 5 pin, keyed and locking connector. Custom cables can be made with the following parts:

Connector Part
Manufacturer
Part Number

Latching Housing

Samtec

ISDF-05-D-M

Contact (28 - 30 AWG)

Samtec

CC03R-2830-01-GF CC03R-2830-01-G

Data Port Pigtail - Electrical Specifications

Parameter
Value and Units

Length

30cm

Wire Gauge

28AWG

Data Port Breakout Cable - Electrical Specifications

Parameter
Value and Units

Total Length

30cm

Wire Gauge

28AWG

  • 1 x JST PH, 6-pin connector

  • 4 x Servo Connector 0.1" Pitch, 3-pin Male Shrouded

Mounting Holes

The mounting face of the SPARK Flex features six #10-32 threaded mounting holes on a 2 in bolt circle. Each hole has an absolute maximum depth of 0.25 in.

DO NOT exceed the maximum mounting screw depth of 0.25 in when mounting the SPARK Flex. Doing so will result in permanent damage to the SPARK Flex and will void the warranty.

Depth gauges are laser-etched into each side of the SPARK Flex body to make it easy to check that the chosen screw length will not violate the maximum depth.

Simply check the screw length against the intended stack-up of structure and motor controller, and verify that it does not violate the maximum depth.

NEO 550 Motor Data Sheet
NEO 550 Motor Locked Rotor Testing

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

When daisy-chaining or extending the connections, use the included to secure the two mating connectors together to prevent unintended disconnections.

Supply and through 45cm long high-quality wires. Twisted Control wires also feature to make wiring the SPARK Flex easy for PWM or CAN control.

Displays the , ensuring easy troubleshooting and real-time monitoring

The breaks out the default pin functions of the SPARK Flex Data Port into commonly used connectors for external sensors.

The breaks out the SPARK Flex Data Port to individual unterminated wires and is useful for connecting custom circuits or sensors without a standard connector. It features the keyed and locking Data Port connector to ensure a secure and aligned fit when plugged into the SPARK Flex Motor Controller. Each wire is uniquely color-coded for easy identification.

NEO Vortex Docking Instructions
Control Interfaces
PWM Cable Clips (REV-11-1229)
Locking Data Port
operational status and error codes
SPARK Flex Mounting Holes
SPARK Flex Data Port Breakout Cable (REV-11-2853)
SPARK Flex Data Port Pigtail Cable (REV-11-2852)
USB-C Port
Input Power
Control Signals
two standardized connectors
SPARK Flex Docking Interface

Mode Button

Pressing the SPARK Flex Mode Button

The Mode Button is specifically designed to be difficult to press inadvertently. Therefore, please follow the steps below to press the mode button successfully.

Using a small and blunt tool, like a straightened paper clip, gently press the Mode Button. You should feel and hear a soft click. If you are in a noisy environment, you may only be able to feel the click through the tool.

DO NOT use a sharp tool to press the Mode Button.

Safety pins, thumbtacks, pinbacks buttons, and other sharp tools will cause damage to the Mode Button's material.

If you do not feel the click, ensure the tool is aligned with the button.

DO NOT press with excessive force.

You should feel the click of the button with relatively gentle pressure. Pressing with excessive force can permanently damage the button.

Some early batches of SPARK Flex Motor Controllers have variances in the alignment of the Mode Button and the case hole. Misaligned buttons can still be pressed and the alignment does not affect the functionality of the SPARK Flex Motor Controller as a whole.

If your button is misaligned, please pay close attention and avoid the gap between the button and the printed circuit board (PCB):

Again, DO NOT use a sharp tool to press a misaligned Mode Button. It can easily be inserted into the indicated gap above, and permanently damage the button. Generally, a sharp tool should never be used to press the Mode Button.

Please reach out to us at support@revrobotics.com if you are still having difficulty pressing your Mode Button after following this guide.

SPARK Flex Getting Started

SPARK Flex Anatomy

Side View

Outside

Inside

The SPARK Flex is a motor controller with many features allowing it to control a host of brushless and brushed motor controllers. Out of the box, the Flex can be docked directly with a NEO Vortex Brushless Motor and drive it with the Flex's PWM interface. This Getting Started guide will assume that you are driving NEO Vortex and includes steps to get the motor spinning using the REV Hardware Client as well as information on how to configure your SPARK Flex. Driving other motors requires the SPARK Flex Dock (coming soon) and will be covered in its own separate guides.

Before You Start

Before following this guide, the REV Hardware Client should be installed before continuing. It is the best way to verify that the device up to date and configured correctly. Configuration through the Hardware Client is required before using the CAN interface.

Control Interfaces

PWM Interface

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!

Operating Modes

Brushed/Brushless Mode - Motor Type

This mode is only compatible with the SPARK Flex Dock (coming soon). More information about this mode will be available once the dock is available.

Brake/Coast Mode - Idle Behavior

When the SPARK Flex is receiving a neutral command the idle behavior of the motor can be handled in two different ways: Braking or Coasting.

When in Brake Mode, the SPARK Flex will effectively short all motor wires together. This quickly dissipates any electrical energy within the motor and brings it to a quick stop.

When in Coast Mode, the SPARK Flex will effectively disconnect all motor wires. This allows the motor to spin down at its own rate.

The Idle Mode can be configured using the Mode Button, CAN, and USB interfaces.

Mode Button Configuration

Follow the steps below to switch the Idle Mode between Brake and Coast with the Mode Button.

Use a small straightened paper clip or other small blunt tool to press the button. Never use a sharp tool or any type of pencil, as the pencil lead can break off inside the SPARK Flex.

  1. Connect the SPARK Flex to main power, not just USB Power.

  2. The Status LED will indicate which Idle Mode is currently configured by blinking blue or cyan for Brake and yellow or magenta for Coast depending on the motor type.

  3. Press and release the Mode Button

  4. You should see the Status LED change to indicate the selected Idle Mode.

USB Configuration

Follow the steps below to switch the Idle Mode between Brake and Coast with the USB and the REV Hardware Client application. Be sure to download and install the REV Hardware Client application before continuing.

  1. Connect the SPARK Flex to your computer using a USB-C cable.

  2. Open the REV Hardware Client application and verify that the application is connected to your SPARK Flex.

  3. On the Basic tab, select the desired mode with the Idle Mode switch.

  4. Click Update Configuration and confirm the change.

CAN Configuration

Please see the API Information for information on how to configure the SPARK Flex using the CAN interface.

Recovery Mode

In the rare case where a firmware update has been interrupted or corrupted, it may be necessary to boot the SPARK Flex into Recovery Mode. This can be done by following the steps below. Have a computer running the REV Hardware Client and a USB cable ready in order to reload the device firmware once the device is in Recovery Mode.

Use a small straightened paper clip or other small blunt tool to press the button. Never use a sharp tool or any type of pencil, as the pencil lead can break off inside the SPARK Flex.

  1. Start with all power disconnected from the SPARK Flex.

  2. Press and hold the Mode Button.

  3. While still holding the Mode Button, connect power by either turning on main power or connecting the USB cable between the SPARK Flex and the computer.

  4. Once powered, you may release the Mode Button. The LED should stay dark. The SPARK Flex is now in Recovery Mode.

If the firmware is not booting properly, it may not be easy to know if the device has entered Recovery Mode since the LED will be dark in both cases. To confirm that the SPARK Flex is in Recovery Mode:

  1. Connect the USB cable between the SPARK Flex and computer if not already connected.

  2. In the REV Hardware Client, the SPARK Flex should show up as a Recovery Mode Device when scanning for devices.

If the device doesn't show up, please repeat the process, ensuring that the power and button holding sequence is followed exactly. If the device still doesn't show up, please contact REV Support.

Wiring the SPARK Flex

Required Materials

  • 12 V battery

  • 120 A circuit breaker

  • Power Distribution Hub

  • SPARK Flex

  • NEO Vortex

  • Associated wiring and a "test bed" described below

  • USB type-C cable

  • A Computer Running the REV Hardware Client

Prepare the Components

Test Bed

Wiring the SPARK Flex to the Power Distribution Hub is just like wiring a SPARK MAX.

Motor Connections and Mounting

Be sure to fully install the Docking Screws when docking the SPARK Flex. These screws ensure a robust and secure electrical connection. Operating the SPARK Flex and its attached motor or dock without these screws can cause unintended behavior and damage to the system.

Mount the docked SPARK Flex and NEO Vortex assembly to a piece of structure to keep it secured when it spins up. The motor has a lot of inertia and upon spin-up it can jump off the table.

The SPARK Flex's mounting face includes six #10-32 threaded mounting holes that are on a 2 in bolt circle. This bolt pattern is compatible with many structure types available, including REV ION System. However, two 0.196 - 0.201 in holes, spaced 2 in apart can easily be drilled into a piece of wood to rigidly mount the assembly.

Power Connections

The power wires are permanently connected to the SPARK Flex and are not replaceable. Take care not to cut these wires too short. It is highly recommended to install connectors on these wires to allow for reconfiguration as you experiment and design your robot. WAGO 221 Inline Splicing Connectors (REV-19-2491-PK50) and Anderson Power Pole connectors are commonly used for this purpose.

Make sure the power is disconnected or turned off before making any electrical connections on your test bed or robot.

Connect the integrated SPARK Flex power leads labeled + (red) and - (black) to an available channel on the Power Distribution Hub. If you need to extend the length of the integrated wires, it is recommended to use 12 AWG wire or larger (a lower gauge number).

The mode button can be used to activate basic operating modes within the SPARK Flex. For information on those modes, please see the section.

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 .

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 .

Please follow the before continuing.

Please see the for information on how to identify the Idle Behavior configuration by the color of the Status LED!

Please follow the before continuing.

Using a "test bed" is an easy way to get started with the SPARK Flex and to verify connections and code. For the initial bring-up of the SPARK Flex, a test bed with a single Flex, NEO Vortex, and a is recommended.

Dock the SPARK Flex on the NEO Vortex by following the .

DO NOT exceed the 0.25 in mounting screw depth of the SPARK Flex. Doing so can permanently damage the SPARK Flex and will void the warranty. See the section for more details before mounting your SPARK Flex for the first time.

Operating Modes
Control Connections
Status LED Patterns guide
properly wired Power Distribution Hub with a breaker
NEO Vortex Docking Instructions
Mounting Holes
Connections
CAN/PWM
Pressing the SPARK Flex Mode Button guide
Pressing the SPARK Flex Mode Button guide

Make it Spin!

Power On

If you are using a brushed motor, you may see a sensor error. This is expected until you configure the device to accept a brushed motor in the following steps.

Connect to the SPARK Flex

Plug in the USB cable and start the REV Hardware Client. Select the SPARK Flex from the Connected Hardware

If you cannot see the SPARK Flex, make sure that the SPARK Flex is not being used by another application . Then unplug the SPARK Flex from the computer and plug it back in.

Basic Setup and Configuration

Before any parameters can be changed, you must first assign a unique CAN ID to the device. This can be any number between 1 and 63. After setting a unique CAN ID, the user interface will refresh and allow you to change other parameters.

Eventually you may set up a CAN network on your test bench or robot. Be sure each device on the network has a unique CAN ID. It is helpful to label each device with its ID number to aid in troubleshooting.

Set the Motor Type

If you are using a NEO Vortex, NEO, or NEO 550, verify that the motor type is set to REV NEO Brushless, Sensor Type is Hall Effect, and the LED is blinking Magenta or Cyan.

If you see a Sensor Fault blink code, make sure the Motor Interface Connector is properly seated.

The ability to run a Brushed motor using a SPARK Flex will not be available until the release of the SPARK Flex Dock.

Suggested Current Limits

Your ideal current limit may vary based on your specific application, but these values can be used as a starting point to reduce the chance of an overload on your motor as you begin tuning your specific mechanism's Smart Current Limit.

Motor Type
Current Limit Range

NEO Vortex

80A

40A - 60A

20A - 40A

Warning: Setting current limits outside of the suggested ranges listed above may cause unintended overload and severe damage to components that are not covered by warranty.

Save the Settings

The settings must be saved for the SPARK Flex to remember its new configuration through a power cycle. To do this, press the Burn Flash button at the bottom of the page. It will take a few seconds to save, indicated by the loading symbol on the button.

As of REV Hardware Client version 1.7.0, "Burn Flash" has been renamed to "Persist Perimeters"!

Any settings saved this way will be remembered when the device is powered back on. You can always restore the factory defaults if you need to reset the device.

Spin the Motor

Before running any motor, make sure all components are in a safe state, that the motor is secured, and that anyone nearby is aware. FRC motors are very powerful and can quickly cause damage to people and property.

Keep the CAN cable disconnected throughout the test. For safety reasons, the REV Hardware Client will not run the motor if the roboRIO is connected. If the roboRIO was connected, power cycle the SPARK Flex.

To spin the motor, go to the Run tab, keep all of the default settings and press Run Motor. The setpoint is 0 by default, meaning that the motor is being commanded to idle (0% power). When you press Run you should see the LED go from slow blinking to solid, indicating that the motor is idling.

Slowly ramp the setpoint slider up. The motor should start to spin and you should see a green blink pattern proportional to the speed you have set to the motor. Slowly ramp the slider down. The motor should spin in reverse, and you should see a red blink pattern proportional to the speed you have set to the motor.

Now that the device is wired, and the connections carefully checked, power on the robot. You should see the SPARK Flex slowly blinking its for a new device the color will be Magenta. If the LED is dark, or you see a different blink pattern, refer to the guide for troubleshooting.

NEO ()

NEO 550 ()

If you are unable to spin the motor, visit our.

Status LED
troubleshooting guide
REV-21-1650
REV-21-1651

SPARK Flex Troubleshooting

Many issues can be solved by systematic troubleshooting without needing to contact REV Support. Take a look at the troubleshooting tips below for help in determining the cause of the issue you are seeing. Should you need to contact us, describing the steps you've taken in detail will help us get you up and running quickly.

General Troubleshooting Tips

The key to effective troubleshooting is isolating the issue. Many issues can show the same symptom, so eliminating failure points one at a time is critical to finding the root cause.

Rule Out Issues By Isolation

If possible, try to eliminate a section of the system when troubleshooting. For example:

  • Rule out a code or control wiring issue:

    • Use the REV Hardware Client to run the SPARK Flex over USB.

      • Please be aware of the CAN lockout feature of the SPARK Flex. If it has been connected to the roboRIO's CAN bus, a safety feature within the SPARK Flex will lock out USB communication. Disconnecting from the CAN bus and power cycling the MAX will release the lock.

  • Rule out a code issue:

    • Create a simple test program using our SPARK Flex Example Code.

  • Rule out a mechanical issue:

    • Remove the motor from the mechanism or use a different, free-spinning motor.

Use the Driver Station

An extremely useful set of tools can be found on the Driver Station:

    • Look at the PDP channel current draw:

      • Higher than expected current on a channel can indicate both mechanical and electrical issues.

    • Look at the battery voltage:

      • Large dips in the battery voltage around the time of an issue can indicate battery health issues that cause brownouts.

    • Look at the CAN Bus Utilization.

    • Look at CAN Faults.

    • Look at Comms Faults:

      • Comms faults can affect the SPARK Flex. If it loses communication with the roboRIO, it will go to its safe disabled state. This can look like a momentary glitch in a motor spinning if the comms faults are infrequent and irregular.

Use the APIs

It is also very useful to log or plot operating values internal to the SPARK Flex. These values can be accessed using the SPARK Flex APIs. Useful values to log:

  • getAppliedOutput()

    • This value will show what the SPARK Flex is actually applying to the motor output. This can illuminate issues with closed-loop control tuning.

  • getOutputCurrent()

    • This value will show the output current going to the phases of the motor. Output current won't always be the same as the Input current measured by the PDP. Knowing the output current is useful to diagnose current-limit issues if motors are overheating.

  • getBusVoltage()

    • A way to measure the input voltage right at the controller.

  • getStickyFaults()

    • A sticky fault indicates if a fault has occurred since the last time the faults were reset. Checking these can provide a lot of insight into what the controller is experiencing.

CAN Troubleshooting

Recovery Mode

Sometimes, when updating the firmware on a SPARK Flex, it is possible for the process to be interrupted or for the firmware to be corrupted by a bad download or other type of interruption in data transfer. In this state, the Status LED will be dark or dim and the device will fail to operate. There is a built-in recovery mode that can force your device to accept new firmware even if the controller seems to be bricked and the procedure is outlined below:

Please note, that performing this procedure will erase all data and settings on the device. To perform the procedure a small tool, like a straightened paper clip, is necessary to press the Mode Button (located to the right of the Status LED), the orange USB-C cable that came with the unit (or a DATA capable USB-C cable), and a native Windows based computer with the REV Hardware Client installed:

  1. With the SPARK Flex disconnected from power, press and hold the Mode Button.

  2. While still holding the Mode Button, connect the Device to the computer using the USB-C cable - the Status LED will not illuminate - this is expected.

  3. With the REV Hardware Client running on the computer, wait a few seconds for the audible tone or icon for the device to be recognized in recovery mode then release the Mode Button - no lights will be present on the SPARK Flex during this stage of the process, this is expected.

  4. Select the SPARK Flex in Recovery Mode from the REV Hardware Client window.

  5. From the "Choose a Device" type dropdown, choose - SPARK Flex.

  6. Choose the latest version of the firmware from the dropdown and then click update.

  7. Wait for the software update to complete.

  8. Power cycle unit (unplug and plug in USB-C) click on the SPARK Flex icon, and clear any sticky faults - the recovery should be complete!

If this is your first time running the REV Hardware client, see the for a tour of the software and its features.

Use the

Use the

Getting Started with the REV Hardware Client
Driver Station Log File Viewer
CAN/Power Tab

Basic Configurations

SPARK Flex has many operating modes that can be configured through its CAN and USB interfaces.

Coming soon!

NEO Vortex Motor shown from the back. You can fully see the through bore 1/2in Hex Motor Spindle.
Parts of a NEO Vortex Brushless Motor
NEO Vortex Motor Curve
Parts of a NEO Vortex Shaft
Docking a NEO Vortex to a SPARK Flex/NEO VortexSolo Adapter
NEO v1.1 Motor Curve
NEO Vortex Motor Curve
Kraken X60 Motor Curve
NEO Vortex Motor Curve
Falcon 500 V2 Motor Curve
NEO Vortex Motor Curve
NEO V1.1 Motor Curve
NEO V1.1 Motor Curve
Kraken X60 Motor Curve
NEO V1.1 Motor Curve
Falcon 500 V2 Motor Curve
NEO V1.1 Motor Curve
NEO Vortex Motor Curve
NEO Vortex Motor Curve
NEO V1.1 Motor Curve
Kraken X60 Motor Curve
Falcon 500 V2 Motor Curve
SPARK Flex Motor Controller
SPARK Flex Power Wires
SPARK Flex Docking Interface
SPARK Flex Control Connections
SPARK Flex Main Power and Control Connections
SPARK Flex Docking Interface
SPARK Flex Mounting Hole Pattern
SPARK Flex Data Port Pinout Diagram
SPARK Flex Mounting Hole Pattern
SPARK Flex Mounting Screw Depth Gauge
Checking Screw Length with SPARK Flex Mounting Screw Depth Gauge
Tips for Pressing a Misaligned Mode Button

SPARK Flex Operating Modes

Brake/Coast Mode - Idle Behavior

When the SPARK Flex is receiving a neutral command the idle behavior of the motor can be handled in two different ways: Braking or Coasting.

When in Brake Mode, the SPARK Flex will effectively short all motor wires together. This quickly dissipates any electrical energy within the motor and brings it to a quick stop.

When in Coast Mode, the SPARK Flex will effectively disconnect all motor wires. This allows the motor to spin down at its own rate.

The Idle Mode can be configured using the Mode Button, CAN, and USB interfaces.

Mode Button Configuration

Follow the steps below to switch the Idle Mode between Brake and Coast with the Mode Button.

Use a small screwdriver, straightened paper clip, pen, or other small implement to press the button. Do not use any type of pencil as the pencil lead can break off inside the SPARK Flex.

  1. Connect the SPARK Flex to main power, not just USB Power.

  2. The Status LED will indicate which Idle Mode is currently configured by blinking blue or cyan for Brake and yellow or magenta for Coast depending on the motor type.

  3. Press and release the Mode Button.

  4. You should see the Status LED change to indicate the selected Idle Mode.

USB Configuration

  1. Connect the SPARK Flex to your computer using a USB-C cable.

  2. Open the REV Hardware Client application and verify that the application is connected to your SPARK MAX.

  3. On the Basic tab, select the desired mode with the Idle Mode switch.

  4. Click Burn Flash and confirm the change.

CAN Configuration

SPARK Flex Status LED Patterns

SPARK Flex will indicate important status information on its multi-colored Status LED visible through the frosted plastic near the USB port. The following tables shows each state and the corresponding LED color pattern.

Standard Operation

Identification, Updating, and Recovery

Fault Conditions

PWM Pulse Mapping

Please see the guide for information on how to identify the Idle Behavior configuration by the color of the Status LED!

Follow the steps below to switch the Idle Mode between Brake and Coast with the USB and the REV Hardware Client application. Be sure to application before continuing.

Please see the for information on how to configure the SPARK Flex using the CAN interface.

Mode
Color/Pattern
Graphic

Device Identify

White/Magenta Fast Blink

CAN Bootloader Firmware Updating

White/Yellow Blink

CAN Bootloader Firmware Retry

White/Blue Blink

USB DFU (Device Firmware Update)

Dark (LED off)

Recovery Mode

Dark (LED off)

Fault
Condition
Color/Pattern
Graphic

12V Missing

The motor will not drive if powered only by USB. This blink code warns the user of this condition.

Orange/Blue Slow Blink

Sensor Fault

This can occur if the sensor type is misconfigured, the sensor cable is not plugged in or damaged, or if a sensor other than the motor sensor is plugged in.

Orange/Magenta Slow Blink

Gate Driver Fault

A fault reported by the core internal electronic circuitry. If this code persists after power cycling the controller, contact REV.

Orange/Cyan Slow Blink

CAN Fault

The CAN fault will be shown after the first time the device is plugged into the CAN port and a fault later occurs. Check your CAN wiring if you see this fault.

Orange/Yellow Slow Blink

Temperature Cutoff Fault

The motor or motor controller has gotten too hot to continue running. This fault will clear automatically after the system cools down enough to run again.

Orange/Green Slow Blink

Corrupt Firmware (recover using Recovery Mode)

Firmware failed to load.

Dark (LED off)

Status LED Patterns
download and install the REV Hardware Client
API Information

SPARK MAX Overview

Feature Summary

  • Brushed and sensored-brushless motor control

  • PWM, CAN, and USB control interfaces

    • PWM/CAN - Locking and keyed 4-pin JST-PH

    • USB - USB type C

  • USB configuration and control

    • Rapid configuration with a PC

  • Smart control modes

    • Closed-loop velocity control

    • Closed-loop position control

    • Follower mode

  • Encoder port

    • Locking and keyed 6-pin JST-PH

    • 3-phase hall-sensor encoder input

    • Motor temperature sensor input

  • Data port

    • Limit switch input

    • Quadrature encoder input with index

    • Multi-function pin

  • Mode button

    • On-board motor type and idle behavior configuration

  • RGB status LED

    • Detailed mode and operation feedback

  • Integrated power and motor wires

    • 12 AWG ultra-flexible silicone wire

  • Passive cooling

Kit Contents

The following items are included with each SPARK MAX Motor Controller

  • 1 - SPARK MAX Motor Controller

  • 1 - USB-A male to USB-C cable

  • 1 - 4-pin JST-PH to CAN cable

  • 1 - 4-pin JST-PH to single PWM cable

  • 1 - PWM/CAN cable retention clip

  • 1 - Data port protection cap

Special Thanks

Power and Motor Connections

SPARK MAX is designed to drive 12V brushed and brushless DC motors at currents up to 60A continuously. Power and motor connections are made through the two sets of wires built into the SPARK MAX. The wires are 12AWG ultra-flexible silicone-coated wire. Each wire runs approximately 15cm from the end faces of the controller. Be sure to take care when cutting and stripping the wires as not to cut them too short. The figure below shows these connections in detail.

As with any electrical component, make all connections with the power turned off. Connecting the SPARK MAX to a powered system may result in unexpected behavior an may pose a safety risk.

Motor Output

Motor output wires are labeled as A, B, and C with red, black, and white wires. Brushed motors must be connected to the A and B wires, while brushless motors must be connected to all three. It is critical that the order of the brushless motor wires match the SPARK MAX or the motor will not spin and could be damaged. Additional details are below.

Motor Connections

Power Input

Power input wires are labeled as V+ and V- with red and black wires. The SPARK MAX is intended to operate in a 12 V DC robot system, however, it is compatible with any DC power source between 5.5 V and 24 V.

DO NOT reverse V+ and V- or swap motor and power connections. Doing so will cause permanent damage to the SPARK MAX and will void the warranty.

DO NOT exceed the maximum supply voltage of 30V. Doing so will cause permanent damage to the SPARK MAX and will void the warranty.

When using high-current motors, it is recommended to use a power source that is capable of handling large surge currents, e.g. a 12V lead-acid battery. If the supply voltage drops below 5.5V the SPARK MAX will brown out, resulting in unexpected behavior. It is also highly recommended to incorporate a fuse or circuit breaker in series with the SPARK MAX between it and the power source to prevent exceeding the maximum current rating.

DO NOT exceed the maximum current ratings:

  • 60A for 3 minutes

  • 100A for 2 seconds

Doing so will cause permanent damage to the SPARK Flex and will void the warranty.

Control Connections

CAN/PWM Port

The CAN/PWM Port is located on the power input side of the SPARK MAX. This port can be connected to either a servo-style PWM signal or a CAN bus with other devices. Connector details can be found below.

CAN/PWM Port Connector Information

Mating Connector Information

Identical-function pins are electrically connected inside the SPARK MAX, therefore the CAN daisy-chain is completed internally and any two signal and ground pairs can be used for PWM.

USB-C Port

The USB-C Port is located on the power input side of the SPARK MAX. It supports USB 2.0 and 5V power for the SPARK MAX's internal microcontroller. While you can configure the SPARK MAX without main power, you will not be able to spin a motor.

Encoder Port

Encoder Port Connector Information

Mating Connector Information

Data Port

SPARK MAX Data Port Pinout

Located on the top of the SPARK MAX, the Data Port allows for extra sensor input and future feature development. The connector details can be found below.

SPARK MAX Data Port Features

Limit Switch Inputs

SPARK MAX has two limit switch inputs that, when triggered, can independently prevent motion in both the forward and reverse directions. By default, when the pin for the corresponding direction is grounded, SPARK MAX will override any input commands for that direction and force the output into the neutral state. Input commands for the opposite direction will still be processed unless the corresponding limit signal is also triggered.

The default polarity is compatible with Normally Open (NO) style limit switches, whose contacts are shorted together when the switch is pressed. The Limit Switch Inputs can be configured for the opposite polarity using the USB or CAN interfaces. When configured for the opposite polarity, Normally Closed (NC), the limit will be triggered when the pin is left disconnected from ground. In other words, connecting the pin to ground will release the limit. The following table shows these configurations in detail:

Limit Switch Operation

Quadrature Encoder Input

When in Brushed Mode, an external encoder can be connected through either the Data Port or the Encoder Port.

The SPARK MAX encoder signals are not pulled high internally. This is to ensure the maximum compatibility with different types of encoders.

Analog Input

The Analog Port on the SPARK MAX can measure voltages up to 3.3V with 12-bit resolution. The SPARK MAX Data Port Breakout includes a 5V to 3.3V amplifier circuit so that 5V signals can be sensed with the Analog Input pin.

Analog input is supported on firmware versions 1.4.0 and newer.

Multi-function Pin

This pin is reconfigured when the SPARK MAX is configured in Alternate Encoder Mode.

Power Rails

SPARK MAX Data Port Accessories

Alternate Encoder Adapter

Features

  • JST PH 6-pin connector

  • Pinout compatible with REV Through Bore Encoder

  • Index Signal/Absolute PWM Pulse selection switch

  • Selects which signal is connected to pin 4 of the Data Port

  • Solder pads

  • Analog Input

  • 3.3V and 5.0V Power

  • Ground

Specifications

  • 1 x JST PH, 6-pin connector

  • 1 x 14 Position 2 Row Receptacle Connector 0.050"

Absolute Encoder Adapter

Features

  • JST PH 6-pin connector

  • Pinout Compatible with REV Through Bore Encoder

  • Solder pads

  • Limit Switches

  • Ground

Specifications

  • 1 x JST PH, 6-pin connector

  • 1 x 14 Position 2 Row Receptacle Connector 0.050"

Data Port Breakout Board

Features

  • Solder pads for every Data Port pin

  • Analog input 5V to 3.3V converter

    • Built-in amplifier maps 0V - 5V analog signals to the native 0V - 3.3V range of the SPARK MAX Analog Input

    • Configurable resistors can bypass the amplifier (move R3 to R4 position)

  • Pass-through Data Port connector

    • Connect other sensors with data port-compatible cables while using this breakout

  • Mounts directly to SPARK MAX

    • No need for a data port cable

    • Securely mounts to the SPARK MAX zip-tie notches

SPARK MAX Specifications

The following tables provide the operating and mechanical specifications for the SPARK MAX Motor Controller.

DO NOT exceed the maximum electrical specifications. Doing so will cause permanent damage to the SPARK MAX and will void the warranty.

Main Electrical Specifications

*Continuous operation at 60A may produce high temperatures on the heat sink. Caution should be taken when handling the SPARK MAX if it has been running at higher current level for an extended period of time.

If using a battery to power SPARK MAX, make sure the fully charged voltage is below 24V allowing for sustained operation. Some battery chemistries and configurations, including 6S LiPo packs, have a charge voltage above the maximum operating voltage for SPARK MAX.

PWM Input Specifications

Data Port Specifications

Encoder Port Specifications

Mechanical Specifications

SPARK MAX Resources

General Resources

Software Resources

The REV Robotics is an all-in-one USB, CAN, and PWM enabled motor controller that can drive both 12 V brushed and 12 V brushless DC motors. SPARK MAX is designed for use in the FIRST Robotics Competition (FRC), incorporating advanced motor control in a small, easy-to-use, and affordable package. Configure and run the SPARK MAX through its built-in USB interface without needing a full control system.

We appreciate the assistance from the community for feedback, contributions, and testing the SPARK MAX, especially .

SPARK MAX Motor Controller Power Connections

SPARK MAX cannot detect which motor type it is connected to. Be sure to configure the SPARK MAX to run the type of motor you have connected. See the section for more details on configuring the appropriate motor type.

The SPARK MAX can be controlled by three different interfaces, servo-style PWM, controller area network (CAN), and USB. The following sections describe the physical connections to these interfaces in detail. For details on the operation and protocols of the PWM, CAN, and USB interfaces, please see the .

Located on the motor output side of the SPARK MAX is a 6-pin Encoder Port. This port is designed to accept the built-in hall-encoder from the , but it can also connect to other external encoders when running in Brushed Mode. The connector details can be found below.

The SPARK MAX can be configured to run in , which reconfigures the Data Port on the top of the controller to accept an alternative quadrature encoder in addition to the Encoder Port.

Using the () makes interfacing with the SPARK MAX Data Port easier.

The Quadrature Encoder Input on the Data Port is compatible with standard quadrature encoder signals, usually labeled as channel A, channel B, and Index. SPARK MAX shares these signals with the Encoder Port on the output side of the controller, therefore the Index signal is shared with the third brushless encoder signal C. When in Brushless Mode, these Data Port pins cannot be used with an external encoder. See for information on how to configure the SPARK MAX to accept an alternative encoder source when running in Brushless Mode.

The SPARK MAX Data Port can provide both 3.3V and 5V power to connected devices. Please check for details on the supply current capabilities of both rails.

The SPARK MAX Alternate Encoder Adapter () enables the use of an alternative encoder source different from the default. This is especially useful when running one of the NEO Brushless Motors, as the default encoder port is occupied by the built-in NEO hall sensors. Please see the Alternate Encoder Mode section in the for more information.

The SPARK MAX Absolute Encoder Adapter () connects the Absolute Duty Cycle output of the Through Bore Encoder to the correct SPARK MAX Data Port pins, leaving the incremental quadrature pins disconnected.

The SPARK MAX Data Port Breakout Board () makes it easy to connect external sensors to the SPARK MAX Data Port.

Parameter
Min
Typ
Max
Units
Parameter
Min
Typ
Max
Units
SPARK MAX Motor Controller (REV-11-2158)
Team 195 The CyberKnights

Connector Pin

CAN Function

PWM Function

1

CAN High

Signal

2

CAN Low

Ground

3

CAN High

Signal

4

CAN Low

Ground

Connector Pin

Pin Type

Pin Function

1

Power

Ground

2

Digital

Encoder C / Index

3

Digital

Encoder B

4

Digital

Encoder A

5

Analog

Motor Temperature

6

Power

+5V

Connector Pin

Pin Type

Pin Function

1

Power

+3.3V

2

Power

+5V

3

Analog

Analog Input

4

Digital

Forward Limit Switch Input

5

Digital

Encoder B

6

Digital

Multi-function Pin

7

Digital

Encoder A

8

Digital

Reverse Limit Switch Input

9

Digital

Encoder C / Index

10

Ground

Ground

Operating Voltage Range

5.5

12

24

V

Absolute Maximum Supply Voltage

-

-

30

V

Continuous Output Current

-

-

60*

A

Maximum Output Current (2 second surge)

-

-

100

A

Output Frequency

-

20

-

kHz

Full-reverse Input Pulse †

-

1000

-

μs

Neutral Input Pulse ††

-

1500

-

μs

Full-forward Input Pulse †††

-

2000

-

μs

Valid Input Pulse Range

500

-

2500

μs

Input Frequency

50

-

200

Hz

Input Timeout ‡

-

50

-

ms

Default Input Deadband ‡‡

-

5

-

%

Input High Level

0.5

0.7

0.9

V

Input Voltage Max

12

-

-

V

†

Brushed: between A and B outputs at 100% duty. Brushless: A->B->C direction at 100% duty.

††

Neutral corresponds to zero output voltage (0 V) and is either braking or coasting depending on the current idle behavior mode.

†††

Brushed: between A and B outputs at 100% duty.

Brushless: C->B->A direction at 100% duty.

‡

If a valid pulse isn't received within the timeout period, the SPARK MAX will disable its output.

‡‡

Input deadband is added to each side of the neutral pulse width. Within the deadband, output state is neutral. The deadband value is configurable using the REV Hardware Client or through the CAN interface.

Parameter

Min

Typ

Max

Units

Digital input voltage range †

0

-

5

V

Digital input-high voltage †

1.85

-

-

V

Digital input-low voltage †

-

-

1.36

V

Analog input voltage range ††

0

-

3.3

V

Analog input (12bit)

-

81

-

μV

5V supply current (I5V) ‡

-

-

100

mA

3.3V supply current (I3.3V)

-

-

30

mA

Total supply current (I5V + I3.3V)

-

-

100

mA

Parameter

Min

Typ

Max

Units

Digital input voltage range †

0

-

5

V

Digital input-high voltage †

1.85

-

-

V

Digital input-low voltage †

-

-

1.36

V

Analog input voltage range ††

0

-

3.3

V

5V supply current (I5V) ‡

-

-

100

mA

3.3V supply current (I3.3V)

-

-

30

mA

Total supply current (I5V + I3.3V)

-

-

100

mA

Parameter

Min

Typ

Max

Units

Body length

-

70

-

mm

Body width

-

35

-

mm

Body height

-

25.5

-

mm

Weight

-

113.3

-

g

Power and motor wire gauge

-

12

-

AWG

Power and motor wire length

-

15

-

cm

NEO Brushless Motor
Alternate Encoder Mode
Alternate Encoder Mode
REV-11-1881-PK2
SPARK MAX User's Manual
REV-11-3326
REV-11-1278
REV-11-1278
SPARK MAX Data Port Breakout Board
Data Port Specifications

Description

Manufacturer

Part Number

Vendor

Vendor P/N

JST-PH 4-pin Housing

JST

PHR-4

DigiKey

JST-PH Contact

JST

SPH-002T-P0.5L

DigiKey

Recommended Crimping Tool

IWISS

SN-2549

Amazon

Description

Manufacturer

Part Number

Vendor

Vendor P/N

JST-PH 6-pin Housing

JST

PHR-6

DigiKey

JST-PH Contact

JST

SPH-002T-P0.5L

DigiKey

Recommended Crimping Tool

IWISS

SN-2549

Amazon

†

††

‡

The 5V supply is shared between the Data Port and Encoder Port.

†

††

‡

The 5V supply is shared between the Data Port and Encoder Port.

Wiring the SPARK MAX

Required Materials

  • 12V Battery

  • 120A Circuit Breaker

  • Power Distribution Panel

  • SPARK MAX

  • Brushed or Brushless Motor

  • USB Type-C Cable

Prepare the Components

Test Bed

Electrical Connections

Make sure the power is disconnected or turned off before making any electrical connections on your test bed or robot.

Connect the integrated SPARK MAX power leads labeled V+ (red) and V- (black) to an available channel on the Power Distribution Panel. If you need to extend the length of the integrated wires, it is recommended to use 12AWG wire or larger (lower gauge number).

Motor Connections

The first step is determining the type of motor you wish to connect. The SPARK MAX supports two types of motors: brushed DC and brushless DC. An easy way to determine the motor type is to look at the number of primary (larger) motor wires. Brushed motors only have 2 primary motor wires, while brushless motors have 3 primary wires and additional smaller sensor wires.

NEO Brushless Motor Connections

Connect the three motor wires; red, black, and white, to the matching SPARK MAX output wires labeled A (red), B (black), and C (white).

Next connect the NEO or NEO 550's encoder cable to the port labeled ENCODER just above the output wires.

The encoder sensor cable is required for the operation of brushless motors with SPARK MAX. The motor will not spin without it.

Brushed DC Motor Connections

Connect the two motor wires, M+ (red) and M- (black), to the SPARK MAX output wires labeled A (red) and B (black).

The third output wire, labeled C (white), is not used when driving a brushed motor and should be secured and insulated. We recommend tying it back with a zip-tie and covering the end with a piece of electrical tape. Do not cut this wire in case you wish to use a brushless motor in the future. In the example below the extra unused motor wire is insulated by the white connector and secured in the block.

Verify Connection

Carefully check all connections before continuing and verify that all colors match. The SPARK MAX can be permanently damaged if the power connection is reversed.

Leave the CAN cable disconnected for now, we will wiring this up later.

SPARK MAX Troubleshooting

Many issues can be solved by systematic troubleshooting without needing to contact REV Support. Take a look at the troubleshooting tips below for help in determining the cause of the issue you are seeing. Should you need to contact us, describing the steps you've taken in detail will help us get you up and running quickly.

General Troubleshooting Tips

The key to effective troubleshooting is isolating the issue. Many issues can show the same symptom, so eliminating failure points one at a time is critical to finding the root cause.

Rule Out Issues By Isolation

If possible, try to eliminate a section of the system when troubleshooting. For example:

  • Rule out a code or control wiring issue:

    • Use the REV Hardware Client to run the SPARK MAX over USB.

      • Please be aware of the CAN lockout feature of the SPARK MAX. If it has been connected to the roboRIO's CAN bus, a safety feature within the SPARK MAX will lock out USB communication. Disconnecting from the CAN bus and power-cycling the MAX will release the lock.

  • Rule out a code issue:

    • Create a simple test program using our SPARK MAX Example Code.

  • Rule out a mechanical issue:

    • Remove the motor from the mechanism or use a different, free spinning motor.

Use the Driver Station

An extremely useful set of tools can be found on the Driver Station:

    • Look at the PDP channel current draw:

      • Higher than expected current on a channel can indicate both mechanical and electrical issues.

    • Look at the battery voltage:

      • Large dips in the battery voltage around the time of an issue can indicate battery health issues that cause brownouts.

    • Look at the CAN Bus Utilization.

    • Look at CAN Faults.

    • Look at Comms Faults:

      • Comms faults can affect the SPARK MAX. If it loses communication with the roboRIO, it will go to its safe disabled state. This can look like a momentary glitch in a motor spinning if the comms faults are infrequent and irregular.

Use the APIs

  • getAppliedOutput()

    • This value will show what the SPARK MAX is actually applying to the motor output. This can illuminate issues with closed loop control tuning.

  • getOutputCurrent()

  • getBusVoltage()

    • A way to measure the input voltage right at the controller.

  • getStickyFaults()

    • A sticky fault indicates if a fault has occurred since the last time the faults were reset. Checking these can provide a lot of insight into what the controller is experiencing.

Common Faults and Issues

Below you will find some troubleshooting steps for some common faults and issues related to operating the SPARK MAX.

Motor Not Spinning

Gate Driver Fault

Sensor Fault

Powers via USB but not 12V

Continuity Check Instructions

Measure the continuity between each of the motor phase wires and the sensor wire, as pictured here. Also, check the resistance between wires of the sensor cable and motor wires. Reach out to support@revrobotics.com with results for each phase wire.

Recovery Mode

Sometimes, when updating the firmware on a SPARK MAX, it is possible for the process to be interrupted or for the firmware to be corrupted by a bad download or other type of interruption in data transfer. In this state, the Status LED will be dark or dim and the device will fail to operate. There is a built-in recovery mode that can force your device to accept new firmware even if the controller seems to be bricked and the procedure is outlined below:

  1. With the SPARK MAX disconnected from power, press and hold the Mode Button

  2. While still holding the Mode Button, connect the Device to the computer using the USB-C cable - the Status LED will not illuminate - this is expected.

  3. With the REV Hardware Client running on the computer, wait a few seconds for the audible tone or icon for the device to be recognized in recovery mode then release the Mode Button - no lights will be present on the SPARK MAX during this stage of the process, this is expected

  4. Select the SPARK MAX in Recovery Mode from the REV Hardware Client window

  5. From the "Choose a Device" type dropdown, choose - SPARK MAX

  6. Choose the latest version of the firmware from the dropdown and then click update

  7. Wait for the software update to complete

  8. Power cycle unit (unplug and plug in USB-C) click on SPARK MAX icon, clear any sticky faults - the recovery should be complete!

Basic Configurations

SPARK MAX has many operating modes that can be configured through its CAN and USB interfaces. Additionally, the following basic operating modes can be configured with the MODE button located on the top of the SPARK MAX:

Mode configuration must be done with power applied to the SPARK MAX.

Configuring the idle behavior and motor type using the mode button is a quick way to set up a SPARK MAX without using a computer. This is most useful when you are controlling the SPARK MAX through its PWM interface or when testing the affect of Braking or Coasting on a mechanism.

Idle Behavior

Whenever the SPARK MAX receives a neutral signal (no motor movement) or no signal at all (robot disabled), it can either brake the motor or let it coast. When in Brake Mode, MAX will short the motor wires to each other, electrically braking the motor. This slows the motor down very quickly if it was spinning and makes it harder, but not impossible to back-drive the motor when it is stopped.

  • With power turned on, press and release the MODE button to switch between Brake and Coast Mode.

Motor Type

It is very important to have the SPARK MAX configured for the appropriate motor type.

Operating in Brushed Mode with a brushless motor connected will permanently damage the motor!

With power turned on, press and hold the MODE button for approximately 3 - 4 seconds.

  • Release the MODE button.

Make it Spin!

Power On

If you are using a brushed motor, you may see a sensor error. This is expected until you configure the device to accept a brushed motor in the following steps.

Connect to the SPARK MAX

Plug in the USB cable and start the REV Hardware Client. Select the SPARK MAX from the Connected Hardware

If you can not see the SPARK MAX, make sure that the SPARK MAX is not being used by another application . Then unplug the SPARK MAX from the computer and plug it back in.

Basic Setup and Configuration

Before any parameters can be changed, you must first assign a unique CAN ID to the device. This can be any number between 1 and 63. After setting a unique CAN ID, the user interface will refresh and allow you to change other parameters.

Eventually you may set up a CAN network on your test bench or robot. Be sure each device on the network has a unique CAN ID. It is helpful to label each device with its ID number to aid in troubleshooting.

Set the Motor Type

If you are using a NEO or NEO 550, verify that the motor type is set to REV NEO Brushless, Sensor Type is Hall Effect, and the LED is blinking Magenta or Cyan.

If you see a Sensor Fault blink code, make sure the encoder cable is plugged in completely.

If you are running brushed motor, set the motor type to Brushed, sensor type as No Sensor, and verify that the LED is blinking Yellow or Blue.

Limiting Current

There are two ways to protect your robot’s motors from electrical damage in high-current situations: Circuit Breakers and the SPARK MAX’s Smart Current Limit Setting. To protect your motors from currents that are too high, it is a best practice to limit your current both with the SPARK MAX’s Smart Current Limit and an appropriately rated circuit breaker.

Circuit breakers, while an extremely important part of a robot's wiring and safety, are only designed to trip at a specific temperature, after a set amount of time, to protect the electrical system from fire or other electrical hazards. Due to this, we recommend setting a Smart Current Limit to protect your motors from damage due to high currents.

The SPARK MAX Motor Controller includes a Smart Current Limit feature that can adjust the applied output to the motor to maintain a constant phase current.

Remember that some settings, like Smart Current Limit, must be burned to flash via code or the Hardware Client in order to be retained through a power cycle of the SPARK MAX.

Suggested Current Limits

Your ideal current limit may vary based on your specific application, but these values can be used as a starting point to reduce the chance of an overload on your motor as you begin tuning your specific mechanism's Smart Current Limit.

Warning: Setting current limits outside of the suggested ranges listed above may cause unintended overload and severe damage to components that are not covered by warranty.

Save the Settings

The settings must be saved for the SPARK MAX to remember its new configuration through a power cycle. To do this, press the Burn Flash button at the bottom of the page. It will take a few seconds to save, indicated by the loading symbol on the button.

As of REV Hardware Client version 1.7.0, "Burn Flash" has been renamed to "Persist Perimeters"!

Any settings saved this way will be remembered when the device is powered back on. You can always restore the factory defaults if you need to reset the device.

Spin the Motor

Before running any motor, make sure all components are in a safe state, that the motor is secured, and that anyone nearby is aware. FRC motors are very powerful and can quickly cause damage to people and property.

Keep the CAN cable disconnected throughout the test. For safety reasons, the REV Hardware Client will not run the motor if the roboRIO is connected. If the roboRIO was connected, power cycle the SPARK MAX.

To spin the motor, go to the Run tab, keep all of the default settings and press Run Motor. The setpoint is 0 by default, meaning that the motor is being commanded to idle (0% power). When you press Run you should see the LED go from slow blinking to solid, indicating that the motor is idling.

Slowly ramp the setpoint slider up. The motor should start to spin and you should see a green blink pattern proportional to the speed you have set to the motor. Slowly ramp the slider down. The motor should spin in reverse, and you should see a red blink pattern proportional to the speed you have set to the motor.

SPARK MAX Status LED Patterns

SPARK MAX will indicate important status information on its multi-colored STATUS LED located on the top of its case. The following tables shows each state and the corresponding LED color pattern.

Standard Operation

Identification, Updating, and Recovery

Fault Conditions

Getting Started with the SPARK MAX
Troubleshooting
Status LED Patterns
SPARK MAX Specifications
SPARK MAX Data Port Pinout
Using Encoders with the SPARK MAX
Getting Started with the REV Hardware Client
REVLib API and Installation
MAXSwerve Calibration

See the documentation for more details on the digital pins on the Data Port.

See the documentation for more details on the Data Port's analog pin.

See the documentation for more details on the digital pins on the Data Port.

See the documentation for more details on the Data Port's analog pin.

Using a test bed is an easy way to get started with using the SPARK MAX and verify connections and code. For the initial bring up of the SPARK MAX a test bed with a single SPARK MAX, a brushless or brushed motor, and a is recommended.

The power and motor wires are permanently connected to the SPARK MAX and are not replaceable. So take care not to cut these wires too short. It is highly recommended to install connectors on these wires to simplify both the power and motor connections. A common connector used for this purpose is the Anderson Power Pole connector. Follow our guide for tips on how to properly crimp these connectors.

If this is your first time running the REV Hardware client, see the for a tour of the software and its features.

Use the

Use the

It is also very useful to log or plot operating values internal to the SPARK MAX. These values can be accessed using the . Useful values to log:

This value will show the output current going to the phases of the motor. measured by the PDP. Knowing the output current is useful to diagnose current-limit issues if motors are overheating.

Please note, performing this procedure will erase all data and settings on the device. To perform the procedure a small tool, like a straightened paper clip, is necessary to press the Mode Button (located to the right of the Status LED), the orange USB-C cable that came with the unit (or a DATA capable USB-C cable), and a native Windows based computer with the installed:

: Brake/Coast

: Brushed/Brushless

The Status LED will indicate which idle behavior mode it is in. See the for more information.

The Status LED will change and indicate which motor type is selected. See the for more information.

Now that the device is wired, and the connections carefully checked, power on the robot. You should see the SPARK MAX slowly blinking its for a new device the color will be Magenta. If the LED is dark, or you see a different blink pattern, refer to the guide for troubleshooting.

Out of the box, the SPARK MAX's Smart Current Limit default setting is 80A for any motor that you use. We recommend utilizing our locked-rotor testing data or the table below to decide what to set your Smart Current Limit to for your robot: Locked-Rotor Testing for the and .

Motor Type
Current Limit Range

If you are unable to spin the motor, visit our .

Operating Mode
Idle Mode
State
Color/Pattern
Graphic
Mode
Color/Pattern
Graphic
Fault
Condition
Color/Pattern
Graphic
455-1164-ND
455-2148-1-ND
SN-2549
455-1162-ND
455-2148-1-ND
SN-2549
Data Port
Data Port
properly wired Power Distribution Panel with breaker
Anderson Power Pole
Getting Started with the REV Hardware Client
Driver Station Log File Viewer
CAN/Power Tab
SPARK MAX APIs
Output current won't always be the same as the Input current
REV Hardware Client
Analog Input
Analog Input
Smart Current Limit
Smart Current Limit
Smart Current Limit
Status LED
NEO (REV-21-1650)
NEO 550 (REV-21-1651)
troubleshooting guide
Status LED Colors and Patterns section
Status LED Colors and Patterns section
Motor Type - Brushed/Brushless Mode
section on Control Interfaces
Idle Behavior
Motor Type

40A - 60A

20A - 40A

Brushed

Brake

No Signal

Blue Blink

Valid Signal

Blue Solid

Coast

No Signal

Yellow Blink

Valid Signal

Yellow Solid

Brushless

Brake

No Signal

Cyan Blink

Valid Signal

Cyan Solid

Coast

No Signal

Magenta Blink

Valid Signal

Magenta Solid

Partial Forward

Green Blink

Full Forward

Green Solid

Partial Reverse

Red Blink

Full Reverse

Red Solid

Forward Limit

Green/White Blink

Reverse Limit

Red/White Blink

Device Identify

White/Magenta Fast Blink

CAN Bootloader Firmware Updating

White/Yellow Blink (v1.5.0) Green/Magenta Blink (v1.4.0)

CAN Bootloader Firmware Retry

White/Blue Blink

USB DFU (Device Firmware Update)

Dark (LED off)

Recovery Mode

Dark (LED off)

12V Missing

The motor will not drive if powered only by USB. This blink code warns the user of this condition.

Orange/Blue Slow Blink

Sensor Fault

This can occur if the sensor type is misconfigured, the sensor cable is not plugged in or damaged, or if a sensor other than the motor sensor is plugged in.

Orange/Magenta Slow Blink

Gate Driver Fault

A fault reported by the core internal electronic circuitry. If this code persists after power cycling the controller, contact REV.

Orange/Cyan Slow Blink

CAN Fault

The CAN fault will be shown after the first time the device is plugged into the CAN port and a fault later occurs. Check your CAN wiring if you see this fault.

Orange/Yellow Slow Blink

Corrupt Firmware (recover using Recovery Mode)

Firmware failed to load.

Dark (LED off)

SPARK MAX Operating Modes

Brushed/Brushless Mode - Motor Type

Brushed or brushless motor types can be configured using the Mode Button, CAN, and USB interfaces.

Mode Button Configuration

Follow the steps below to switch motor types with the Mode Button. It is recommended that the motor be left disconnected until the correct mode is selected.

Use a small screwdriver, straightened paper clip, pen, or other small implement to press the button. Do not use any type of pencil as the pencil lead can break off inside the SPARK MAX.

  1. Connect the SPARK MAX to the main power, not just USB Power.

  2. The Status LED will indicate which motor type is configured by blinking yellow or blue for Brushed Mode or blinking magenta or cyan for Brushless Mode.

  3. Press and hold the Mode Button for approximately 3 seconds.

  4. After the button has been held for enough time, the Status LED will change and indicate the different motor configuration.

  5. Release the mode button.

USB Configuration

  1. Connect the SPARK MAX to your computer using a USB-C cable.

  2. Open the REV Hardware Client and verify that the application is connected to your SPARK MAX.

  3. On the Basic tab, select the appropriate motor type under the Select Motor Type menu.

  4. Click Burn Flash and confirm the change.

CAN Configuration

Brake/Coast Mode - Idle Behavior

When the SPARK MAX is receiving a neutral command the idle behavior of the motor can be handled in two different ways: Braking or Coasting.

When in Brake Mode, the SPARK MAX will effectively short all motor wires together. This quickly dissipates any electrical energy within the motor and brings it to a quick stop.

When in Coast Mode, the SPARK MAX will effectively disconnect all motor wires. This allows the motor to spin down at its own rate.

The Idle Mode can be configured using the Mode Button, CAN, and USB interfaces.

Mode Button Configuration

Follow the steps below to switch the Idle Mode between Brake and Coast with the Mode Button.

Use a small screwdriver, straightened paper clip, pen, or other small implement to press the button. Do not use any type of pencil as the pencil lead can break off inside the SPARK MAX.

  1. Connect the SPARK MAX to main power, not just USB Power.

  2. The Status LED will indicate which Idle Mode is currently configured by blinking blue or cyan for Brake and yellow or magenta for Coast depending on the motor type.

  3. Press and release the Mode Button

  4. You should see the Status LED change to indicate the selected Idle Mode.

USB Configuration

  1. Connect the SPARK MAX to your computer using a USB-C cable.

  2. Open the REV Hardware Client application and verify that the application is connected to your SPARK MAX.

  3. On the Basic tab, select the desired mode with the Idle Mode switch.

  4. Click Burn Flash and confirm the change.

CAN Configuration

SPARK MAX Control Interfaces

PWM Interface

PWM Pulse Mapping

CAN Interface

The SPARK MAX can be connected to a robot CAN network. CAN is a bi-directional communications bus that enables advanced features within the SPARK MAX. SPARK MAX 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 MAX will automatically detect the incoming signal type and respond accordingly. SPARK MAX uses standard CAN frames with an extended ID (29 bits), and utilizes the FRC CAN protocol for defining the bits of the extended ID:

CAN Packet Structure

ExtID [28:24]

ExtID [23:16]

ExtID [15:10]

ExtID [9:6]

ExtID [5:0]

Device Type

Manufacturer

API Class

API Index

Device ID

Periodic Status Frames

The SPARK MAX sends data periodically back to the roboRIO. Frequently accessed data, like motor position and temperature, can be accessed using several APIs. Data is broken up into several CAN "frames" which are sent at a periodic rate. This rate can be changed manually in code, but unlike other parameters, this setting does not persist through a power cycle. The rate can be set anywhere from a minimum 1ms to a maximum 32767ms period. The table below describes each status frame and its available data.

Periodic Status 0 - Default Rate: 10ms

Available Data

Description

Applied **** Output

The actual value sent to the motors from the motor controller. The frame stores this value as a 16-bit signed integer, and is converted to a floating point value between -1 and 1 by the roboRIO SDK. This value is also used by any follower controllers to set their output.

Faults

Each bit represents a different fault on the controller. These fault bits clear automatically when the fault goes away.

Sticky Faults

The same as the Faults field, however the bits do not reset until a power cycle or a 'Clear Faults' command is sent.

Is Follower

A single bit that is true if the controller is configured to follow another controller.

Periodic Status 1 - Default Rate: 20ms

Available Data

Description

Motor Velocity

32-bit IEEE floating-point representation of the motor velocity in RPM using the selected sensor.

Motor Temperature

8-bit unsigned value representing:

Firmware version 1.0.381 - Voltage of the temperature sensor with 0 = 0V and 255 = 3.3V. Current firmware versions - Motor temperature in °C for the NEO Brushless Motor.

Motor Voltage

12-bit fixed-point value that is converted to a floating point voltage value (in Volts) by the roboRIO SDK. This is the input voltage to the controller.

Motor Current

12-bit fixed-point value that is converted to a floating point current value (in Amps) by the roboRIO SDK. This is the raw phase current of the motor.

Periodic Status 2 - Default Rate: 20ms

Available Data

Description

Motor Position

32-bit IEEE floating-point representation of the motor position in rotations.

Periodic Status 3 - Default Rate: 50ms

Available Data

Description

Analog Sensor Voltage

10-bit fixed-point value that is converted to a floating point voltage value (in Volts) by the roboRIO SDK. This is the voltage being output by the analog sensor.

Analog Sensor Velocity

22-bit fixed-point value that is converted to a floating point voltage value (in RPM) by the roboRIO SDK. This is the velocity reported by the analog sensor.

Analog Sensor Position

32-bit IEEE floating-point representation of the velocity in RPM reported by the analog sensor.

Periodic Status 4 - Default Rate: 20ms

Available Data

Description

Alternate Encoder Velocity

32-bit IEEE floating-point representation of the velocity in RPM of the alternate encoder.

Alternate Encoder Position

32-bit IEEE floating-point representation of the position in rotations of the alternate encoder.

Periodic Status 5 - Default Rate: 200ms

Available Data

Description

Duty Cycle Absolute Encoder Position

32-bit IEEE floating-point representation of the position of the duty cycle absolute encoder.

Duty Cycle Absolute Encoder Absolute Angle

16-bit integer representation of the absolute angle of the duty cycle absolute encoder.

Periodic Status 6 - Default Rate: 200ms

Available Data

Description

Duty Cycle Absolute Encoder Velocity

32-bit IEEE floating-point representation of the velocity in RPM of the duty cycle absolute encoder.

Duty Cycle Absolute Encoder Frequency

16-bit unsigned integer representation of the frequency at which the duty cycle signal is being sent.

Use-case Examples

Position Control on the roboRIO

A user wants to implement their own PID loop on the roboRIO to hold a position. They want to run this loop at 100Hz (every 10ms), but the motor position data in Periodic Status 2 is sent at 20Hz (every 50ms).

The user can change this rate to 10ms by calling:

Pseudocode

setPeriodicFrameRate(PeriodicFrame.kStatus2, 10);

High CAN Utilization

A user has many connected CAN devices and wishes to minimize the CAN bus utilization. They do not need any telemetry feedback, and have several follower devices that are only checked for faults.

The user can set the telemetry frame rates low, and set the Periodic Status 0 frame rate low on the follower devices:

Pseudocode

leader.setPeriodicFrameRate(PeriodicFrame.kStatus1, 500); leader.setPeriodicFrameRate(PeriodicFrame.kStatus2, 500); follower.setPeriodicFrameRate(PeriodicFrame.kStatus0, 100); follower.setPeriodicFrameRate(PeriodicFrame.kStatus1, 500); follower.setPeriodicFrameRate(PeriodicFrame.kStatus2, 500);

Faster Follower Bandwidth

The user wants the follower devices to update at a faster rate: 200Hz (every 5ms).

The Periodic Status 0 frame can be increased to achieve this.

Pseudocode

leader.setPeriodicFrameRate(PeriodicFrame.kStatus0, 5);

USB Interface

  • 0b000 - Standard command - CAN ID omitted (DNC)

  • 0b001 - Extended command - USB specific

All commands sent over USB receive a response. In the case that the corresponding CAN command does not receive a response, the USB interface receives an Ack command.

USB Packet Structure

ExtID [31:29]

ExtID [28:24]

ExtID [23:16]

ExtID [15:10]

ExtID [9:6]

ExtID [5:0]

USB Command Type

Device Type (2)

Manufacturer (0x15)

API Class

API Index

Device ID

USB Non-Standard Commands

Command

API Class

API Index

Enter DFU Bootloader (will also disconnect USB interface)

0

1

SPARK MAX Getting Started

The SPARK MAX is a motor controller that can control both Brushed DC and Brushless DC motors. Out of the box, the MAX defaults to its Brushless Mode and is ready to drive a NEO Brushless Motor with its PWM interface. Included in this section are the basic steps to get a motor spinning using the REV Hardware Client as well as information on how to configure your SPARK MAX.

We recommend following this guide in its entirety at least once to understand the key features of the SPARK MAX. This guide can also serve as a fallback in case of any issues faced.

Before You Start

Using Encoders with the SPARK MAX

The SPARK MAX can accept data from encoders through both the Encoder Port and the Data Port on the top of the motor controller. Encoders have a different method of connecting to the SPARK MAX that depends on what motor you are using and what type of encoder it is. When preparing your encoders, be sure to set up your SPARK MAX correctly for the type of devices you are using.

Incremental vs Absolute Encoders

Incremental encoders measure a change in position as a mechanism rotates while absolute encoders will report an exact position at any time, including at startup. A common analogy to help with knowing the difference is that incremental encoders are like a stopwatch that measures a change in time and absolute encoders are like a clock where you can know exactly what time it is.

How to Connect an Encoder

To connect an encoder to your SPARK MAX, start by identifying what type of encoder you are using. Below is a flowchart to help generally identify the method you should use.

Running a brushless motor, like the NEO and NEO 550, without the integrated encoder plugged into the SPARK MAX's Encoder Port can damage your motor.

Absolute Encoders

Absolute encoders will work with the default pinout of the SPARK MAX Data Port if the latest firmware has been installed. When using an absolute or duty cycle encoder it is recommended to use one of the following methods to connect your encoder to the SPARK MAX.

    • Use the Data Port Pinout to match the signals from your encoder

Absolute Encoders are only supported through the SPARK MAX Data Port at this time

Absolute Encoder Wiring Examples

Easily connect a Through Bore Encoder to your SPARK MAX with an Absolute Encoder Adapter and a 6-Pin JST PH Cable.

For encoders that need a custom wiring harness, you can use the following solder pads on a SPARK MAX Data Port Breakout Board with any generic absolute encoder.

Incremental Encoders

If you are using an Incremental Encoder with a brushed motor you can plug your encoder into the SPARK MAX's front Encoder Port directly. If you are driving a NEO or NEO 550 brushless motor with your SPARK MAX, you will need to configure Alternate Encoder Mode to accommodate the additional encoder input from the Data Port. When using an incremental or quadrature encoder it is recommended to use one of the following methods to connect your encoder to the SPARK MAX.

    • With brushed motor: Connect to the Encoder Port

  • Other Incremental Encoder

Incremental Encoder Wiring Examples

Easily connect a Through Bore Encoder to your SPARK MAX with an Alternate Encoder Adapter and a 6-Pin JST PH Cable. When using the Alternate Encoder Adapter make sure the switch is set to "index".

A Through Bore Encoder, or any incremental encoder with the same pinout, can be plugged in directly to the SPARK MAX's Encoder Port.

For encoders that need a custom wiring harness, you can use the following solder pads on a SPARK MAX Data Port Breakout Board with any generic incremental encoder.

Receiving both Incremental and Absolute Encoder Feedback

Receiving both Incremental and Absolute encoder feedback from a single encoder through the SPARK MAX directly is not currently supported. To do this you will need to wire the encoder directly to your roboRIO or robot controller.

Using Limit Switches with an Encoder

Currently, Limit Switch inputs are only supported when using an absolute encoder or an incremental encoder run through the SPARK MAX's Encoder port. Please note, the limit switch inputs cannot be used at the same time as an Alternate Encoder Mode. The limit switch pins are repurposed for the alternate encoder and are thus disabled.

Absolute Encoders

The SPARK MAX does not need to be configured to a specific mode to accept input from an absolute encoder as long as the encoder is connected to the SPARK MAX Data Port.

Absolute Encoder Specifications

Connecting an Absolute Encoder

Data Port Connector Information

NEO ()

NEO 550 ()

Brushed and brushless DC motors require different motor control schemes based on the differences in their technology. It is possible to damage the SPARK MAX, the motor, or both if the appropriate motor type isn't configured properly. At the moment, the and the are the only FRC-legal brushless motors compatible with the SPARK MAX, so choosing the correct operating mode should be straightforward.

Please see the guide for information on how to identify the Motor Type configuration by the color of the Status LED!

Follow the steps below to switch motor types with the USB and the REV Hardware Client application. Be sure to application before continuing.

Please see the for information on how to configure the SPARK MAX using the CAN interface.

Please see the guide for information on how to identify the Idle Behavior configuration by the color of the Status LED!

Follow the steps below to switch the Idle Mode between Brake and Coast with the USB and the REV Hardware Client application. Be sure to application before continuing.

Please see the for information on how to configure the SPARK MAX using the CAN interface.

The SPARK MAX 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 .

The SPARK MAX 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 MAX will automatically detect the incoming signal type and respond accordingly. For details on how to connect a PWM cable to the SPARK MAX, see .

The SPARK MAX 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 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 60ms window, the SPARK MAX 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 .

Each device on the CAN bus must be assigned a unique CAN ID number. Out of the box, SPARK MAX is assigned a device ID of 0. It is highly recommended to change all SPARK MAX CAN IDs from 0 to any unused ID from 1 to 62. CAN IDs can be changed by connecting the SPARK MAX to a Windows computer and using the . For details on other SPARK MAX configuration parameters, see .

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

The SPARK MAX can be configured and controlled through a USB connection to a computer running the . The USB interface utilizes a standard CDC (USB to Serial) driver. The command interface is similar to CAN, using the same ID and data structure, but always sends and receives a full 12-byte packet. The CAN ID is omitted (DNC) when talking directly to the device. However, the three MSB of the ID allow selection of alternate commands:

Before following this guide, the before continuing. The client is the best way to verify that the device is configured correctly, and is required before using the CAN interface.

With Versions 1.6.0 and newer, absolute encoders are compatible with the SPARK MAX Data Port.

Check out our documentation of the

: Connect with

Other Absolute Encoder: Connect with

Check out our documentation of the

or Internal Encoder: MUST be connected to the SPARK MAX Encoder Port

With brushless motor: Connect with . You will need to configure Alternate Encoder Mode.

With a brushless motor: Connect the encoder with . Use the Alternate Encoder Mode Data Port Pinout to match the signals from your encoder. You will need to configure Alternate Encoder Mode.

With brushed motor: Connect to the Encoder Port with a using the Encoder Port pinout

With a brushed motor: Connect the encoder with or a similar custom cable. Use the Data Port Pinout to match the signals from your encoder.

Parameter
Specification

Absolute encoder input is supported by Version 1.6.0 and newer,

Connecting an absolute encoder that is not a Through Bore Encoder will likely require a custom wiring harness or to connect the necessary encoder power, ground, and signals to the SPARK MAX Data Port. When using an Absolute Encoder use the following pinout information for the Data Port:

REV-21-1650
REV-21-1651
NEO Brushless Motor
NEO 550 Brushless Motor
Status LED Patterns
download and install the REV Hardware Client
API Information
Status LED Patterns
download and install the REV Hardware Client
API Information
Control Connections
REV Hardware Client
Idle Mode - Brake/Coast Mode
REV Hardware Client
Configuration Parameters
SPARK MAX API Information
REV Hardware Client
CAN/PWM Port

Encoder Output Voltage Level

5.0V

Encoder Type Supported

Duty Cycle or PWM

Connector Pin

Pin Type

Pin Function

1

Power

+3.3V

2

Power

+5V

3

Analog

Analog Input

4

Digital

Forward Limit Switch Input

5

Digital

Encoder B

6

Digital

Absolute/PWM Input

7

Digital

Encoder A

8

Digital

Reverse Limit Switch Input

9

Digital

Encoder C / Index

10

Ground

Ground

SPARK MAX Configuration Parameters

Below is a list of all the configurable parameters within the SPARK MAX. Parameters can be set through the CAN or USB interfaces. The parameters are saved in a different region of memory from the device firmware and persist through a firmware update.

Name

ID

Type

Default

Description

kCanID

0

uint

0

CAN ID This parameter persists through a normal firmware update.

kInputMode

1

Input Mode

0

Input mode, this parameter is read only and the input mode is detected by the firmware automatically. 0 - PWM 1 - CAN 2 - USB

kMotorType

2

Motor Type

BRUSHLESS

Motor type: 0 - Brushed 1 - Brushless This parameter persists through a normal firmware update.

Reserved

3

-

Reserved

kSensorType

4

Sensor Type

HALL_EFFECT

Sensor type: 0 - No Sensor 1 - Hall Sensor 2 - Encoder This parameter persists through a normal firmware update.

kCtrlType

5

Ctrl Type

CTRL_DUTY_CYCLE

Control Type, this is a read only parameter of the currently active control type. The control type is changed by calling the correct API. 0 - Duty Cycle 1 - Velocity 2 - Voltage 3 - Position

kIdleMode

6

Idle Mode

IDLE_COAST

State of the half bridge when the motor controller commands zero output or is disabled. 0 - Coast 1 - Brake This parameter persists through a normal firmware update.

kInputDeadband

7

float32

%0.05

Percent of the input which results in zero output for PWM mode. This parameter persists through a normal firmware update.

Reserved

8

-

-

Reserved

Reserved

9

-

-

Reserved

kPolePairs

10

uint

7

Number of pole pairs for the brushless motor. This is the number of poles/2 and can be determined by either counting the number of magnets or counting the number of windings and dividing by 3. This is an important term for speed regulation to properly calculate the speed.

kCurrentChop

11

float32

115/Amps

If the half bridge detects this current limit, it will disable the motor driver for a fixed amount of time set by kCurrentChopCycles. This is a low sophistication 'current control'. Set to 0 to disable. The max value is 125.

kCurrentChopCycles

12

uint

0

Number of PWM Cycles for the h-bridge to be off in the case that the current limit is set. Min = 1, multiples of PWM period (50μs). During this time the current will be recirculating through the low side MOSFETs, so instead of 'freewheeling' the diodes, the bridge will be in brake mode during this time.

kP_0

13

float32

0

Proportional gain constant for gain slot 0.

kI_0

14

float32

0

Integral gain constant for gain slot 0.

kD_0

15

float32

0

Derivative gain constant for gain slot 0.

kF_0

16

float32

0

Feed Forward gain constant for gain slot 0.

kIZone_0

17

float32

0

Integrator zone constant for gain slot 0. The PIDF loop integrator will only accumulate while the setpoint is within IZone of the target.

kDFilter_0

18

float32

0

PIDF derivative filter constant for gain slot 0.

kOutputMin_0

19

float32

-1

Max output constant for gain slot 0. This is the max output of the controller.

kOutputMax_0

20

float32

1

Min output constant for gain slot 0. This is the min output of the controller.

kP_1

21

float32

0

Proportional gain constant for gain slot 1.

kI_1

22

float32

0

Integral gain constant for gain slot 1.

kD_1

23

float32

0

Derivative gain constant for gain slot 1.

kF_1

24

float32

0

Feed Forward gain constant for gain slot 1.

kIZone_1

25

float32

0

Integrator zone constant for gain slot 1. The PIDF loop integrator will only accumulate while the setpoint is within IZone of the target.

kDFilter_1

26

float32

0

PIDF derivative filter constant for gain slot 1.

kOutputMin_1

27

float32

-1

Max output constant for gain slot 1. This is the max output of the controller.

kOutputMax_1

28

float32

1

Min output constant for gain slot 1. This is the min output of the controller.

kP_2

29

float32

0

Proportional gain constant for gain slot 2.

kI_2

30

float32

0

Integral gain constant for gain slot 2.

kD_2

31

float32

0

Derivative gain constant for gain slot 2.

kF_2

32

float32

0

Feed Forward gain constant for gain slot 2.

kIZone_2

33

float32

0

Integrator zone constant for gain slot 2. The PIDF loop integrator will only accumulate while the setpoint is within IZone of the target.

kDFilter_2

34

float32

0

PIDF derivative filter constant for gain slot 2.

kOutputMin_2

35

float32

-1

Max output constant for gain slot 2. This is the max output of the controller.

kOutputMax_2

36

float32

1

Min output constant for gain slot 2. This is the min output of the controller.

kP_3

37

float32

0

Proportional gain constant for gain slot 3.

kI_3

38

float32

0

Integral gain constant for gain slot 3.

kD_3

39

float32

0

Derivative gain constant for gain slot 3.

kF_3

40

float32

0

Feed Forward gain constant for gain slot 3.

kIZone_3

41

float32

0

Integrator zone constant for gain slot 3. The PIDF loop integrator will only accumulate while the setpoint is within IZone of the target.

kDFilter_3

42

float32

0

PIDF derivative filter constant for gain slot 3.

kOutputMin_3

43

float32

-1

Max output constant for gain slot 3. This is the max output of the controller.

kOutputMax_3

44

float32

1

Min output constant for gain slot 3. This is the min output of the controller.

Reserved

45

-

-

Reserved

Reserved

46

-

-

Reserved

Reserved

47

-

-

Reserved

Reserved

48

-

-

Reserved

Reserved

49

-

-

Reserved

kLimitSwitchFwdPolarity

50

bool

0

Forward Limit Switch polarity. 0 - Normally Open 1 - Normally Closed

kLimitSwitchRevPolarity

51

bool

0

Reverse Limit Switch polarity. 0 - Normally Open 1 - Normally Closed

kHardLimitFwdEn

52

bool

1

Limit switch enable, enabled by default

kHardLimitRevEn

53

bool

1

Limit switch enable, enabled by default

Reserved

54

-

-

Reserved

Reserved

55

-

-

Reserved

kRampRate

56

float32

V/s 0

Voltage ramp rate active for all control modes in % output per second, a value of 0 disables this feature. All APIs take the reciprocal to make the unit 'time from 0 to full'.

kFollowerID

57

uint

0

CAN EXTID of the message with data to follow

kFollowerConfig

58

uint

0

Special configuration register for setting up to follow on a repeating message (follower mode). CFG[0] to CFG[3] where CFG[0] is the motor output start bit (LSB), CFG[1] is the motor output stop bit (MSB). CFG[0] - CFG[1] determines endianness. CFG[2] bits determine sign mode and inverted, CFG[3] sets a preconfigured controller (0x1A = REV, 0x1B = Talon/Victor style as of 2018 season)

kSmartCurrentStallLimit

59

uint

80A

Smart Current Limit at stall, or any RPM less than kSmartCurrentConfig RPM.

kSmartCurrentFreeLimit

60

uint

20A

Smart current limit at free speed

kSmartCurrentConfig

61

uint

10000

Smart current limit RPM value to start linear reduction of current limit. Set this > free speed to disable.

Reserved

62

-

-

Reserved

Reserved

63

-

-

Reserved

Reserved

64

-

-

Reserved

Reserved

65

-

-

Reserved

Reserved

66

-

-

Reserved

Reserved

67

-

-

Reserved

Reserved

68

-

-

Reserved

kEncoderCountsPerRev

69

uint

4096

Number of encoder counts in a single revolution, counting every edge on the A and B lines of a quadrature encoder. (Note: This is different than the CPR spec of the encoder which is 'Cycles per revolution'. This value is 4 * CPR.

kEncoderAverageDepth

70

uint

64

Number of samples to average for velocity data based on quadrature encoder input. This value can be between 1 and 64.

kEncoderSampleDelta

71

uint

200 per 500us

Delta time value for encoder velocity measurement in 500μs increments. The velocity calculation will take delta the current sample, and the sample x * 500μs behind, and divide by this the sample delta time. Can be any number between 1 and 255

Reserved

72

-

-

Reserved

Reserved

73

-

-

Reserved

Reserved

74

-

-

Reserved

kCompensatedNominalVoltage

75

float32

0 V

In voltage compensation mode mode, this is the max scaled voltage.

kSmartMotionMaxVelocity_0

76

float32

0

kSmartMotionMaxAccel_0

77

float32

0

kSmartMotionMinVelOutput_0

78

float32

0

kSmartMotionAllowedClosedLoopError_0

79

float32

0

kSmartMotionAccelStrategy_0

80

float32

0

kSmartMotionMaxVelocity_1

81

float32

0

kSmartMotionMaxAccel_1

82

float32

0

kSmartMotionMinVelOutput_1

83

float32

0

kSmartMotionAllowedClosedLoopError_1

84

float32

0

kSmartMotionAccelStrategy_1

85

float32

0

kSmartMotionMaxVelocity_2

86

float32

0

kSmartMotionMaxAccel_2

87

float32

0

kSmartMotionMinVelOutput_2

88

float32

0

kSmartMotionAllowedClosedLoopError_2

89

float32

0

kSmartMotionAccelStrategy_2

90

float32

0

kSmartMotionMaxVelocity_3

91

float32

0

kSmartMotionMaxAccel_3

92

float32

0

kSmartMotionMinVelOutput_3

93

float32

0

kSmartMotionAllowedClosedLoopError_3

94

float32

0

kSmartMotionAccelStrategy_3

95

float32

0

kIMaxAccum_0

96

float32

0

kSlot3Placeholder1_0

97

float32

0

kSlot3Placeholder2_0

98

float32

0

kSlot3Placeholder3_0

99

float32

0

kIMaxAccum_1

100

float32

0

kSlot3Placeholder1_1

101

float32

0

kSlot3Placeholder2_1

102

float32

0

kSlot3Placeholder3_1

103

float32

0

kIMaxAccum_2

104

float32

0

kSlot3Placeholder1_2

105

float32

0

kSlot3Placeholder2_2

106

float32

0

kSlot3Placeholder3_2

107

float32

0

kIMaxAccum_3

108

float32

0

kSlot3Placeholder1_3

109

float32

0

kSlot3Placeholder2_3

110

float32

0

kSlot3Placeholder3_3

111

float32

0

kPositionConversionFactor

112

float32

1

kVelocityConversionFactor

113

float32

1

kClosedLoopRampRate

114

float32

0 DC/sec

kSoftLimitFwd

115

float32

0

Soft limit forward value

kSoftLimitRev

116

float32

0

Soft limit reverse value

Reserved

117

-

-

Reserved

Reserved

118

-

-

Reserved

kAnalogPositionConversion

119

float32

1 rev/volt

Conversion factor for position from analog sensor. This value is multiplied by the voltage to give an output value.

kAnalogVelocityConversion

120

float32

1 vel/v/s

Conversion factor for velocity from analog sensor. This value is multiplied by the voltage to give an output value.

kAnalogAverageDepth

121

uint

0

Number of samples in moving average of velocity.

kAnalogSensorMode

122

uint

0

0 Absolute: In this mode the sensor position is always read as voltage * conversion factor and reads the absolute position of the sensor. In this mode setPosition() does not have an effect. 1 Relative: In this mode the voltage difference is summed to calculate a relative position.

kAnalogInverted

123

bool

0

When inverted, the voltage is calculated as (ADC Full Scale - ADC Reading). This means that for absolute mode, the sensor value is 3.3V - voltage. In relative mode the direction is reversed.

kAnalogSampleDelta

124

uint

0

Delta time between samples for velocity measurement

Reserved

125

-

-

Reserved

Reserved

126

-

-

Reserved

kDataPortConfig

127

uint

0

0: Default configuration using limit switches 1: Alternate Encoder Mode - limit switches are disabled and alternate encoder is enabled. This parameter persists through a normal firmware update.

kAltEncoderCountsPerRev

128

uint

4096

Number of encoder counts in a single revolution, counting every edge on the A and B lines of a quadrature encoder. (Note: This is different than the CPR spec of the encoder which is 'Cycles per revolution'. This value is 4 * CPR.

kAltEncoderAverageDepth

129

uint

64

Number of samples to average for velocity data based on quadrature encoder input. This value can be between 1 and 64.

kAltEncoderSampleDelta

130

uint

200

Delta time value for encoder velocity measurement in 500μs increments. The velocity calculation will take delta the current sample, and the sample x * 500μs behind, and divide by this the sample delta time. Can be any number between 1 and 255.

kAltEncoderInverted

131

bool

0

Invert the phase of the encoder sensor. This is useful when the motor direction is opposite of the motor direction.

kAltEncoderPositionFactor

132

float32

1

Value multiplied by the native units (rotations) of the encoder for position.

kAltEncoderVelocityFactor

133

float32

1

Value multiplied by the native units (rotations) of the encoder for velocity.

REV Hardware Client should be installed
SPARK MAX Firmware
Through Bore Encoder.
Through Bore Encoder (REV-11-1271)
Absolute Encoder Adapter (REV-11-3326)
SPARK MAX Data Port Breakout Board (REV-11-1278)
Through Bore Encoder.
NEO
NEO 550
Through Bore Encoder (REV-11-1271)
Alternate Encoder Adapter (REV-11-1881)
SPARK MAX Data Port Breakout Board (REV-11-1278)
6-Pin JST Breakout Board (REV-11-1276)
SPARK MAX Data Port Breakout Board (REV-11-1278)
SPARK MAX Firmware
SPARK MAX Data Port Breakout Board

Securing the Encoder Adapters

The Encoder Adapters and SPARK MAX Data Port Breakout Boards can be secured to a SPARK MAX in two ways.

Description
Image

1) To use a SPARK MAX Mounting Bracket to secure your Encoder Adapter or Breakout Board you will need to remove the middle tab of plastic

2) Cut this piece of plastic with a pair of snips, or remove it by twisting the plastic until it breaks

3) Once the middle piece of plastic has been removed, remove any sharp edges with a file or some sandpaper

4) The SPARK MAX Mounting Bracket will fit over the board as shown in this image. Attach the mounting bracket to your surface as you normally would after this step

Zip-tie Notches

A zip-tie can be secured around the SPARK MAX's zip-tie notches and over the board to securely attach it to the motor controller as well.

Alternate Encoder Mode

The SPARK MAX can be configured to run in Alternate Encoder Mode, which reconfigures the Data Port on the top of the controller to accept an alternative quadrature encoder, separate from the default encoder inputs shared between the front Encoder Port and the default quadrature encoder Data Port pins. Analog input is not affected by Alternate Encoder Mode.

This feature is designed for use in low-RPM mechanisms such as drivetrains, arms, and other manipulators. For high RPM applications, it is recommended to use the built-in motor sensor for brushless motors or the default encoder inputs for brushed motors.

Alternate Encoder Specifications

Parameter
Specification

Encoder Output Voltage Level

3.3V or 5.0V

Encoder Type Supported

Quadrature†

Maximum Counts per Second

165000

†

Index pulses are not currently supported

Before connecting a sensor with 5V output, the SPARK MAX must first be updated to firmware version 1.5.0 or later, or damage may occur. This can be done through the REV Hardware Client.

Maximum RPM with Common Quadrature Encoders

Encoder

Counts per Revolution

Max RPM

8192

1200

CTRE SRX Mag Encoder

4096

2400

Greyhill 63R256

1024

9600

Connecting an Alternate Encoder

Connecting an alternate encoder will likely require a custom wiring harness to connect the necessary encoder power, ground, and signals to the reconfigured Data Port. When configured in Alternate Encoder Mode, the Data Port has the following pinout:

Data Port Pinout in Alternate Encoder Mode

Connector Pin

Pin Type

Pin Function

1

Power

+3.3V

2

Power

+5V

3

Analog

Analog Input

4

Digital

Alternate Encoder Index†

5

Digital

Encoder B

6

Digital

Alternate Encoder A

7

Digital

Encoder A

8

Digital

Alternate Encoder B

9

Digital

Encoder C / Index

10

Ground

Ground

†

The Alternate Encoder Index pin is reserved but not currently supported

Alternate Encoder Pin-mapping for SPARK MAX Data Port Breakout Board

Breakout Board Pad Label

Alternate Encoder Function

Limit - F

Index†

P6 (P5 in older batches)

A

Limit - R

B

3.3V or 5.0V

Encoder Power

GND

Encoder Ground

†

The Alternate Encoder Index pin is reserved but not currently supported

Configuring and Using the Alternate Encoder Mode

Below you will find the steps required to set up and use the Alternate Encoder Mode on the SPARK MAX, starting with configuration through either the REV Hardware Client or the SPARK MAX APIs.

Configuration Using the REV Hardware Client

Using the REV Hardware Client, select your SPARK MAX, then navigate to the Advanced Tab and scroll to the Alternate Encoder parameter section. Enable the alternate encoder by setting the kDataPortConfig parameter to 'Alternate Encoder' via the drop down menu. You can also set the other Alternate Encoder parameters at this time.

Configuring Using the SPARK MAX APIs

If using the SPARK MAX APIs, the Alternate Encoder is automatically configured when the Alternate Encoder object is instantiated. An Alternate Encoder is created the same as a CANEncoder, either by directly using the constructor or calling GetAlternateEncoder() on a previously constructed CANSparkMax.

static constexpr int kCanId = 1;
static constexpr auto kMotorType = rev::CANSparkMax::MotorType::kBrushless;
static constexpr auto kAltEncType = rev::CANEncoder::AlternateEncoderType::kQuadrature;
static constexpr int kCPR = 8192;

// initialize SPARK MAX with CAN ID
rev::CANSparkMax m_motor{kCanID, kMotorType};

/**
* An alternate encoder object is constructed using the GetAlternateEncoder()
* method on an existing CANSparkMax object. If using a REV Through Bore
* Encoder, the type should be set to quadrature and the counts per
* revolution set to 8192
*/
rev::CANEncoder m_alternateEncoder = m_motor.GetAlternateEncoder(kAltEncType, kCPR);

Currently, quadrature is the only available type of configuration for an alternate encoder. This is differentiated from the other types of encoder configurations available for an encoder connected through the front facing Encoder Port on the SPARK MAX.

Configuration Conflicts

Since the alternate encoder inputs and the default digital inputs are shared on the Data Port, the user cannot use both the alternate encoder and a digital inputs in code. Therefore, a std::invalid_argument (C++), IllegalArgumentException (Java), or an Error on the Error Out terminal (LabVIEW) will be thrown if a user tries to construct both types objects in code simultaneously.

Closed-Loop Control

The alternate encoder can be used with the different closed-loop control modes available on the SPARK MAX. The feedback device used by a CANPIDController must be set to use the alternate encoder through SetFeedbackDevice().

/**
* By default, the PID controller will use the Hall sensor from a NEO or NEO 550 for
* its feedback device. Instead, we can set the feedback device to the alternate
* encoder object
*/
m_pidController.SetFeedbackDevice(m_alternateEncoder);

Initial Bring-up

Unlike the built-in sensor on the NEO Brushless motors, the 'phase' of the alternate encoder is unknown to the SPARK MAX. Before enabling any closed-loop control, it is critical that the phase is configured correctly. To verify:

  1. Configure and connect the sensor as a quadrature alternate encoder, but do not run a closed-loop mode.

  2. Plot the output signal of the motor using GetAppliedOutput() and the output of the encoder using altEncoder.GetVelocity(). Confirm that the sensor is behaving as expected. This can be done on the SmartDashboard: frc::SmartDashboard::PutNumber("Alt Encoder Velocity", m_alternateEncoder.GetVelocity()); frc::SmartDashboard::PutNumber("Applied Output", m_motor.GetAppliedOutput());

  3. Verify that the sign of the sensor is correct relative to the motor direction when driving it forward and backward. If it is not, the sensor must be inverted by calling altEncoder.SetInverted(true).

Closed-Loop Control Overview

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

Closed-Loop Control Basics

A Closed-Loop Control System in its most basic form is a process that uses feedback to improve the accuracy of its outputs. Closed-Loop Control Systems, sometimes referred to as Feedback Controllers, are frequently used when maintaining or reaching a steady output is important or if the system may have outside influences that could affect the system's output.

A simple example using this type of Control is an automatic coffee maker. In its Closed-Loop Control System, the output is hot coffee and the process we are getting feedback on is the heating of the water. If the coffee maker receives feedback that the water is cold, it will start to heat the pot. When the water is almost hot enough to brew the coffee, the control algorithm will continue to heat the water until the correct goal temperature has been reached. Once the water reaches it's goal temperature, or if it gets too hot, the system will stop heating the water and wait until it receives feedback that the heater needs to begin again.

Closed-Loop Control with SPARK Motor Controllers

With a PID loop onboard a SPARK Motor Controller, the setup is simple, doesn't clutter your code, and the loop is updated every 10ms, doubling the responsiveness and precision of the controller. Even when using a more complex controller on the roboRIO, it's still recommended to put as much processing on the motor controller as possible.

Both the SPARK MAX and SPARK Flex can operate in several closed-loop control modes, using sensor input to tightly control the motor velocity, position or current. The internal control loop follows a standard PID algorithm with a feed-forward (F) term to compensate for known system offsets. This allows the motor to follow precise and repeatable motions, useful for complex mechanisms.

Below is a diagram of the firmware implementation of the internal PIDF.


Calibration for MAXSwerve

Calibration Steps

  1. Connect the Steering Motor’s (NEO 550) SPARK MAX directly to your computer via the included USB-C to USB-A cable

  2. Select the Steering SPARK MAX and navigate to the Update Tab to verify your SPARK MAX has the latest SPARK MAX Firmware (the latest version may be different than what is shown in the image below)

  1. Select The Steering SPARK MAX in the sidebar, and select the AbsoluteEncoder Tab

Steps 6-9 are also included in the REV Hardware Client AbsoluteEncoder Tab under the “MAXSwerve Module Calibration” drop-down shown below

  1. Put the Calibration Tool on the MAXSwerve module.

    • The Calibration Tool needs to be placed on the MAXSwerve module with the lip facing the module.

    • The MAXSwerve Wheel will only fit in one orientation because of the placement of the wheel's bevel gear. The Calibration tool is not symmetrical, so you will need to align the bevel gear with the side of the cutout indicated with the orange dot in this image.

  1. Rotate the wheel along with the Calibration Tool until the tool's lip firmly drops into place around the MAXSwerve module's edges. Once this happens, the wheel and Calibration Tool will be unable to rotate freely until the tool's lip has been lifted above the edges of the module.

  2. Ensure that the Direction parameter is set to Inverted in the Duty Cycle Absolute Encoder Settings section above.

  3. Click the Set Zero Offset button to calibrate the zero-position of the absolute encoder to this position.

What's Next?

Start driving your MAXSwerve Modules by loading our code templates onto your robot!

REVLib Overview

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

Below you will find information on how to download and install REVLib for LabVIEW, Java, and C++.

Downloads and Installation Instructions

LabVIEW Installation

  1. Download the latest REVLib LabVIEW package from the download link above.

  2. Make sure LabVIEW for FRC 2024 is installed and updated.

  3. Open the REVLib LabVIEW Package. The NI Package Manager should automatically open.

  4. Click Next:

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

C++ and Java Installation

Online Installation

You can use the online method to install REVLib C++/Java 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:

Offline Installation

  1. Download and unzip the latest REVLib into the C:\Users\Public\wpilib\2024 directory on Windows and ~/wpilib/2024 directory on Unix-like systems.

Java API Documentation

For a list and description of all classes:

C++ API Documentation

For a list and description of all classes:

Closed Loop Control Getting Started

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

Setting up Closed-Loop Control

Closed-loop control in REVLib is accessed through the SPARK's PID Controller object. This object is specific to each motor and tracks the PID gains and closed-loop constants. It also contains all the methods needed to configure and control your motor. It can be accessed as shown below:

To drive your motor in a Closed-Loop control mode, address the PID Controller object and give it a set point (a target in whatever units are required by your control mode: , , or ) and a control mode as shown below:

The provided example above runs the motor in position control mode, which is just a conventional PID loop reading the motor's current position from the configured encoder and taking a setpoint in rotations.

Use caution when running motors in Closed-Loop modes, as they may move very quickly and unexpectedly if improperly tuned.

PID Constants and Configuration

To run a PID loop, several constants are required. For a more advanced controller, even more parameters need set and tuned.

Slots

The SPARK MAX and SPARK Flex each have 4 closed-loop slots, each with their own set of constants. These slots are numbered 0-3. You can pass the slot number as an argument to each of the parameter setting methods. When applying the setpoint, pass the slot number and the motor controller will switch to the appropriate config.

PID Parameters

These gains can be configured on the SparkPIDController object as shown below:

F Parameter

The SPARK family of motor controllers also offer an F term, which is a velocity feed-forward. This is unique to each type of motor, and can be calculated by taking the reciprocal of the motor's velocity constant (Kv), in other words 1/Kv.

For a NEO Vortex, this value is 1/565. This is only needed when running a velocity-based control loop (velocity mode, Smart Motion, and Smart Velocity). The F parameter can be set as seen below:

The F parameter should only be set when using a velocity-based PID controller, and should be set to zero otherwise to avoid unwanted behavior.

Smart Motion Parameters

There are another set of parameters available for the SparkPIDController, which only apply to Smart Motion and Smart Velocity. These allow you to configure and tune the motion profiles generated by Smart Motion. They can be set as seen below:

Maximum Velocity is in units of Revolutions per Minute (RPM)

Maximum Acceleration is in units of RPM per Second (RPM/s)

These parameters have no effect on modes other than Smart Motion and Smart Velocity

Migrating to REVLib 2025

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

Only SPARK MAX and SPARK Flex are affected by the REVLib 2025 release. Color Sensor V3 is unaffected.

Summary

The 2025 version of REVLib introduced a series of breaking changes from the previous year. These changes include:

  • An overhauled configuration system

  • Updated import paths

  • Renamed classes

Below shows how to migrate certain common tasks from previous versions of REVLib to the 2025 release.

Including the library and creating a SPARK object

In the 2025 version, all SPARK related classes moved to a spark package in Java and a spark namespace in C++.

In addition, some of the classes were renamed:

  • CANSparkMax is now SparkMax

  • CANSparkFlex is now SparkFlex

  • CANSparkLowLevel is now SparkLowLevel

  • SparkPIDController is now SparkClosedLoopController

Before

After

Before

After

Configuring a SPARK

Instead of imperatively configuring parameters of the SPARK by calling methods directly on it and its auxiliary objects (sensors, closed loop controller, etc.), configuration parameters are set in a more declarative way through configuration objects and applying that configuration to the SPARK.

A more complete guide on the new configuration system will soon be available.

For simplicity, only an example for SPARK MAX is provided. The following will still be valid for a SPARK Flex object.

Before

After

Before

After

Retrieving a configuration parameter from a SPARK

With the new configuration system, parameter getters moved to a configAccessor field in the SparkMax and SparkFlex.

For simplicity, only an example for SPARK MAX is provided. The following will still be valid for a SPARK Flex object.

Before

After

Before

After

Setting status periods

Previously, setting status periods required the user to know which periodic status frame a signal belonged to. Now, status signals' periods can be individually configured, and REVLib will handle figuring out which status frame to adjust.

These values can be configured through the new configuration system.

For simplicity, only an example for SPARK MAX is provided. The following will still be valid for a SPARK Flex object.

Before

After

Before

After

SPARK MAX Mounting Bracket ()

When configured for Alternate Encoder Mode, a quadrature encoder connected to the reconfigured Data Port pins can be used as a feedback device by the SPARK MAX. Please note, the limit switch inputs cannot be used at the same time as an alternate encoder. The limit switch pins are repurposed for the alternate encoder and are thus disabled. Please see for for more information.

Use an Alternate Encoder Adapter () to connect a directly to the SPARK MAX Data Port. This adapter has a JST PH 6-pin connector that is compatible with the Through Bore Encoder's pinout and a selection switch to change the signal that is connect to pin 4 of the data port.

Check out our documentation of the

Another option is the . This board can be used to wire an alternate encoder to the Data Port. The following table describes which pads on the breakout should be used for which signals coming from the alternate encoder.

Documentation for REVLib 2025 can now be found at:

Closed-Loop Control is a staple of complex FRC mechanism programming. WPILib offers to allow teams to run PID loops on the roboRIO, but they require setup in your team's code and can only update every 20ms.

Additionally, an arbitrary feedforward signal is added to the output of the control loop after all calculations are done. The units for this signal can be selected as either voltage or duty cycle. This feature allows more advanced feedforward calculations to be performed by the controller. More details about the types of feedforward calculations can be found on the . Using the voltage units for arbitrary feedforward allows the user to send the calculated feedforward voltage from the WPILib API directly to the control loop.

Before using the MAXSwerve Java or C++ Templates, be sure to calibrate your swerve modules using the by following the steps below:

Verify you have completely assembled your and have the Steering Motor’s (NEO 550) SPARK MAX connected to the MAXSwerve’s Through Bore Encoder with an Absolute Encoder Adapter.

onto a Windows computer

Documentation for REVLib 2025 can now be found at:

Language
Current REVLib Version
Documentation

Follow the WPILib instructions for .

Documentation for REVLib 2025 can now be found at:

API Docs: ,

API Docs: ,

This will run your motor in the provided mode, but it won't move until you've configured the

API Docs: ,

API Docs: ,

A PID controller has 3 core parameters or gains. For more information on these gains and how to tune them, see .

API Docs:

API Docs:

The Kv values for the NEO family of Brushless Motors are documented within each motor's specifications table: , ,

API Docs:

API Docs:

API Docs:

API Docs:

Documentation for REVLib 2025 can now be found at:

For a more complete changelog, please see our on GitHub.

REV-45-2468
REV-11-1881
REV Through Bore Encoder
Through Bore Encoder.
SPARK MAX Data Port Breakout Board
Connecting an Alternate Encoder
// Set the P value of the PID controller on slot 0 to 0.25
m_pidController.SetP(kP);
m_pidController.SetI(kI);
m_pidController.SetD(kD);
m_pidController.SetIZone(kIz);

// Set the minimum and maximum outputs of the motor [-1, 1]
m_pidController.SetOutputRange(kMinOutput, kMaxOutput);
// Set the P value of the PID controller on slot 0 to 0.25
m_pidController.SetP(kP);
m_pidController.SetI(kI);
m_pidController.SetD(kD);
m_pidController.SetIZone(kIz);

// Set the minimum and maximum outputs of the motor [-1, 1]
m_pidController.SetOutputRange(kMinOutput, kMaxOutput);
// Set kFF
m_pidController.SetFF(1/Kv);
// Set kFF
m_pidController.SetFF(1/Kv);
// Set Smart Motion / Smart Velocity parameters
int smartMotionSlot = 0;
m_pidController.setSmartMotionMaxVelocity(maxVel, smartMotionSlot);
m_pidController.setSmartMotionMinOutputVelocity(minVel, smartMotionSlot);
m_pidController.setSmartMotionMaxAccel(maxAcc, smartMotionSlot);
m_pidController.setSmartMotionAllowedClosedLoopError(allowedErr, smartMotionSlot);
// Set Smart Motion / Smart Velocity parameters
m_pidController.SetSmartMotionMaxVelocity(maxVel);
m_pidController.SetSmartMotionMinOutputVelocity(minVel);
m_pidController.SetSmartMotionMaxAccel(maxAcc);
m_pidController.SetSmartMotionAllowedClosedLoopError(allowedErr);
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkFlex;
import com.revrobotics.CANSparkLowLevel.MotorType;
import com.revrobotics.SparkPIDController;

CANSparkMax max = new CANSparkMax(1, MotorType.kBrushless);
CANSparkFlex flex = new CANSparkFlex(2, MotorType.kBrushless);
SparkPIDController maxPid = max.getPIDController();
import com.revrobotics.spark.SparkMax;
import com.revrobotics.spark.SparkFlex;
import com.revrobotics.spark.SparkLowLevel.MotorType;
import com.revrobotics.spark.SparkClosedLoopController;

SparkMax max = new SparkMax(1, MotorType.kBrushless);
SparkFlex flex = new SparkFlex(2, MotorType.kBrushless);
SparkClosedLoopController maxPid = max.getClosedLoopController();
#include <rev/CANSparkMax.h>
#include <rev/CANSparkFlex.h>

using namespace rev;

CANSparkMax m_max{1, CANSparkMax::MotorType::kBrushless};
CANSparkFlex m_flex{2, CANSparkFlex::MotorType::kBrushless};
SparkPIDController m_maxPid = m_max.GetPIDController();
#include <rev/SparkMax.h>
#include <rev/SparkFlex.h>

using namespace rev::spark;

SparkMax m_max{1, SparkMax::MotorType::kBrushless};
SparkFlex m_flex{2, SparkFlex::MotorType::kBrushless};
SparkClosedLoopController m_maxPid = m_max.GetClosedLoopController();
CANSparkMax max = new CANSparkMax(1, MotorType.kBrushless);
RelativeEncoder enc = max.getEncoder();
SparkPIDController pid = max.getPIDController();

max.restoreFactoryDefaults();

max.setInverted(true);
max.setIdleMode(IdleMode.kBrake);
enc.setPositionConversionFactor(1000);
enc.setVelocityConversionFactor(1000);
pid.setFeedbackDevice(enc);
pid.setP(1.0);
pid.setI(0.0);
pid.setD(0.0);

max.burnFlash();
SparkMax max = new SparkMax(1, MotorType.kBrushless);
SparkMaxConfig config = new SparkMaxConfig();

config
    .inverted(true)
    .idleMode(IdleMode.kBrake);
config.encoder
    .positionConversionFactor(1000)
    .velocityConversionFactor(1000);
config.closedLoop
    .feedbackSensor(FeedbackSensor.kPrimaryEncoder)
    .pid(1.0, 0.0, 0.0);
    
max.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
using namespace rev;

CANSparkMax m_max{1, MotorType.kBrushless};
SparkRelativeEncoder m_enc = m_max.GetEncoder();
SparkPIDController m_pid = m_max.GetPIDController();

m_max.RestoreFactoryDefaults();

m_max.SetInverted(true);
m_max.SetIdleMode(IdleMode.kBrake);
m_enc.SetPositionConversionFactor(1000);
m_enc.SetVelocityConversionFactor(1000);
m_pid.SetFeedbackDevice(enc);
m_pid.SetP(1.0);
m_pid.SetI(0.0);
m_pid.SetD(0.0);

m_max.BurnFlash();
using namespace rev::spark;

SparkMax m_max{1, SparkMax::MotorType::kBrushless};
SparkMaxConfig config{};

config
    .Inverted(true)
    .SetIdleMode(SparkMaxConfig::IdleMode::kBrake);
config.encoder
    .PositionConversionFactor(1000)
    .VelocityConversionFactor(1000);
config.closedLoop
    .SetFeedbackSensor(ClosedLoopConfig::FeedbackSensor::kPrimaryEncoder)
    .Pid(1.0, 0.0, 0.0);
    
m_max.Configure(config, SparkMax::ResetMode::kResetSafeParameters, SparkMax::PersistMode::kPersistParameters);
CANSparkMax max = new CANSparkMax(1, MotorType.kBrushless);
RelativeEncoder enc = max.getEncoder();

boolean isInverted = max.getInverted();
double positionConversionFactor = enc.getPositionConversionFactor();
double velocityConversionFactor = enc.getVelocityConversionFactor();
SparkMax max = new SparkMax(1, MotorType.kBrushless);

boolean isInverted = max.configAccessor.getInverted();
double positionFactor = max.configAccessor.encoder.getPositionConversionFactor();
double velocityFactor = max.configAccessor.encoder.getVelocityConversionFactor();
using namespace rev;

CANSparkMax m_max{1, CANSparkMax::MotorType::kBrushless};
SparkRelativeEncoder m_enc = m_max.GetEncoder();

bool isInverted = m_max.GetInverted();
double positionFactor = m_enc.GetPositionConversionFactor();
double velocityFactor = m_enc.GetVelocityConversionFactor();
using namespace rev::spark;

SparkMax m_max{1, SparkMax::MotorType::kBrushless};

bool isInverted = m_max.configAccessor.GetInverted();
double positionFactor = m_max.configAccessor.encoder.GetPositionConversionFactor();
double velocityFactor = m_max.configAccessor.encoder.GetVelocityConversionFactor();
CANSparkMax max = new CANSparkMax(1, MotorType.kBrushless);

max.restoreFactoryDefaults();
// Adjust periodic status frame 2, which includes encoder position data
max.setPeriodicFramePeriod(PeriodicFrame.kStatus2, 5);
max.burnFlash();

double position = max.getEncoder().getPosition();
SparkMax max = new SparkMax(1, MotorType.kBrushless);
SparkMaxConfig config = new SparkMaxConfig();

config.signals.primaryEncoderPositionPeriodMs(5);

max.configure(config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);

double position = max.getEncoder().getPosition();
using namespace rev;

CANSparkMax m_max{1, MotorType.kBrushless};

m_max.RestoreFactoryDefaults();
// Adjust periodic status frame 2, which includes encoder position data
m_max.SetPeriodicFramePeriod(CANSparkMax::PeriodicFrame::kStatus2, 5);
m_max.BurnFlash();

double position = m_max.GetEncoder().GetPosition();
using namespace rev::spark;

SparkMax m_max{1, SparkMax::MotorType::kBrushless};
SparkMaxConfig config{};

config.signals.PrimaryEncoderPositionPeriodMs(5);
    
m_max.Configure(config, SparkMax::ResetMode::kResetSafeParameters, SparkMax::PersistMode::kPersistParameters);

double position = m_max.GetEncoder().GetPosition();
REV Through Bore Encoder
https://docs.revrobotics.com/revlib
several sets of libraries
WPILib documentation
REV Hardware Client
MAXSwerve Module
Install and Open the Latest version of the REV Hardware Client
MAXSwerve Java Template
MAXSwerve C++ Template
https://docs.revrobotics.com/revlib
https://software-metadata.revrobotics.com/REVLib-2024.json
Adding Offline Libraries
Online REVLib Java Documentation
Online REVLib C++ Documentation
https://docs.revrobotics.com/revlib
// initialize the motor (Flex/MAX are setup the same way)
CANSparkFlex m_motor = new CANSparkFlex(deviceID, MotorType.kBrushless);

// initialize the PID controller
SparkPIDController m_pidController = m_motor.getPIDController();
// initialize the motor (Flex/MAX are setup the same way)
rev::CANSparkMax m_motor{deviceID, rev::CANSparkMax::MotorType::kBrushless};

// initialize the PID Controller
rev::SparkPIDController m_pidController = m_motor.GetPIDController();
CANSparkFlex
SparkPIDController
CANSparkMax
SparkPIDController
// Set the setpoint of the PID controller in raw position mode
m_pidController.setReference(setPoint, CANSparkBase.ControlType.kPosition);
// Set the setpoint of the PID controller in raw position mode
m_pidController.SetReference(SetPoint, rev::CANSparkBase::ControlType::kPosition);
setReference
ControlType
SetReference
ControlType
Getting Started with PID Tuning
SparkPIDController
SparkPIDController
NEO Vortex
NEO V1.1
NEO 550
SparkPIDController
SparkPIDController
SparkPIDController
SparkPIDController
https://docs.revrobotics.com/revlib
2025 beta release notes
PID constants.

2024.2.0

Embedded (Press Ctrl-H)

2024.2.4

2024.2.4

Getting Started with PID Tuning

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

FRC Usage

In FRC, PID loops are used in many types of mechanisms, from flywheel shooters to vertical arms. These need to be tuned to different constants, depending on the units they use and the physical design of the mechanism, however the process to find these constants is roughly the same.

Most teams find success using controllers tuned primarily with and , using a to account for .

The Constants

P - Proportional Gain

P, the proportional gain, is the primary factor of the control loop. This is multiplied by the error and that gain is added to the output. This does the heavy lifting of the motion, pushing the motor in the direction it needs to go.

I - Integral Gain

I, the integral gain, is not often recommended in FRC. It is useful for eliminating steady-state error, or error that the other gains leave behind and cannot address. It accumulates the error over time and multiplies it by the I gain, gradually increasing the power it supplies until that has evened out. If it is needed, it's recommended to use a limited to prevent .

D - Derivative Gain

The derivative gain, D, is used to tune out oscillation and dampen the motion. It resists motion, decreasing power when the mechanism is moving. A good balance of P and D is needed to make a smooth motion with no oscillation.

Tuning

To then tune a basic PID loop, follow the steps below:

  1. Set all constants (P, I, D, F, arb Feed Forward, etc) to 0

  2. Ensure the mechanism is safe to actuate. This process will spin the motor, potentially at unexpected speeds and in unexpected directions

  3. Check the direction of the motor, and invert it if needed so that positive output is in the desired direction

  4. Set P to a very small number, relative to the units you are working in

  5. Set a target for the motor to move to. Ensure this is within the range of your mechanism.

  6. Gradually increase P until you see movement, by small increments

  7. Once you see motion, increase P by small increments until it reaches the target at the desired speed

  8. If you see oscillation, decrease P or begin to increment D by a small amount

  9. Continue to adjust these parameters until the motion is quick, precise, and repeatable

Arbitrary Feed Forward

The SPARK Flex and SPARK MAX do not have any support for more complex physics-based Feed Forward models, but do include a means of applying an arbitrary voltage which can be calculated in your team code and passed to the API.

It can be applied with the setpoint as seen below:

// Set the setpoint of the PID controller in raw position mode, with a feedforward
m_pidController.setReference(
    setPoint, 
    CANSparkBase.ControlType.kPosition, 
    feedForward
);
// Set the setpoint of the PID controller in raw position mode, with a feedforward
m_pidController.SetReference(
    SetPoint, 
    rev::CANSparkBase::ControlType::kPosition,
    feedForward
);

Current Control Mode

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

Current Control uses a PID controller to run the motor at a consistent current providing a consistent torque. The PID controller is run using the setpoint, in Amps, and the internally measured current draw.

It is called as shown below:

Current Control mode will turn your mechanism continuously and will speed up to maximum velocity if unloaded. Use caution when running this mode and avoid using it on mechanisms with a limited range of motion.

Position Control Mode

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

Position Control is used to point the motor in a specific direction. It takes a setpoint in rotations and uses the PID loop to move to that position. The Position control mode pipes directly into a PID controller with the configured encoder.

A properly tuned Position control loop should respond quickly and accurately to a setpoint change and should not oscillate around the target.

To run the motor in Position control mode, set the PID Controller setpoint as shown below.

Smart Motion Control

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

Tuning the PID Controller for Smart Motion may be difficult on mechanisms with a very limited range of motion.

This control mode takes a setpoint in units of rotations, but the underlying implementation executes a Velocity PID controller, so the PID tuning process will be more like a Velocity controller.

Running Smart Motion Control is as easy as any other control mode: configure the constants, pick your setpoints, and set it as the mode when you apply the position target, as seen below:

Using the Velocity Control mode will rotate your mechanism continuously. Please exercise caution while tuning. Utilize hard and soft limits to protect your robot.

Smart Velocity Control

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

It is called as seen below:

Smart Velocity Control mode will turn your motor continuously. Be sure your mechanism does not have any hard limits for rotation.

Velocity Control Mode

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

It is called in the same way as Position Control:

Velocity Control mode will turn your motor continuously,. Be sure your mechanism does not have any hard limits for rotation.

Velocity Loop constants are often of a very low magnitude, so if your mechanism isn't behaving as expected, try decreasing your gains.

Code Examples

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

SPARK Motor Controllers

Anderson Powerpole Connectors

Anderson Powerpole connectors are a popular choice in the FIRST community for electrical connections. Ensuring that these connectors are crimped properly and the contact is fully inserted into the housing is key to having a good electrical connection.

Anderson Powerpole Connectors consist of two major parts: the housing and contact. There are a number of different housings and contacts depending on the power requirements of the system. The most common housing and contact used with the SPARK MAX is the 1327 series housing paired with the 45 amp contacts.

Anderson Connector Housing

The housings for the connectors are genderless allowing all powerpole connectors to mate with themselves. The 1327 series housing can utilize contacts rated for 15-45 amps. Housings come in a variety of colors allowing for easy pairings with the wire color.

Dovetails on each housing allow them to slide together. Do not attempt to snap the housings together as they can break. After the housings are mated together adding a roll pin prevents the housings from become detached during operation. Each housing is fitted with a spring to retain the contacts after they are inserted

Anderson Contacts

1327 series housings can use contacts rated for between 15 and 45 amps. The 45 amp contacts are used with the SPARK MAX. When striping wire for the contact, make sure the stripped wire is the length of the large flap. No wire should extend past the large flap into the gap between the large and small flaps on the contact. Utilize a proper crimping tool when crimping on the connector.

Having too much wire exposed can cause issues with proper placement of the contact in the housing. This can lead to bad connections. If the contacts are not fully inserted into the housing the contact connection issues can arise. The images above are examples of good crimps with the proper amount of wire inserted into the contact.

Having improper placement of the contact in the housing can lead to intermittent brownouts of the SPARK MAX, the contact dislodging from the housing, or have cause problems with one or more of the phases of a brushless motor.

Device Firmware Changelogs

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

Migrating to REVLib

January 4, 2025 Update -

Please bookmark our new page as we transition over and add more information there!

Migrating from the SPARK MAX API and/or Color Sensor V3 API

Beginning in 2022, The SPARK MAX API and the Color Sensor V3 API have been merged into a unified library called REVLib. You need to make sure that you have uninstalled those old libraries before you install REVLib.

LabVIEW migration

  1. Ensure that the old SPARK MAX API and/or Color Sensor V3 API packages are uninstalled.

  2. Opening a project that used the old APIs should work fine. When it is loading, it may show that there are some missing VIs, but eventually LabVIEW should find the new VIs automatically.

C++/Java migration

  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 Manage Current Libraries.

  5. Check the REVRobotics and/or REVColorSensorV3 items (whichever ones are present)

  6. Click the OK button to uninstall them.

Migrating from CTRE Phoenix

Many teams have been using various CTRE motor controllers such as the Talon SRX and Talon SPX, and have concerns about porting software between platforms. Fortunately the feature set and code required is similar between the two, and porting from one to the other is easy. Below shows the common tasks and the changes required to convert from the code for CTRE Phoenix devices to the SPARK MAX.

Migrating from CTRE Phoenix: Java

Include Library

Create Object CAN ID 1

Reset Factory Defaults

Select Encoder

This is a brushed motor feature and not needed for using brushless motors with SPARK MAX

Set closed loop constants

Run Closed Loop Velocity Control

For this example velocity is set at 500 RPM

Read RPM of Motor

Read Applied Output Percent

Run Closed Loop Position Control

This example runs a position control loop for 10 rotations.

Change Units from 'rotations' to 'inches'

This example assumes a 4" wheel on a 15:1 reduction

Run Closed Loop Position Control for a set distance

This example assumes a 4" wheel on a 15:1 reduction to move 2 feet (24 inches).

Save Parameters

Follow another device

Invert a device

Configure a limit switch

Disable a limit switch

Migrating from CTRE Phoenix: C++

Include Library

Create Object CAN ID 1

Reset Factory Defaults

Select Encoder

This is a brushed motor feature and not needed for using brushless motors with SPARK MAX.

Set closed loop constants

Run Closed Loop Velocity Control

For this example velocity is set at 500 RPM

Read RPM of Motor

Read Applied Output Percent

Run Closed Loop Position Control

This example runs a position control loop for 10 rotations.

Change Units from 'rotations' to 'inches'

This example assumes a 4" wheel on a 15:1 reduction

Run Closed Loop Position Control for a set distance

This example assumes a 4" wheel on a 15:1 reduction to move 2 feet (24 inches).

Save Parameters

Follow another device

Invert a device

Configure a limit switch

Disable a limit switch

SPARK Motor Controller PIDF Implementation

Documentation for REVLib 2025 can now be found at:

For a detailed technical and mathematical description of each term and its effect, the is a good resource.

Several guides for PID tuning are available, such as . It may be useful to consult multiple, especially those available that reference your specific mechanism.

Any method for PID tuning will start with the same concept, however, regardless of mechanism. Before you can tune your mechanism, you should setup a graph of the setpoint and that measured value, either through the or a similar utility. This will allow you to analyze each test and properly evaluate the changes to make.

If you are operating in Velocity Control Mode (or a velocity-based control mode), set F to the motor's value as discussed in

API Docs: ,

API Docs: ,

WPILib offers

Documentation for REVLib 2025 can now be found at:

m_pidController.setReference(setPoint, CANSparkBase.ControlType.kCurrent);

API Docs:

m_pidController.SetReference(SetPoint, rev::CANSparkBase::ControlType::kCurrent);

API Reference:

Documentation for REVLib 2025 can now be found at:

Position Control is a great tool for simple but consistent motions, and can be paired with a to create smoother, more complex motions.

m_pidController.setReference(setPoint, CANSparkBase.ControlType.kPosition);

API Docs:

m_pidController.SetReference(SetPoint, rev::CANSparkBase::ControlType::kPosition);

API Reference:

This loop was tuned to show the curve, an ideal controller would move much quicker. In a perfect world, this motion would be nearly instantaneous.

Documentation for REVLib 2025 can now be found at:

Smart Motion Control is a complex control mode that allows for smoother and more controlled movements from one position to another. By configuring the maximum velocity and acceleration, as shown in , this control mode will create a motion that accelerates, holds a constant "cruise" velocity, and then decelerates to a stop at the setpoint.

The is a good tool for tuning this control loop, as it allows you to toggle between Smart Motion and Velocity control to fine-tune the constants and parameters.

Smart Motion's function is the same as that of , which uses an underlying position-based PID controller which may be easier to tune and can sometimes provide better results.

m_pidController.setReference(setPoint, CANSparkBase.ControlType.kSmartMotion);

API Docs:

m_pidController.SetReference(SetPoint, rev::CANSparkBase::ControlType::kSmartMotion);

API Reference:

This graph was generated with a very slow acceleration and max velocity to show the curve. Once your constants are dialed in, these can be increased to make your motion quick and precise. This graph was made using a Spark Flex driving a 1:1 rubber flywheel.

Documentation for REVLib 2025 can now be found at:

The Smart Velocity control mode utilizes the to improve upon velocity control. Honoring the maximum acceleration, Smart Velocity will speed up and slow down your flywheel or rotary mechanism in a controlled way, reducing power draw and increasing consistency.

m_pidController.setReference(setPoint, CANSparkBase.ControlType.kSmartVelocity);

API Docs:

m_pidController.SetReference(SetPoint, rev::CANSparkBase::ControlType::kSmartVelocity);

API Reference:

This graph was generated with a very slow acceleration to better show the motion, the wobbles at low speed can be minimize by increasing your acceleration.

Documentation for REVLib 2025 can now be found at:

Velocity Control uses the PID controller to run the motor at a set speed in RPM. An FF gain, as detailed in , is your friend in finding consistency when tuning this mode.

m_pidController.setReference(setPoint, CANSparkBase.ControlType.kVelocity);

API Docs:

m_pidController.SetReference(SetPoint, rev::CANSparkBase::ControlType::kVelocity);

API Reference:

We are currently in the process of updating our Code Examples! While the links below still work, please see our new repository for examples compatible with REVLib 2025:

Documentation for REVLib 2025 can now be found at:

For more information on powerpole assembly see the instructions.

Documentation for REVLib 2025 can now be found at:

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

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.

Version 24.0.1

  • Improves filtering of invalid PWM signals

    • Previously, noise on the signal wires could be occasionally be erroneously interpreted as a PWM signal, causing the motor to spin unexpectedly

Version 24.0.0

Breaking Changes

  • Moves the IAccum value to periodic status frame 7

    • Periodic status frame 7 is new to this release, and by default is sent every 250ms.

Enhancements

  • Allows changing the CAN ID of a SPARK MAX connected directly via USB without affecting other SPARK devices on the CAN bus with the same CAN ID

  • Makes changes towards improving the reliability of saving and persisting parameters

Bug fixes

  • Fixes alternate encoder position accuracy

  • Fixes the main quadrature encoder position jumping in brushed mode

Version 1.6.3

  • Fixes issue where changing the inversion mode of the duty cycle absolute encoder with a zero offset specified would cause the physical zero position to change

Version 1.6.2

  • Fixes critical issue where new parameters introduced in 1.6.0 were not being burned to flash correctly

  • Fixes issue where new parameters were not being read back correctly despite being set correctly

Version 1.6.1

  • Fixes duty cycle offset to match the inverted setting

  • Fixes parameters being NaN after updating to 1.6.0

  • Fixes burn flash command response

Version 1.6.0

  • Adds new parameters for configuring hall sensor velocity measurement

  • Adds support for duty cycle absolute encoders

  • Adds new parameters to enable and configure position PID rollover

Version 1.5.2

  • Fixes issue with the kDataPortConfig parameter not enabling Alternate Encoder Mode on a power cycle after it has been configured and saved to flash.

  • Improves Gate Driver Fault recovery.

Version 1.5.1

  • Improvements to BLDC commutation timing.

    • Most noticeable at high RPMs only achievable by the NEO 550.

  • Fixes rare case where the SPARK MAX Status LED shows normal driving but no actual output is occurring until a reboot of the controller.

Version 1.5.0

  • Adds a unique hash key to the firmware. This key is a hashed value based on the unique 96-bit device ID guaranteed to be unique for every STM32 device. The hash value itself is 32-bits to make transmission/reception and on-board comparison easier. It is unlikely for a key collision especially since most buses have only a small number of devices.

  • Adds ID Query command to have all devices which match the CAN ID sent to return their unique hash key. This is typically used to identify all devices with CAN ID 0 but can be used to identify devices with conflicting CAN IDs.

  • Adds ID Assign command, which sends a unique hash key and a CAN ID, which is received by any device whose CAN ID matches the ID field. The device whose unique hash matches has their own CAN ID set to the desired value. This is for initial or automatic provisioning, or to re-address devices with the same CAN ID.

  • Adds identify command which flashes the LED blue/magenta. This command uses the CAN ID, or the unique hash if CAN ID = 0.

  • Complete overhaul of USB interface, creating a generic USB-to-CAN driver connection to act as the bridge to the interface.

  • Adds device manufacturing info to firmware frame.

  • Adds retry frame to CAN bootloader if there is an issue.

Version 1.4.1

  • Fixes issue where creating a CANSparkMax object would cause the SensorType parameter to be set to NoSensor.

Version 1.4.0

  • Adds non-competition heartbeat command when not used with a roboRIO.

  • Adds Raspbian support using official WPILib tools.

  • Adds locking mechanism to prevent simultaneous USB and CAN commands.

  • Proportional blink codes now match inversion settings (i.e. positive input is always green, and negative input is always red).

  • Limit switch and soft limits now follow inversion settings.

  • Motor controller inversion now in the firmware instead of the API.

  • Adds a configurable range for absolute feedback devices (currently only applicable to an absolute mode analog sensor), which also prevents users from setting a setpoint out of range.

  • Adds ability to use both absolute and relative analog sensors as feedback devices

  • Adds filtering for Analog sensor with settings for velocity moving average filter

  • Adds ability to configure how errors are tracked and handled by the user.

    • Calls can be automatically registered and tracked, with any errors displayed to the DriverStation or users can use the GetLastError() after calls to determine if an error has been thrown. This is done by changing the error timeout through SetCANTimeout(), where a timeout of 0 means that the calls are non-blocking, and errors are checked in a separate thread and sent through to the driver station.

  • Other minor improvements and bug fixes.

Version 1.3.0

  • Ability to configure the feedback device for the PIDController.

  • Addition of CANAnalog which will function as a possible feedback device.

  • Added API for using encoders with brushed DC motors.

  • Adds API to enable and set soft limits.

  • All control modes now reset integrator on limit switch activation for long as the limit switch is held.

  • Smart Motion now honors acceleration rate after limit switch changes from triggered to not triggered.

  • Fixes issue where sticky faults can be cleared incorrectly when a new fault is set and the old fault is no longer present.

  • Adds status 3 periodic frame for analog sensor.

  • Other minor improvements and bug fixes.

Version 1.2.1

  • Adds initial CAN bootloading functionality.

    • Requires continuous power during update and requires USB recovery if the update fails after erasing the flash (i.e. power is lost during update).

    • This is not yet integrated into a formal tool, but is exposed in the API. Future versions will allow recovery over CAN.

    • Fix to bus voltage measurement, previous version reported a lower value.

    • Additional accuracy improvements to all ADC measurements.

    • Adds additional filtering to bus voltage.

    • Fix for Follow settings not being reapplied after power cycle.

    • Adds ability to change units for arbFF between voltage and percent bus voltage (or percent compensated voltage).

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.

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.

Version 1.1.26 (beta)

  • 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()

Version 1.0.385

  • Fixes PWM control issue introduced by version 1.0.384.

Version 1.0.384

  • Fixes GetPosition() 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.

Factory Images

Version 24.0.8

  • Fixes bug in velocity calculation when changing the encoder average depth

  • Fixes issue causing motor EEPROM to occasionally reload fully after disabling the motor, causing brief dropout of status frames

Version 24.0.7

  • Adds parameters for status frame periods

  • Performs contextual validation on the sensor type parameter

  • Always keeps the hall sensor active when in brushless mode, in addition to the specified sensor type

  • Recalculates the hall angle more frequently to prevent lockup

Version 24.0.6

  • Fixes issue where an invalid sensor type for a given motor type can cause a sensor fault

Version 24.0.5

  • Improves handling of errors on the CAN bus

  • Fixes incorrect EEPROM faults appearing

  • Reduces boot time

  • Properly handles the case where a CAN device sends a payload longer than 8 bytes

  • Improves internal watchdog

Version 24.0.4

  • Fixes issue where SPARK Flex constantly disables itself while running when certain third-party commands are being sent to the CAN bus

Version 24.0.3

  • Fixes position data inaccuracy when the position conversion factor is not 1

Version 24.0.2

  • Improves filtering of invalid PWM signals

    • Previously, noise on the signal wires could be occasionally be erroneously interpreted as a PWM signal, causing the motor to spin unexpectedly

  • Fixes issue where CAN errors would cause the device to switch between brake mode and coast mode, resulting in a clicking sound if you manually turned the motor

Version 24.0.0

Breaking Changes

  • Moves the IAccum value to periodic status frame 7

    • Periodic status frame 7 is new to this release, and by default is sent every 250ms.

Enhancements

  • Adds Orange/Green blink code to indicate temperature cutoff

  • Refuses to run in brushed mode when connected to a NEO Vortex

  • Improves the precision of the main encoder

    • Previously, the higher the position value was, the less precise the value would be

    • For the NEO Vortex's internal encoder, this change starts making a difference after only ~1,000 rotations

    • Requires REVLib 2024.2.0 or later or REV Hardware Client 1.6.2 or later to take advantage of the additional precision

  • Allows changing the CAN ID of a SPARK Flex connected directly via USB without affecting other SPARK devices on the CAN bus with the same CAN ID

  • Makes changes towards improving the reliability of saving and persisting parameters

Bug fixes

  • Fixes analog sensor values when it is configured to be inverted

  • Fixes setting the NEO encoder's position to values other than zero

  • Fixes the NEO encoder's position when the motor is inverted

Version 23.0.2

  • Adds support for updating the firmware via CAN and USB (without Recovery Mode)

Known issues

  • Setting the NEO encoder's position always resets the position to 0, regardless of the specified value

  • When the analog sensor is configured to be inverted, its reported values will be incorrect

Version 23.0.0

Initial version with intent to support equivalent features to SPARK MAX

  • Features requiring the SPARK Flex Dock (coming soon) are not yet supported, e.g. brushed motor driving and NEO/NEO550 brushless motor driving

  • Alternate Encoder Mode is not necessary for SPARK Flex, therefore it is replaced by the External Encoder Data Port feature:

    • Can be used simultaneously with the internal encoders in NEO class motors

    • Can be used simultaneously with an absolute encoder and limit switches

    • Virtually no RPM limit

    • No special configuration

Documentation for REVLib 2025 can now be found at:

.

Install REVLib for .

Adds for BLDC external encoder support.

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

When updating the SPARK MAX Firmware we recommend using the REV Hardware Client and the latest firmware file listed in the . 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:

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

If notified by the , you may need to install your SPARK Flex Motor Controller's first .

REVLib LabVIEW Download - Version 2024.2.0
REVLib C++/Java Download- Version 2024.2.4
https://docs.revrobotics.com/revlib
WPILib docs page on PID
this one on the WPILib docs
REV Hardware Client
SparkPIDController
setReference
SparkPIDController
SetReference
several basic feed forward calculation classes
https://docs.revrobotics.com/revlib
setReference
SetReference
https://docs.revrobotics.com/revlib
WPILib TrapezoidalProfile
setReference
SetReference
https://docs.revrobotics.com/revlib
Smart Motion Example Program
WPILib's TrapezoidalProfile
setReference
SetReference
https://docs.revrobotics.com/revlib
setReference
SetReference
https://docs.revrobotics.com/revlib
setReference
SetReference
LabVIEW
Java
Java Docs
C++
C++ Docs
F Parameter
Smart Motion Parameters
Smart Motion parameters
F Parameter
SPARK Flex Code Examples
SPARK MAX Code Examples
import com.revrobotics.CANEncoder;
import com.revrobotics.CANPIDController;
import com.revrobotics.CANSparkMax;
import com.revrobotics.ControlType;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import com.ctre.phoenix.motorcontrol.can.*;
import com.ctre.phoenix.motorcontrol.*;
private CANSparkMax sparkMax = new CANSparkMax(deviceID, MotorType.kBrushless);
TalonSRX talonSRX = new TalonSRX(1);
sparkMax.restoreFactoryDefaults();
talonSRX.configFactoryDefault();
encoder = sparkMax.getEncoder();
encoder.setInverted(false);
sparkMax.setFeedbackDevice(encoder);
talonSRX.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, kPIDLoopIdx, Constants.kTimeoutMs);
talonSRX.setSensorPhase(true);
pidController.setP(kP);
pidController.setI(kI);
pidController.setD(kD);
pidController.setIZone(kIz);
pidController.setFF(kFF);
pidController.setOutputRange(kMinOutput, kMaxOutput);
talonSRX.configNominalOutputForward(0, kTimeoutMs);
talonSRX.configNominalOutputReverse(0, kTimeoutMs);
talonSRX.configPeakOutputForward(kMaxOutput, kTimeoutMs);
talonSRX.configPeakOutputReverse(kMinOutput, kTimeoutMs);

talonSRX.config_kF(kPIDLoopIdx, kP, kTimeoutMs);
talonSRX.config_kP(kPIDLoopIdx, kI, kTimeoutMs);
talonSRX.config_kI(kPIDLoopIdx, kD, kTimeoutMs);
talonSRX.config_kD(kPIDLoopIdx, kF, kTimeoutMs);
pidController.setReference(500.0, ControlType.kVelocity);
// Convert from 500 RPM to 'native units'
double VelocityinUnitsPer100ms  = 500.0 * 4096 / 600;
talonSRX.set(ControlMode.Velocity, VelocityinUnitsPer100ms ); 
encoder.getVelocity();
talonSRX.getSelectedSensorVelocity(kPIDLoopIdx) * 600 / 4096;
sparkMax.getAppliedOutput();
talonSRX.getMotorOutputPercent();
pidController.setReference(10.0, ControlType.kPosition);
targetPositionRoations = 10.0 * 4096;
talonSRX.set(ControlMode.Position, targetPositionRotations);
encoder.setPositionFactor(M_PI * 4/15);
// No Equivellant
pidController.setReference(24.0, ControlType.kPosition);
targetPositionRotations = (M_PI * 4 / 15 * 4096) * 24;
talonSRX.set(ControlMode.Position, targetPositionRotations);
// Run after all parameters are set in RobotInit()
sparkMax.burnFlash();
//Automatic
sparkMax1.follow(sparkMax2);
talonSRX1.follow(talonSRX2);
sparkMax.setInverted(true);
talonSRX.setInverted(true);
forwardLimit = sparkMax.getForwardLimitSwitch(LimitSwitchPolarity.kNormallyOpen);
talonSRX.configForwardLimitSwitchSource(
                                        LimitSwitchSource.LimitSwitchSource_FeedbackConnector,
                                        LimitSwitchNormal.LimitSwitchNormal_NormallyOpen,
                                        kTimeoutMs);
forwardLimit.EnableLimitSwitch(false);
talonSRX.overrideLimitSwitchesEnable(true);
#include "rev/CANSparkMax.h"
#include "ctre/Phoenix.h"
rev::CANSparkMax sparkMax{1, rev::CANSparkMax::MotorType::kBrushless};
TalonSRX* talon = new TalonSRX(1);
sparkMax.RestoreFactoryDefaults();
talon->ConfigFactoryDefault();
rev::CANEncoder encoder = sparkMax.GetEncoder(rev::CANEncoder::EncoderType::kQuadrature, 4096);
encoder.SetInverted(true);
sparkMax.SetFeedbackDevice(encoder);
talonSRX->ConfigSelectedFeedbackSensor(FeedbackDevice::CTRE_MagEncoder_Relative, 0, kTimeoutMs);
talonSRX->SetSensorPhase(true);
rev::CANPIDController pidController = sparkMax.GetPIDController();
pidController.SetFeedbackDevice(encoder);

pidController.SetP(kP);
pidController.SetI(kI);
pidController.SetD(kD);
pidController.SetIZone(kIz);
pidController.SetFF(kFF);
pidController.SetOutputRange(kMinOutput, kMaxOutput);
talonSRX->ConfigNominalOutputForward(0, kTimeoutMs);
talonSRX->ConfigNominalOutputReverse(0, kTimeoutMs);
talonSRX->ConfigPeakOutputForward(1, kTimeoutMs);
talonSRX->ConfigPeakOutputReverse(-1, kTimeoutMs);

 talonSRX->Config_kF(kPIDLoopIdx, 0.1097, kTimeoutMs);
talonSRX->Config_kP(kPIDLoopIdx, 0.22, kTimeoutMs);
talonSRX->Config_kI(kPIDLoopIdx, 0.0, kTimeoutMs);
talonSRX->Config_kD(kPIDLoopIdx, 0.0, kTimeoutMs);
pidController.SetReference(500.0, rev::ControlType::kVelocity);
"// Convert from 500 RPM to 'native units'
double VelocityinUnitsPer100ms  = 500.0 * 4096 / 600;
talonSRX->Set(ControlMode::Velocity, VelocityinUnitsPer100ms ); 
encoder.GetVelocity();
talonSRX->GetSelectedSensorVelocity(kPIDLoopIdx) * 600 / 4096;
sparkMax.GetAppliedOutput();
talonSRX->GetMotorOutputPercent();
pidController.SetReference(10.0, rev::ControlType::kPosition);
targetPositionRotations = 10.0 * 4096;
talonSRX->Set(ControlMode::Position, targetPositionRotations);;
encoder.SetPositionFactor( M_PI * 4 / 15 );
// No Equivellant
pidController.SetReference(24.0, rev::ControlType::kPosition);
targetPositionRotations = (M_PI * 4 / 15 * 4096) * 24;
talonSRX->Set(ControlMode::Position, targetPositionRotations);
// Run after all parameters are set in RobotInit()
sparkMax.BurnFlash();
//Automatic
sparkMax1.Follow(sparkMax2);
talonSRX1->Follow(*talon2);
sparkMax.SetInverted(true);
talonSRX->SetInverted(true);
rev::CANDigitalInput forwardLimit = sparkMax.GetForwardLimitSwitch(rev::CANDigitalInput::LimitSwitchPolarity::kNormallyOpen);
talonSRX->ConfigForwardLimitSwitchSource(
					LimitSwitchSource::LimitSwitchSource_FeedbackConnector,
					LimitSwitchNormal::LimitSwitchNormal_NormallyOpen,
					kTimeoutMs);
forwardLimit.EnableLimitSwitch(false);
talonSRX->OverrideLimitSwitchesEnable(true);
REVLib Code Examples
https://docs.revrobotics.com/revlib
Powerwerx
https://docs.revrobotics.com/revlib
Alternate Encoder Mode
API Information
firmware changelog
Factory Image Version 1.1.33
Factory Image Version 1.1.31
Factory Image Version 1.0.385
Factory Image Version 1.0.381
REV Hardware Client
REV Hardware Client
firmware update via Recovery Mode
https://docs.revrobotics.com/revlib
Install the REVLib package
C++ and Java

Alternate encoder

Analog Feedback Device

-

Arcade Drive With CAN

-

Arcade Drive With PWM

-

Bus Measurements

Encoder Feedback Device

-

Get and Set Parameters

Limit Switch

MAXSwerve Template

-

Mecanum Drive with CAN

-

-

Motor Follower

-

-

Position Closed Loop Control

Read Encoder Values

Smart Motion Example

-

Soft Limits

-

Tank Drive With CAN

-

-

Velocity Closed Loop Control

SPARK MAX Client

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

Latest SPARK MAX Client - Version 2.1.1

For instructions on how to access this legacy software, please email support@revrobotics.com

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 64-bit

  • 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. During the installation process, separate driver installation windows may appear. Some driver installations may fail if you already have the driver installed from a previously installed Client, this is expected.

  4. 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.

SPARK Motor Controller

The Original SPARK Motor Controller has been discontinued and will not be re-stocked.

SPARK Overview

Features

  • Passive cooling

    • No fans required

  • Synchronous rectification

    • Reduces heat generation

  • Limit switch inputs

    • Stops forward and/or reverse motion automatically

    • No programming required

    • Compatible with normally open (NO) limit switches

  • Calibration

    • Factory calibrated to 1ms – 2ms input signal

    • User calibratable

  • Integrated cable retention for PWM port

  • Clamping screw terminals

    • Better contact area and retention

  • RGB status LED

    • Detailed mode and operation feedback

Specifications

Parameter
Value & Units

Input Voltage (Nominal)

12 V

Continuous Current

60 A

Peak Current (2 second surge)

100 A

Input Pulse Width Range (Nominal)

1ms-2ms

Input Resolution

1μs

Input Deadband

40μs

Output Frequency

15.625 kHz

Output Voltage Range

0 V - ±Vin

Maximum Output Voltage Resolution

0.001 x Vin

Dimensions

2.860in x 1.875in x 0.868in

Weight

74g or 2.61oz

Additional Documentation

SPARK MAX Client Troubleshooting

Error During First-time Firmware Update

If this is the first time installing the SPARK MAX Client or connecting a SPARK MAX in Recovery Mode, you may see an error the first time you try to update firmware on your computer. The DFU driver is one of two drivers installed by the Client and is used for updating firmware. It may not install completely until a SPARK MAX in DFU Mode (Recovery Mode) is plugged into the computer.

If you see an error during your first firmware update, please do the following:

  1. Close the Client application.

  2. Unplug the SPARK MAX from the computer.

  3. Plug the SPARK MAX back into the computer.

  4. Open the Client application.

We are aware of this issue and will release a fix in a future update of the SPARK MAX Client.

Troubleshooting

  • 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

Updating Device Firmware

Updating a Single Device

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

  • Connect your SPARK MAX Motor Controller to your computer with a USB-C cable.

  • Open the REV SPARK MAX Client application.

  • The Client should automatically scan and connect to your SPARK MAX. If your SPARK MAX is running outdated firmware, you will be notified with a pop-up window like the one pictured below:

If your SPARK MAX is running firmware older than 1.4.0, you may not see a pop-up and will need to proceed directly to the Network tab and click Scan Bus manually.

  • Click Open Network Tab & Scan Bus and proceed to the next step.

  • Your SPARK MAX should now be listed in the device list. Click the checkbox next to the SPARK MAX you wish to update, and click Load Firmware.

  • 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:

  • Click Yes to confirm the update.

  • Once complete, the Client will rescan the bus and display the updated controllers.

Updating Multiple Devices with the USB-to-CAN Bridge

SPARK MAX Firmware Version 1.5.0 includes a USB-to-CAN Bridge feature that allows a single USB-connected SPARK MAX to act as a bridge to the entire CAN bus it is connected to. This allows for configuration and simultaneous updating of multiple SPARK MAX controllers without having to connect to each one individually. Using this feature requires the following:

  • A USB-connected SPARK MAX that is updated to firmware version 1.5.0 or newer to act as the Bridge.

  • Other SPARK MAXs connected on the CAN bus must be individually updated to firmware version 1.4.0 before they are able to receive mass-updates from the Bridging SPARK MAX.

Once these requirements are satisfied, navigate to the Network tab, select the controllers you wish to update, and follow the same firmware update procedure described above starting at Step 4.

When complete, the Client will display the number of successfully updated controllers.

Navigating the SPARK MAX Client

Navigation Bar

The Navigation bar is visible on all tabs of the SPARK MAX Client and allows you to select with SPARK MAX the Client is connected to.

  1. Identify Device: The status LED of a selected device will blink. This is helpful when troubleshooting or configuring multiple devices.

  2. Device Selection: See each SPARK MAX connected to the SPARK MAX Client. This includes other devices connected via CAN if running firmware 1.4.0 or later.

  3. Rescan: Looks for additional SPARK MAX devices connected to the SPARK MAX Client. This includes other devices connect via CAN if running firmware 1.4.0 or later.

  4. Connect/Disconnect: After selecting a device connecting to the device pulls all the configuration parameters set on the device.

  5. Tabs: Select one of the five tabs to gain access to configure, update, and run SPARK MAX.

Basic Tab

The Basic Tab is used to set the most common parameters for the SPARK MAX

  1. Configurations: This drop down allows you to select pre-existing configurations store on the Windows machine running the SPARK MAX Client or to pull the existing parameters stored on in RAM on the SPARK MAX. This is helpful when configuring multiple motor controllers to the same settings.

  2. CAN ID: This assigns a SPARK MAX a CAN ID for identification over the CAN BUS. Any configured SPARK MAX must have a CAN ID.

  3. Configured Parameters: Change the motor type, sensor type, idle mode behavior, and more.

Advanced Tab

The Advanced Tab allows for changing all configurable parameters of the SPARK MAX without needing to set them in code.

  1. Search Parameters: Allows for easy look up of a specific parameter for editing.

Run Tab

The Run Tab allows for the SPARK MAX to operate over USB or a USB to CAN Bridge without the need for a full control system. This is helpful for testing mechanisms and tuning their control loops.

  1. Bar Select: Select from either run, parameters, or signals to provide information and feedback when operating SPARK MAX.

  2. Signal Chart: Shows any added signals in graph form when running a SPARK MAX. This is helpful when tuning control loops.

  3. PIDF: Update PIDF parameters on the fly to tune control loops on the SPARK MAX.

  4. Run: Choose setpoints to run a motor connected to a SPARK MAX using various modes, including position, velocity, and duty cycle.

The three icons for bar select change the bottom third of the Run Tab for configuration. Once signals and other parameters are configured selecting the run bar icon will allow for running of a motor with the SPARK MAX Client.

Network Tab

The Network Tab shows all connected devices via USB and the USB to CAN interface. From the Network Tab each device can be identified and firmware updated.

  1. Device Select: Select a device to update firmware.

  2. Load Firmware: Select what firmware to update onto selected devices.

Recovery Mode with the SPARK MAX Client

  1. With the SPARK MAX powered off completely, press and hold the Mode Button.

  2. While still holding the Mode Button, connect the SPARK MAX to the computer using the USB cable. The Status LED will not illuminate, this is expected.

  3. Wait a few seconds for the computer to recognize the connected device, then release the Mode Button.

  4. Open the SPARK MAX Client Application. The SPARK MAX will remain dark and it will not connect to the Client, this is expected.

  5. Navigate to the Network tab and click the Rescan arrows at the top of the window.

  6. The SPARK MAX will be listed under Devices in Recovery Mode. Click the checkbox next to the device.

  7. Click the Load Firmware button.

  8. Select the latest firmware file and click Open.

  9. The firmware should load successfully and the SPARK MAX will now connect to the Client.

This is legacy documentation for our discontinued SPARK MAX Client Software. If you are interested in running a SPARK MAX via a computer, please see our newer documentation:

Windows 7 64-bit might work but it is .

The is a 12V 60A PWM-controlled brushed DC motor controller designed for FIRST Robotics Competition robots. It features 60A continuous current with passive cooling, bi-directional limit switch inputs for smart mechanism control, an RGB LED status indicator, and a button-activated brake/coast mode.

This is legacy documentation for our discontinued SPARK MAX Client Software. If you are interested in running a SPARK MAX via a computer, please see our newer documentation:

Alternatively, you can preemptively finalize the DFU driver installation by following the steps before using the Client for the first time.

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 :

If the device shows up with errors or as STM32 BOOTLOADER, try installing the separately.

This is legacy documentation for our discontinued SPARK MAX Client Software. If you are interested in running a SPARK MAX via a computer, please see our newer documentation:

If your SPARK MAX is listed and you are unable to click the checkbox next to it, you must put your SPARK MAX into .

If a controller fails to update it is usually due to the process being interrupted by a bad power or CAN connection. Severe interruptions can cause the firmware update to be corrupted. A corrupted controller can no longer be updated over the USB-to-CAN Bridge, however, it can be recovered by connecting to the controller directly over USB and putting it in .

This is legacy documentation for our discontinued SPARK MAX Client Software. If you are interested in running a SPARK MAX via a computer, please see our newer documentation:

Parameter Table: Select the arrow to show all configurable parameters within a specific group. For more information on each parameter type see .

For more information on the firmware updating process see for both and updates.

This is legacy documentation for our discontinued SPARK MAX Client Software. If you are interested in running a SPARK MAX via a computer, please see our newer documentation:

When updating the firmware on the SPARK MAX, it is possible for the process to be interrupted or for the firmware to be corrupted by a bad download. In this state, the Status LED will be dark and the SPARK MAX will fail to operate. SPARK MAX has a built-in recovery mode that can force it to accept new firmware even if the controller seems to be bricked. The following procedure requires a small tool, like a straightened paper clip, to press the Mode Button, a USB C cable, and a computer with the installed:

Java
C++
LabVIEW
Java
C++
C++
LabVIEW
C++
LabVIEW
Java
C++
LabVIEW
Java
C++
Java
C++
LabVIEW
Java
C++
LabVIEW
Java
C++
LabVIEW
Java
Java
C++
LabVIEW
Java
C++
LabVIEW
Java
C++
Java
C++
Java
Java
C++
LabVIEW
Latest Firmware - Version 24.0.1
Latest SPARK Flex Firmware Download - Version 24.0.8
Getting Started with the REV Hardware Client.
not supported
SPARK Motor Controller (REV-11-1200)
SPARK Motor Controller Quick Start Guide
SPARK Motor Controller User's Manual
Getting Started with the REV Hardware Client.
Recovery Mode
support@revrobotics.com
DFU drivers
Getting Started with the REV Hardware Client.
Recovery Mode
Recovery Mode
Getting Started with the REV Hardware Client.
Configuration Parameters
Getting Started with the REV Hardware Client.
SPARK MAX Client Application
Updating Device Firmware
single device
multiple device
Getting Started with the REV Hardware Client
mode-can-bootloader-retry.gif
mode-can-bootloader.gif
mode-identify.gif
Dark LED
Dark LED
Dark LED
fault-gate-driver.gif
fault-encoder.gif
fault-no-12v.gif
fault-can.gif
Encoder Port Pinout shown with color coding for JST PH 6-Pin Cables (REV-11-1275). Pin 1 is Black and for Ground. Pin 2 is Green and for Encoder C or Index. Pin 3 is Yellow and for Encoder B. Pin 4 is Blue and for Encoder A. Pin 5 is White and for Motor Temperature. Pin 6 is Red and for 5 Volt Power.
blue.png
brushless-no-signal-brake.gif
brushed-no-signal-coast.gif
yellow.png
cyan.png
brushed-no-signal-brake.gif
brushless-no-signal-coast.gif
magenta.png
forward-proportional.gif
green.png
reverse-proportional.gif
red.png
forward-limit-triggered.gif
reverse-limit-triggered.gif
mode-identify.gif
mode-can-bootloader.gif
mode-can-bootloader-retry.gif
Dark LED
Dark LED
fault-no-12v.gif
fault-encoder.gif
fault-gate-driver.gif
fault-can.gif
Dark LED
REV Hardware Client update tab shown, highlighting where to select the latest version and where to see if the device is up to date
Absolute Encoder tab in REV Hardware client, the MAXSwerve Module Calibration drop-down is highlighted
Zero Offset button in the REV Hardware Client's Absolute Encoder tab is highlighted
Fully assembled MAXSwerve Module showing that the absolute encoder adapter is mounted correctly and the through bore encoder is plugged in
MAXSwerve Calibration tool with an orange dot indicating the side of the cutout that the bevel gear slots into. This part of the cutout is a more complex shape with more corners and curves than the other half of the cutout.
MAXSwerve Calibration tool correctly mounted to a MAXSwerve Module
Operating Mode
Idle Mode
State
Color/Pattern
Graphic

Brushed

Brake

No Signal

Blue Blink

Valid Signal

Blue Solid

Coast

No Signal

Yellow Blink

Valid Signal

Yellow Solid

Brushless

Brake

No Signal

Cyan Blink

Valid Signal

Cyan Solid

Coast

No Signal

Magenta Blink

Valid Signal

Magenta Solid

Partial Forward

Green Blink

Full Forward

Green Solid

Partial Reverse

Red Blink

Full Reverse

Red Solid

Forward Limit

Green/White Blink

Reverse Limit

Red/White Blink

blue.png
cyan.png
brushed-no-signal-coast.gif
yellow.png
brushless-no-signal-brake.gif
brushless-no-signal-coast.gif
brushed-no-signal-brake.gif
magenta.png
forward-proportional.gif
green.png
red.png
forward-limit-triggered.gif
reverse-limit-triggered.gif
reverse-proportional.gif