We are using a a MotionMagic control mode for our elevator this year. Everything appears to be working correctly, however I cannot run the Elevator down after it reaches a target position above where it was. How can I get it it to lower with the same control mode?
You should be able to just send it a new target position. For instance our elevator starts at target position 0 and to go up we specify a target position of 1000. To bring it back down we just specify a target position of 0. We don’t mess with the cruise velocity or acceleration after we initially set it.
This is incorrect. Cruise velocity and acceleration should remain positive for all MM cases.
To OP: Got any source code? Have you tried tying the target position to a joystick axis and seeing if it works then?
Is your Talon “in phase” with your encoder. i.e. Green Talon lights = Encoder values go up, red lights - encoder values go down.
You set the follower mode of a Talon way back when you open the master. It’s a one-time configuration at start-up.
Acceleration and Cruise are also always positive and also a one-time configuration at start-up.
Check all the configuration values of your Talon using Phoenix Tuner. Make sure you have no soft limits enabled that would be causing this. Make sure you have nothing set to limit maximum voltage in one direction or the other.
All I can think of that would trip up MM off the top of my head.
If you are still stuck after trying all these things take screen shots of your talon config. Do a self-test while running MM and take screen shot. Post it the screen shots here. If your code is available on github add a link. The more info you provide the better people can help you figure out what is going on.
After a lot of testing and me getting distracted I learned that I had my limit switch code goofed up, and the MM control scheme works great on our practice frames. Thanks for the help. That being said in the future test it without any limiting code, and do no make your Velocity and Accel. negative.