I’m not sure what the behavior of the CTRE Motion Magic Phoenix- Labview examples should be. We tuned all of the variables described in the software manual and can get the motors to reliably stop at the desired position when we press and hold button 0 to engage motion magic and pull the joystick to full power until it reaches the desired position.
However, if we reset the encoder to zero and try again the motor drives backward a little and stops before we apply power.
The joystick does not command the system in power when motion magic is engaged. The joystick is an analog source of positions. Is the joystick value at rest maybe slightly negative. So when button 0 is pressed the command position is not zero but something else.
We use Motion magic to position our lift. Using Java
That helps. I think I get the logic now. The spreadsheet was also really helpful. I got the robot to react perfectly using the CTRE example. However, I’m having trouble implementing it in our team’s code. It acts like a PID closed loop without the benefit of Motion Magics ramp up/ramp down. I’ve attached a picture of our code. Any thoughts?
Also, in Section 12.6.3 where did the value 1023 come from in calculating f-gain?
We have always run our auto routines using encoder values alone. For example, drive forward 600000 encoder ticks and stop. As you know this is not very reliable. We would like to use Motion Magic to be more accurate and eliminate wheel spin at the beginning of auto.
I have propped the wheels off the ground of our 2018 practice robot. I am only driving the left side drive wheels. I am using it as a test base to learn Motion Magic.
In the attached program I want to drive to 600000 encoder counts with a smooth ramp up to eliminate wheel slip and a smoother ramp down to help achieve the target of 600000 encoder ticks.
At this time the robot completes the goal using the CTRE example, but it doesn’t accelerate slowly as it does when we use the CTRE example.
I don’t believe Motion Magic is a good application for drivetrains. I suppose it would and will work but Motion Profiling seem to be what teams use in this situation.
Also, in Section 12.6.3 where did the value 1023 come from in calculating f-gain?
Looks like either I have the chapter references wrong or they where shifted from an older manual when I created this. Looks like its 12.6.4 now. The 1023 are the native units the SRX would get if set to 100% output. I’m can follow Labview somewhat and promises I will likely now at least install it on a PC soon to look at the samples. Could you try to set a crazy hi Max Acceleration to make sure things are working?
Since I don’t have Labview can you post a screen shot of the sample VI?
? So the labview sample doesn’t use the joystick to command a variable distance to goto but instead gets the encoder ticks from the number box on the UI? Or is the UI displaying the( joystick value × encoder counts per rev × 10)
After that…
The question now is what is different when you run the sample that works and your modified code. Are you selecting different encoder type ie ctremagencoder vs quad…