Open Philanatidae opened 6 years ago
We could also apply a bit or resistance in the opposite direction to bring the robot to a stop faster. It will be tough on the motors, but shouldn't do any short-term damage.
That is true. However it may be difficult to integrate with the motion profiling library being used (Jaci's Pathfinder). Though, it doesn't appear that the Talons are being set into "brake mode" in the code. Turning this on during the motion profiling (enable brake in initialize()
and disable it in end()
so that teleop control remains the same) may have an effect as well. That way the motors resist themselves instead of drawing current in reverse (as well as playing nicely with Jaci's Pathfinder library). Something to try, at the very least.
I found this on https://github.com/CrossTheRoadElec/Phoenix-Documentation:
/ Displaying the two neutral mode options that both the Talon and Victor have / Hardware.Talon.setNeutralMode(com.ctre.phoenix.motorcontrol.NeutralMode.Coast); Hardware.Talon.setNeutralMode(com.ctre.phoenix.motorcontrol.NeutralMode.Brake);
I'll try putting it in the MotionProfileTurnCommand
The current acceleration for the motion profile trajectories is currently 5ft/s/s (or so). I suspect, after re-watching the matches, that both the practice bot and comp bot can accelerate faster than this, although I don't know how much by. It is probably closer to 10ft/s/s (0ft/s to 8ft/s, which is the speed of the bots, in about 0.8s) or faster (might be up to 16ft/s/s). This would probably need to be experimented with (too high and it will coast to an unpredictable distance), but making this value as high as possible should speed up the paths fast enough such that the cross-over autos can be done in under 15 seconds.