Sanity check on Talon SRX position control

Hi All,

On the last day of the build I was trying to get some of our auto code working. We are using four Talon SRX with one encoder on each side. On each side one Talon is setup in position mode with a slave follower.

I tried a simple test of just commanding the robot to drive straight two wheel rotations. I found that the performance of the motors on each side of the robot perform differently causing the robot to first turn and then straighten it self out. Sometimes it would work perfect, sometimes turn left, sometimes turn right. Pretty much always get a near zero error once stopped, but often not lined up with the target.

it appears from the web app that both sets of controller are referencing bank 0 for cal parameters. Just driving the robot using percentVbus is quite easy to drive the robot straight using arcade drive.

Is it reasonable to use position mode to drive the robot say 5 feet straight ahead and expect good accuracy in both distance and straightness?

Thanks.

Chris

No; as you noticed, if the wheels move at different speeds, one will stop early and the other will continue until you’re facing the correct direction, but not in the correct location. (Assuming negligible slip)

Put the controllers in speed mode. Your RIO-side periodic function can then shut off both when you reach a given distance, or better yet, taper the speed down to just a bit above zero as you approach the target.

Here’s an illustration.

*Would the SRX Motion Magic mode be an appropriate solution for this problem?

It uses a trapezoidal velocity motion profile. Might keep both sides synchronized.

Try the same test, but instead of just commanding a step change of 2 rotations, update the command gradually every 20ms.

Is it reasonable to use position mode to drive the robot say 5 feet straight ahead and expect good accuracy in both distance and straightness?

Try it with a motion profile.

*

2 rotations in 3 seconds.xls (28.5 KB)
5 feet in 4 seconds.xls (62.5 KB)


2 rotations in 3 seconds.xls (28.5 KB)
5 feet in 4 seconds.xls (62.5 KB)

Thank you. It sounds like you guys are saying that it is expected to have some reasonable variance between the two sets of controllers.

I was hoping that they would be close in performance barring any variance in friction and motor tolerances.

I was hopeful because using arcade drive to drive straight ahead using the percentVbus actually works quite well for directional correctness. I just don’t know how far I went due to changes in the battery.

Chris

Thanks for the idea. I will look into the motion profile. I have not had a chance yet. Might be too late for this year since we only have one robot, but always learning.

*Here’s a very simple and easy-to-use Win32 console app that computes a very smooth motion profile suitable for driving a known distance forward in autonomous.