Hello, I am a programmer from team 1577 and we are having problems with the new Talon SRX CTRE libs for LabVIEW, we are trying to use the motion magic function, however, one of the encoders is reversed and we need to invert it, we tried the Set Sensor Phase function but it does not effect the reading at all when true and when false, neither does the Invert for motor function or the regular invert in the Open function (we can invert the value we send to the input set function for the motor, but the problem isn’t the motor, the problem is the encoder that is updating to the opposite direction). If anyone knows how to make those functions effect the encoder it would be very helpful.
Have you updated the firmware on your SRXs as well as your development environment? I seem to recall that last year inverted sensor did not work in some of the more advanced modes, though this year’s documentation says it works in them all.
I updated all of them just yesterday, and we have all of the most recent versions for the softwares…
I don’t have one in front of my but isn’t that something you can check in the roboRIO WebDashboard? Does everything look good there? What do you see there?
We will check it but there isn’t much about the encoders, I can see their versions, some details and configure their PID and I think (I am not sure, I am not in front of the roboRIO WebDashboard) we can also configure their drive mode, brake/coast or something like it…
Maybe there is a bug in the CTRE libs ?..
As Oren said, we updated the firmware and the framework, but still can’t invert neither the motor or the encoder phase.
Have any of the team that using LabVIEW encounter in a similar problem? If so, how did you fix it?
For teams that their code work fine, can you send a snippet of your code (begin& teleop\periodic\auto)?
Thanks!
Thanks Omar! Problem solved.
We’re having a similar problem but with Java. We’ve updated our software and our plug-ins but we don’t seem to notice any changes when we invert the motor.
Following Omar’s link, this is a similar directory. I’d take a look here first.
Can someone point me to which VI contains the invert feature here? It isn’t really clear to my programmers where to look. This seems to be much harder than it needs to be.
Here’s where the menus lead to Set Invert…
There are actually several different paths you can take through the menus to get to the Talon SRX/Victor SPX specific menus. The first is found through RobotDrive, the second and third attachments are found through the Actuators.
Ignore the links with oversized question mark. Those look like old deadends that weren’t cleared out.
The third party palette in the main WPILib palette works fine for me.
Thanks for starting this thread. We were uttering that phrase a ton last night.
On the CTRE_Phoenix_MotorController_Get_Enhanced.vi we were in Quadrature mode. Didn’t see the sign change on the position output until we changed it into Sensor mode as indicated in the Sensor Phase and Motor Invert example.
Thanks Omar! Problem solved.
Edit: Ignore this post. Turns out, someone added another secret setSensorPhase call in the program. We are getting the desired behavior but just calling sensor phase one at beginning to make sure things are in phase (though inverted) and then calling setInverted inverts everything.
Perhaps should create a new Thread in Java section, but will throw this here for now.
The team I am working with has setup their drivetrain with TalonSRXs. As expected, the values on the left and right side are inverted. That is to say, sending a positive signal will cause the robot to move forward on the right as well as cause the right encoder to increase its value while sending a positive signal will cause the robot to move backwards on the left as well as cause the left encoder to decrease it’s value.
As is, this system is “In Phase.” However, it can be annoying to reason about a system like this and we would like to flip the left side so that sending a positive signal causes both sides to move forward.
We have tried the following code:
leftMaster.setSensorPhase(true);
leftMaster.setInverted(true);
leftSlave1.setInverted(true);
leftSlave2.setInverted(true);
The behavior we are seeing is that the left side is now moves forward when given a positive signal, yet calling
leftMaster.getSelectedSensorPosition(0)
still yields negative output. The left side is now, out of phase. We have also tried calling setSensorPhase(false) and not calling setSensorPhase at all but we are getting the same behavior in all these cases.
Can anyone answer about the motion magic example what to do to get it working and what to expect?
Nothing happened with button 0, but I’m thinking I missed setting a P Gain, so I’m guessing that was what I missed.
Once I do that, I expect it will move between +10 and -10 rotations when I hold the button and move the joystick to its extents, but I’m not really certain.
This is my next step after getting the rs7 encoder working with the talon and in phase with the motor, using the mentioned example VI.