# Current Limiting TalonFX values

If the current going on the input side of the falcon is different than the one going on the actual motor, if the main goal of my current limiting is to prevent the main breaker from tripping which talonfx feature should I use to limit the current draw, supply or stator?

In addition I really don’t know which values to start my tuning with, I know how many amps the motor can draw and for how many seconds it can hold that current before the main breaker will trip, but the current limiting takes place only after exceeding the peak current. So if 3 seconds at x current trips my breaker the falcon can draw x*2 and will trip my main breaker before the limiting takes place.

Thank’s for taking the time to help me I truly appreciate it!!!

Regarding breaker trip times, see my post here: Power Draw from Motors

1 Like

Thank you this was very helpful.

I do have some follow up questions.

First of all I’d how did you calculate the voltage drop?
And does brownout occurs at the exact moment I drop below 6.8 volts?

I’m still very confused about what value the peak current should be as well as the peak current time since the time until the talon current limit kicks in doesn’t scale with the current value so in theory I can draw more the peak current for the peak current duration and reach brownout.

The documentation page on brownout also has a bit more info. Yes, brownout happens when the RoboRIO sees the voltage drop below 6.8 volts–it’s not instant but is quite fast (10 ms?). Once it’s in brownout, the controller won’t go out of brownout until the voltage goes above 7.5V.

The voltage drop for brownout is calculated with Ohm’s law (voltage = current * resistance) for the path from the battery to the RoboRIO. The RoboRIO part of the path doesn’t have much drop (low current, low resistance), so the critical part is from the PDP to the battery, including the battery internal resistance and connectors, etc. You need to break out the parts to find total resistance. A “typical” max for battery internal resistance is 20 mohm (more discussion in this thread). 6 AWG wire is 0.4 mohms/ft, 4 AWG wire is 0.25 mohms/ft. SB-50 mated connector is around 0.2 mohms.

1 Like

There are two important reasons to enable current limiting.

1: Protect individual motors and the linked controllers from burnout due to unnecessary power consumption.

TalonSRX, VictorSPX and SparkMax motor controllers are rated for up to 100A in short bursts.

That’s great news. Sort of.

However, the motors are the business end of that consumption, the Neo, 775Pro and other popular motors can call for that kind of power, they don’t tolerate those levels for very long before they smoke. Vex has some interesting data on these motors that I highly recommend you review. It will further underscore the rational for imposing current limits on individual motors.

2: You need to factor in the max current draw of the physical plant to prevent brownout.
Thing to keep in mind here: Brownout the VRM < 7.0V is a 30-sec POST cycle per brownout event. One or two of those in a match make you not very helpful to the alliance.

Pay attention to your battery. Beak them between matches and log the data. If you start to see 25 - 28 mOHM of internal resistance over it’s life cycle then it is entering the danger zone for brownout if your physical plant current limit is not capped at 200A.

I invite you to use a copy of our battery log to assist in this.

1 Like

The VRM minimum input voltage is 5V, not 7V.

Thank you for your help. I’m still confused by the ctre tutorial on current limit.

The max current draw is the sum of the current on the output side of the motors(what ctre refers to as stator current draw)? , or a sum of both the stator and supply current? I’m pretty sure it’s not the sum but I just want to make sure I know how that works.

I am familiar with the vex motor testing and with the thermal braker graph (it doesn’t trip immediately when reaching it’s limit value) and thanks to you with the rio brownout. But I don’t know which values to put in my current limit config. If I can get kind of a walk-through on how one would calculate the continuous current limit, peak current and peak current duration that would be great.

In a perfect world power in = power out. V=I*R Ohms law applies.

Consider there is nominal current draw for administrative functions of the controller and the MOSFET bridge circuit. The controller will report to the drive station current throughput of that loop. The end result reported is the sum total of the motor draw and the administrative current draw of the controller.

Another way to look at this: If the reported current demand of the motor current loop (controller included) is 100A and say you can accurately measure (by a in line shunt or hall sensor clamp) 99A at the motor terminals. Then the controller is dissipating ~12W of power while supplying current to the motor. That will make the controller hot in a very noticeable way.

Adding this this post because I didn’t intend to blow by the request for code that sets limits on supply current to a motor. Full disclosure, I am not a programmer and I am not the one to offer specific code examples for imposing current limits that will be helpful.

I am an advocate to our programming sub-team to add current limiting on all controllers, keeping in mind the big picture of avoiding a brownout at all cost.

From the ctre tutorial I understand there are 2 limits I can perfom.
On the input side and the output side.

