Best Practices for Motor Control Configurations

So I have been told that it is best practice to have all the motor controller configurations in the code and not saved in the flash of the motor controller. This is to make it easier to swap out in case something goes wrong.

In RobotInit() our code will call for ConfigFactoryDefault() and RestoreFactoryDefaults() for CTRE and REV respectively.

I was exploring the MaxSwerve Code examples and it has a section that recommends using BurnFlash() to save the configuration incase of a motor controller brownout so that it doesn’t lose configuration. (This should probably be in the other REV examples)

That sounds good to me, would that just go at the end of RobotInit() once all the settings have been applied? Also is there a CTRE equivalent? I have looked through their documentation and can’t seem to find anything.

1 Like

That sounds good to me, would that just go at the end of RobotInit() once all the settings have been applied?

Yes. You write all settings to the flash memory on the motor after you
have set all of your settings. Writing to flash after configuring the
settings gives you the best of both worlds–you have easily swappable
motors and persistent settings

Also is there a CTRE equivalent? I have looked through their documentation and can’t seem to find anything.

From my experience, CTRE devices automatically persist settings after
reboot/brownout.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.