Using the REV Spark MAX outside of the FRC Control System

After moving on from FRC to college, I have joined my college’s robotics team. We are working towards the NASA Lunabotics competition, and are evaluating the possibility of using REV NEO motors on this year’s robot.

I found the owners manual for the SPARK MAX here, and while it gives detailed information on the CAN frames it broadcasts periodically, there isnt information on how to control the motor controller directly over CAN.

Does anyone have any experience with using these outside the FRC system? I am assuming I can’t use the distributed REV libraries due to dependencies on WPI and the roboRIO.

The MAX can also be driven with PWM or USB.

As I understand it (I haven’t done it myself), the CTRE HERO development board is set up to drive all legal FRC CAN motor controllers, including the MAX.

http://www.ctr-electronics.com/control-system/hro.html

2 Likes

It seems that the USB interface is just a wrapper for the CAN interface, so I would still need some documentation on the commands. If we use PWM, we lose the smart features of the motor controller, such as reading encoder position and motor velocity.

I will look into the HERO board, thank you for pointing that out.

1 Like

Besides the ability to manually send and receive user-specified CAN messages, the HERO development board only has native software support for CTRE CAN devices (Talon SRX, Victor SPX, Pigeon IMU, CANifier, PDP, and PCM).

1 Like

Okay, so the Hero won’t help me as I can send CAN messages with the hardware I already have. Thanks for clearing that up before I ended up bashing my head against the wall looking for the library

An experiment with the Neo and the ODrive motor controllers is on my todo list for next month (I’m booked up on projects this month building one printer, getting another running, and getting a bunch of mandatory trainings done)

Those will communicate directly over USB, might work for you. Will require some configuration though.

You might want to consider VMX-pi. It’s currently in beta with full WPI Library support, which includes compatibility with SparkMAX as well as CTRE motor controllers - you can program it just like you’d program a RoboRIO in C++ and Java.

It also has underlying platform libraries in C++, Java, C# and Python if you want to access it at a lower level, however in that case you need to code your own CAN messages, since the SparkMAX library only works with the WPI Library currently.

It works together with Raspberry Pi, and has a IMU, CAN bus, as well as PWM, Analog and Digital IO, Quadrature Encoder decode, and SPI, I2C and UART interfaces. It also has an onboard power supply so you plug it directly into a battery, and has lots of voltage and current protection circuitry similar to RoboRIO.

Feel free to let me know if you’d like any more information, including access to the beta.

2 Likes

This is interesting. I might look into using either an ODrive or a VESC, if they will accept the motor encoders built into the NEOs.

If you end up trying it, I’d love to hear your findings

That’s the part I’d be super concerned about. My application required external encoders anyway so I wasn’t too concerned about it. I’d stupidly assumed that the encoder output from the Neo was Quadrature, it looks like it’s actually ABC which isn’t currently supported on the ODrive. (Section 2.3 of http://www.revrobotics.com/sparkmax-users-manual/#section-2-3)

If you don’t need encoder feedback you could likely consider running the ODrive in open loop mode though that works best at high speeds or with a decent reduction after the motor.

Another option MIGHT be using https://github.com/madcowswe/ODrive/blob/devel/docs/hoverboard.md which appears to support Hall effect sensors in that config. (At this point Im partly using this post as a scratch pad for stuff I find while digging so I can come back to it)