So I do understand that current is being drawn not just by motors but there is a small amount drawn from other components but I’m trying to figure out what do ctre mean by input side current and output side current, are the two just different ways of looking at the same current or are they different? Which one should I limit to prevent brownout, is it both of them or does one limit affects the other and how?

I don’t have a background in electronics just a basic understanding so I really do appreciate taking the time to help me.

The two current measurements are fundamentally different.

The supply (input) current measurement is the value most people are familiar with, since that’s what was measured by Talon SRX. It’s the value of the current being drawn at the input bus voltage (which matches the current drawn through the PDP channel).

The stator (output) current is a measure of the current being drawn by the motor, which is usually at a different voltage (whenever you’re not at 100% output).

Since power in has to equal power out, the current values are also usually different.

Math on why they're different (Click to Expand)

Couple of examples:
I’m ignoring heat and assuming power in is perfectly power out, it makes the numbers nicer.
Also, I completely made these numbers up for math purposes - they’re not real-world numbers at all.

Assume you have a Falcon that’s running at 100% output. The supply current is measured at 15 amps. Because the output is 100% the input and output voltages match, meaning the stator current will also be 15 amps.

Now assume the Falcon is running at 50% output. The supply current is measured to be 20 amps and the input voltage is 12 volts. The output current would be measured at 40 amps.
How?
Since Power(Supply) = Power(Stator), 12V x 20A = (12V x 50%) x (Stator Current).
ie, since the output is at 50% (half), the output voltage is half the input voltage which means the output current is double the input current.

Now which current should you limit for which situations?
We cover this piece in our docs (https://phoenix-documentation.readthedocs.io/en/latest/ch13_MC.html#new-api-in-2020), but I’ve paraphrased it below.

The stator current limit is what limits the motor. So if you want to limit acceleration, motor heat, etc. you should limit the stator current.

The supply current is the same as the current being drawn through the PDP, so this is what you should limit to prevent breaker trips.

1 Like

Hi @Jacob_C , does CTR have a plan to update the public-facing New API section with more detail for the FX?
This simply isn’t enough information for me to implement any current controls using our team’s Falcons, and I’m a professional electromechanical product engineer…

1 Like

We can add an FX-specific current-limit code-snippet in the doc though. Then we’ll close that issue.

2 Likes

Thanks Omar! The super-accessible code examples for the TalonSRX current limiting in
the SRX User Guide were a fantastic asset when we started using that hardware a few
years ago, looking for something similar here with the updates to the FX.

(This is the first time I used the actual API documentation, I wish there were links from RTD into the API docs but that’s probably too heavy a lift to maintain long-term)

1 Like

Thank you, there is still one thing that is confusing me that I think the answer to the following question will help me figure out.

Again, assuming there is no heat and power in equals power out and I have 1 motor only on my robot.

The 1 motor is the one you mentioned here, 20 amps on the input side and 40 on the output.
What will be the total current draw from the pdp to the battery?

Limiting the current has two functions.
One function of current limiting is to control the behaviour of mechanism being powered

• Limiting the current limits the power output of the motor and thus directly affects how your mechanism accelerates

A second function of current limiting is to protect your equipment

• Limiting the stator current protects the motor controller
• Limiting the stator current limits the motor heating, protecting the motor
• Limiting the supply current protects the power system upstream from the controller
1 Like

20 amps. Suppy current is the current drawn from the supply side of the MC. Aka the input current. That’s why supply current limit should be used to prevent breakers from tripping.

1 Like

That helps thank you so much!!!

So to prevent brownout I need to limit the supply current

In what scenarios would it be recommended to set an output current limit? I’m assuming the default limits plus thermal shutdown will be enough to stop the motor from killing itself?

1 Like

Current is proportional to force applied, so it could be a method of limiting the force applied by the motor.
Say you want to be pushing in a direction but only by a few pounds - drop in an output current limit.

2 Likes

The default current limits are both off.

The design-strategy of Talon FX is to prevent motor/electronics damage when used on an FRC robot, regardless of:

• your software-configuration, default or otherwise
• how you wired it, (reverse power, etc.)

To be clear, there isn’t a “wrong setting” that will damage it.

Use supply current limit if you want to prevent breaker trips.

Use stator current limit for limiting acceleration/torque. Some prefer this over classic voltage-ramping. This limit also controls the amount of brake during neutral (if brake is enabled). So you’ll notice the neutral-brake (when motor output is zero) can be softened by enabling and lowering the stator current limit.

1 Like