Talon Fx labview problem

Hi, my team has recently managed to get a swerve but the code isn’t working as intended, when we try to control it it will refuse to rotate properly and we suspect it has something to do with the data type required byt the function, if possible could anyone tell us if they had a similar problem and what data type the function requires, if so thanks

You may have taken on a little more that you can chew at this point in the season. I hope not but at least you are giving it a go.

So, if you have a CTRE motor controller and it somehow rotates the wheel of your swerve then you need to translate the angle you want the wheel into the encoder position of the motor controller.

How you do this depends on a lot. But the main thing you need to figure out is for one full rotation of your wheel how many encoder ticks is that on your talon.

For simplicity lets say you have no gear reduction. You are 1:1. And lets say that one rotation is 2048 encoder values.

Then, if your wheel starts at 0 degrees when your encoder is showing zero then to command the wheel to go to 90 degrees you would seek a position of 512 on the motor controller.

Now on a CTRE motor controller, if you want to do position control, you have to follow their instructions on how to configure its PID control loop for position control.

And that is just the very start of this, there is a ton more to do to get swerve running.
You have to be able to control all four of your wheels in the same way.

You’ll need to get velocity control on all 4 of those same wheels working as well.

Then you have to code in the equations that translate joystick commands into movement (X/Y) translation and rotation.

You might’ve forgotten to use the “set pidf” vi to set PIDF gains.

Does it refuse do rotate at all, or rotates but isn’t accurate?

If the first (and you verify that you set PIDF as @MazeOfEncryption suggested), look at this thread Motors move only the second time we upload the code - #10 by Gilad

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