I know this is probably a dumb question with very a very obvious answer, but I am very new to frc. What are the benefits of using can over pwm? What are the different use cases for both?
CAN gives you access to the built-in microcontroller capabilities of the various motor controllers.
These include faster feedback response, custom settings, adjustable voltage limits, etc.
There are drawbacks, e.g.,:
- More complex setup involving third-party setup tools,
- Too many devices, then you start to have problems flooding the communications bus,
- A break in the CAN bus can take out all your devices past the break,
- Resetting devices can lose settings and operate incorrectly,
PWM is a straight run the motor at a percentage of battery voltage.
Each motor gets it’s own dedicated control connection on the RIO (Y-cables are available to control multiple motors from one PWM connection).
If one disconnects the others continue working.
Limited number of PWM connections available on the RIO.
- Less wire mess
- Stronger more reliable connection points (depends but lots of options WAGO, crimp, solder)
- Ability to blink motor controllers to find them
- Creating braches for removable sub systems
- Super glue your SparkMax JSTs
- Every motor controller needs a home run to the RIO
- Limited PWM connections on the RIO
- Not a great way to secure PWM connections besides super glue or hot glue at ends
Now that the CANivore* is available and legal, you can use this to mitigate this issue because you can have two (or more) CAN busses. Just be sure that any CAN devices which need to communicate with each other are on the same bus. Examples: leader/follower controllers; and a controller and its external CAN-based sensor(s).
* fixed, Thanks @wits!
Are you referring to the new canivore?