Talon SRX Motor Current

It there a way to read the Motor Current Amps while motor running.
via CAN on Talon SRX Motor

Use the PDP singleton class and the getCurrent(channel) method.

I found C code examples

Anybody can give tips or examples on JAVA…

Here’s the Javadoc link:

http://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/first/wpilibj/hal/PDPJNI.html#getPDPChannelCurrent-byte-int-

Or you could use the CAN Talon’s internal current sensor:
http://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/first/wpilibj/CANTalon.html#getOutputCurrent–

Alternatively, you can just call:


myTalon.getOutputCurrent();

We were able to use to myTalon.getOutputCurrent();

This worked out well for Dual Motor Shooter…

We found One Motor has lower current and thus shooter was spinning balls to one side.

We adjusted the Each Motor Speeds via motor current since we dont have encoders…
So for a quick an dirty shooting with dual motor use motor current feedback to fine/tweek the shooter shoot direction…

The Talon SRX has a current PID mode as well. Might be worth looking into.