Question on Falcon 500 Sensor Phase

We are testing Falcon 500 in closed loop velocity and motion magic mode. In KOP drive train setup, we had to invert the motor at the right side via .setInverted(true). Traditionally, we had to experiment .setSensorPhase’s value (true or false) to make sure the sensor is in phase. However, for Falcon 500, we observed:

  1. .setSensorPhase’s value has no impact on the sensor phase,
  2. the velocity reading from Phoenix Tuner is always negative if .setInverted is set to true. However, by following the instruction in " Confirm Sensor Phase using API" section, .getSelectedSensorVelocity(0) gives the positive velocity value when the voltage is positive. So API and Phoenix Tuner gives different reading

We verified this in two different setups: KOP chassis and single Falcon 500 motor. It is not consistent with CTRE documentation on “Adjust Sensor Phase”. In addition, regardless of .setSensorPhase’s value, the closed loop velocity and motion magic does work as we expected.

Did anyone observe the similar behavior as we did ? We want to make sure it is not our wiring issue.

1 Like

If using the integrated sensor, the sensor is guaranteed to be in-phase. The sensor phase setting is ignored if integ-sensor is selected. I thought that was documented but I don’t see it anywhere, so we’ll add it.

Because the motor is integrated, we ensure that positive voltage means positive velocity. Use setInverted to pick what you want to be positive direction, and the firmware determines the rest.

Makes sense?

Yes, make perfect sense. I didn’t see anywhere about Falcon 500 is always in phase and setSensorPhase has no impact. Thank you very much!

Another new and somewhat related feature of the TalonFX is specifying invert in mechanical terms. So when you choose the InvertType, you can specify CW/CCW instead of true/false (less guess and check).

This is a feature I’ve wanted for years but couldn’t quite accomplish (safely under all circumstances) with the older product line due to all the connection points.

https://www.ctr-electronics.com/downloads/api/cpp/html/namespacectre_1_1phoenix_1_1motorcontrol.html#ad3471ba7d755ae2b096107af74425646

ozrien,
We are using the WPILIB Characterization tool for motion profiling. We noticed the encoder values are reversed, and just like TigerVision changing the sensor phase has no effect. You said the firmware will automatically change the phase. For some reason, we are still getting reversed encoder values. Do you need to manually do a calibration or something to change the phase to be the same as the direction the motor moves?

Its not supposed to have an effect when using the integrated-sensor. The sensor and motor voltage are in phase already.

We didn’t develop that tool so I can’t speak to how it works. I suspect if you self-test (Tuner) the motor while driving it, you will find positive reported velocity when the motor output is positive.
The test procedure is here.

If the WPI tool is calling getSelectedSensorPosition(), than that number will match the reported sensor position under PID0 (primary).

If your issue is that the motor drives the robot backwards when you command a positive output, than most likely the motor Invert is wrong.

We also noticed encoder values were negative on one side when using the robot characterization tool. However , that didn’t seem to matter . We got what appear to be valid results on completion of the data analysis steps. The calculated gains were pretty close to what we ended up using.

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