Log in

View Full Version : Talon SRX Motor Current


Trapazium
22-04-2016, 09:06
It there a way to read the Motor Current Amps while motor running.
via CAN on Talon SRX Motor

nickbrickmaster
22-04-2016, 09:13
Use the PDP singleton class and the getCurrent(channel) method.

Trapazium
22-04-2016, 09:26
I found C code examples

Anybody can give tips or examples on JAVA..

nickbrickmaster
22-04-2016, 10:17
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-

James Kuszmaul
22-04-2016, 10:20
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--

Pault
22-04-2016, 10:20
Alternatively, you can just call:


myTalon.getOutputCurrent();

Trapazium
24-04-2016, 20:10
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...

nickbrickmaster
24-04-2016, 21:09
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.