Log in

View Full Version : Jaguar current sensing technical details?


Ether
04-01-2011, 14:08
The Black Jag uses an INA193AID current-sense chip across a 0.001 ohm shunt in the high side of the bridge. The INA193's analog output is sent directly to an ADC pin in the Jag's LM3S2616 microcontroller, without any hardware (RC) filtering. And it doesn't appear that the INA193 itself is doing any low-pass filtering. The datasheet says its output bandwidth is 500KHz.

How does the the LM3S2616 firmware process this signal? Does it trigger the ADC samples to remain phase-locked with the bridge switching? Is it doing some sort of digital filtering?

Ether
04-01-2011, 20:00
Kevin Sevcik just posted this (http://www.chiefdelphi.com/forums/showpost.php?p=991244&postcount=11) interesting information.

Kevin just deleted his excellent post. The reason given was he posted it to the wrong thread. I hope it re-appears somewhere else soon. It had some fascinating info in it.

Kevin Sevcik
04-01-2011, 20:07
Kevin Sevcik couldn't decide where to put that post. It's now here (http://www.chiefdelphi.com/forums/showpost.php?p=991257&postcount=37).

kamocat
05-01-2011, 13:36
The INA193AID has a gain of 20V/V, with a typical output error of +-0.75%.
The full-scale input voltage is 150mV. That means it can detect up to 150A, if the resistor could handle it. 150A * 0.0075 = 1.13A. In other words, they should have used a larger resistor. Say, a 3 miliOhm resistor would cap off the measurement at 50A, and create only 0.38 A of error once amplified.
(Also note that the maximum error is 2.2%)

With that information, I would blame most of the inaccuracy of the current measurements with the Jaguar on the op-amp.
However, it might be good to look at the accuracy of the resistor as well. I wouldn't be surprised if these Jaguars have no factory-calibration.


Here's the schematic for the Tan Jaguar:
http://content.screencast.com/users/kamocat/folders/Jing/media/93b1094b-6101-4e56-98be-87c13729d4ea/00000108.png
Apparently it's just on the low side of the gate driver, with a 0.5 miliOhm resistor, so it only senses the current of the motors, not the device itself.
The FAN4174IP5X seems to function purely as a buffer; it does not appear to amplify.

I've attached datasheets for the INA193AID and the FAN4174IP5X.

Joe Ross
05-01-2011, 13:57
Marshal, your picture looks like the gray jaguar schematic (10/28/2008), while Ether's looks like the black jaguar's schematic (10/7/2009). Where did you find a November 2010 schematic?

kamocat
05-01-2011, 14:31
Oh, oops.
I got it from the RDK-BDC page, not the RDK-BDC24 page.
That would explain it.

I looked at the date again, and it actually said November of 2008. However, the Firmware Development Package is from November of 2010. The Firmware Development Package is probably exactly the same as is on the RDK-BDC24 page

I was wondering why they were using a Fairchild part. I would think TI would avoid that if at all possible.
I'm going to go back and edit my post.

kamocat
06-01-2011, 00:44
Two additional sources of error:

Brush commutation on the motor

The current shunt resistor is on the supply end of the H-bridge drivers; it is not subject to the motor impedance, because it is cut off from the motors when the FETs are in the OFF state.
What would the current through this resistor look like over a span of 200 us? (That is, 3 pulses at 15 khz)

Al Skierkiewicz
06-01-2011, 08:00
Marshall,
Part of the answer to your questions above, Luminary Micro was not a part of TI when the Jag was under development. The series resistance also affects the max current that the bridge is capable of delivering to the load. Raising the value of the sense resistor opposes the lower "ON" resistance FETs that were chosen for this design.
In the case of the Tan Jags, high current on a CIM (say 100amps) develops a significant amount of power in the sense resistor. It is a 2 watt resistor trying to dissipate 5 watts. In sustained pushing matches, the resistor heats up a lot and in some cases desoldered itself from the board.

Ether
06-01-2011, 11:11
Hi Marshal,

A couple of observations and a question:

Two additional sources of error:

Brush commutation on the motor


The Brush resistance is in series with the current sense resistor so it shouldn't cause error in the current sense resistor's reading.

The current shunt resistor is on the supply end of the H-bridge drivers; it is not subject to the motor impedance, because it is cut off from the motors when the FETs are in the OFF state.

It's on the high side in the Black Jag.

In the Tan Jag, it's on the low side.

Either way, the current sense resistor is not in the current path during the OFF portion of the duty cycle. See attached images. For simplicity, I showed path through only one FET of each pair, and only for + currents. Green path is during ON portion. Blue path is during OFF portion (for high-side switching). Red path is during OFF portion (for low-side switching).

I don't know if the Jags use high-side, or low-side, or some other switching method. Does anyone know, definitively, what switching method the Jags use? I've heard many different claims.


What would the current through this resistor look like over a span of 200 us? (That is, 3 pulses at 15 khz)

Good question. I'd like to see some actual data. I did a simulation with the Black Jag with a CIM with locked rotor (no back emf) and included the CIM's resistance and inductance, and included the Zener diode voltage. I'd like to see how it compares to actual data.

Kevin Sevcik
06-01-2011, 12:57
From reference design source code, the Tan Jags pulse the high side FETs and leave the low side FETs on during a PWM cycle.

kamocat
06-01-2011, 23:45
From reference design source code, the Tan Jags pulse the high side FETs and leave the low side FETs on during a PWM cycle.

How does it do that?
Is it modulating the Output Disable pin?

Kevin Sevcik
07-01-2011, 00:03
Why yes, yes it is. Don't ask me why, but that's what the code in the tan jag does. They could just as easily modulate the pwm pin, but they don't for some reason. Perhaps the driver doesn't have adequate shoot through protection.

kamocat
07-01-2011, 00:06
No, they can't modulate the PWM pin. If they did, that would be locked antiphase, because the MOSFET driver would alternate between driving the low side and driving the high side.

Kevin Sevcik
07-01-2011, 00:33
No, they can't modulate the PWM pin. If they did, that would be locked antiphase, because the MOSFET driver would alternate between driving the low side and driving the high side.
Oooookay. Too much crosstalk that's off-topic for this particular thread. I'm officially vetoing any further PWM control discussion in this thread and picking it back up in the Modeling motor control (http://www.chiefdelphi.com/forums/showthread.php?t=88193&page=5) thread. I'll see everyone over there.

kamocat
07-01-2011, 01:02
Sure. I'll refocus to the intent of this thread.

Why do you think the Jaguar has so much noise in its current measurement?
This graph from the INA193AID datasheet might help:
http://content.screencast.com/users/kamocat/folders/Jing/media/bb1fa389-9194-4fc4-87f2-15eb1201513c/00000109.png
With a 0.001 ohm resistor, 1mv input equates to 1A.

Kevin Sevcik
07-01-2011, 11:29
Actually, I'd look move to pages 8 and 9 of the data sheet, on "Accuracy variations as a result of Vsense and common mode voltage".

This amp is apparently most accurate at sense voltages >20mv. Which equates to 20A for us. There's 3 operating cases in this range, and we're not in the worst... So it could be worse? I've attached a snapshot of an example graph. What it boils down to is that the amp goes non-linear below 20mv, and eventually lands on some positive offset voltage at the output, instead of zero. They state the worst case zero offset at the output is 300mv. It looks less linear the closer you get to 0 Vsense, so that's exciting too.

Oh yeah. And both Jags record a zero offset for the current ADC on power up, and then subtract that from current readings forever after. So if you end up with the worst case 300mv offset, then your readings above 20A will read 15A low. We're probably not getting this worst-case scenario, but that's obviously going to affect the accuracy of ALL the current readings. Better might be to just assume/hope that you have little absolute error in the ADC, and just use the zero offset as a linear correction below 20mv Vsense.

Maybe FIRST will let us modify the Jag firmware this year?

Yeah, you're right. That's never gonna happen.

EricVanWyk
07-01-2011, 11:43
Maybe FIRST will let us modify the Jag firmware this year?

Yeah, you're right. That's never gonna happen.

But TI can modify it. Perhaps you could submit the change to them. Bonus points for sending code with the request.

Kevin Sevcik
07-01-2011, 13:06
But TI can modify it. Perhaps you could submit the change to them. Bonus points for sending code with the request.
Oh certainly. I'll probably try playing with some of our jags sometime this season or after and see how trustworthy the current sense is and how good a fix my proposal is. My only concern would be that I'll be modifying the reference firmware and this all might not apply to the FRC firmware. I'll have to see if they're willing to release that source code to interested parties.

kamocat
07-01-2011, 13:46
Actually, I'd look move to pages 8 and 9 of the data sheet, on "Accuracy variations as a result of Vsense and common mode voltage".
Where did you find this datasheet? It's certainly not the INA193AID one I attached.

Al Skierkiewicz
07-01-2011, 13:53
Kevin,
The reason for the non linearity is the device's inability to drive the output to zero volts. The specification is for a minimum of 3 mV typical but can be as high as 50 mV. The TI datasheet on page 4 has a very descriptive curve showing the errors. In applications where minimum errors are needed, designers would usually add a biplolar power supply to allow driving to zero volts.
http://pdf.chinaicmart.com/3AI/INA193AIDBVR.pdf

Ether
07-01-2011, 15:10
See attached images. For simplicity, I showed path through only one FET of each pair, and only for + currents. Green path is during ON portion. Blue path is during OFF portion (for high-side switching). Red path is during OFF portion (for low-side switching).

I don't know if the Jags use high-side, or low-side, or some other switching method. Does anyone know, definitively, what switching method the Jags use? I've heard many different claims.


Kevin Sevick has posted information (http://www.chiefdelphi.com/forums/showpost.php?p=992255&postcount=66) about the Tan and Black Jag switching.

I could not edit my earlier post (http://www.chiefdelphi.com/forums/showpost.php?p=991930&postcount=9) in this thread to reflect this new information, so I am attaching an updated image here.

Also, there's an error in the Tan Jag image. The blue line should be shown going through the Q10,11,&12 FETs, not their Zener diodes.

Kevin Sevcik
07-01-2011, 16:29
First, here's the datasheet I'm working from. The latest and greatest from TI itself:INA193 datasheet (http://www.ti.com/lit/gpn/ina193)

I see the note about the swing range of the output, but there's additional notes just above that and on page 8 and 9 that declare the output bottoms out at 300mV typ. Perhaps the 300mV thing isn't the dominant issue and it really will swing down to 3mV with increased error. It's kinda hard to decide, which all the more inclines me to just empirically test the thing.

kamocat
07-01-2011, 17:12
Actually, I'd look move to pages 8 and 9 of the data sheet, on "Accuracy variations as a result of Vsense and common mode voltage".

This amp is apparently most accurate at sense voltages >20mv. Which equates to 20A for us. There's 3 operating cases in this range, and we're not in the worst... So it could be worse? I've attached a snapshot of an example graph. What it boils down to is that the amp goes non-linear below 20mv, and eventually lands on some positive offset voltage at the output, instead of zero. They state the worst case zero offset at the output is 300mv. It looks less linear the closer you get to 0 Vsense, so that's exciting too.

The accuracy of the INA193−INA198 current shunt monitors is a function of two main variables: VSENSE (VIN+ − VIN−) and common-mode voltage, VCM, relative to the supply voltage, VS. VCM is expressed as (VIN+ + VIN−)/2; however, in practice, VCM is seen as the voltage at VIN+ because the voltage drop across VSENSE is usually small.
This section addresses the accuracy of these specific operating regions:

Normal Case 1: VSENSE ≥ 20mV, VCM ≥ VS
Normal Case 2: VSENSE ≥ 20mV, VCM < VS
Low VSENSE Case 1: VSENSE < 20mV, −16V ≤ VCM <0
Low VSENSE Case 2: VSENSE < 20mV, 0V ≤ VCM ≤ VS
Low VSENSE Case 3: VSENSE < 20mV, VS < VCM ≤ 80V


So we're in Low VSENSE Case 3, where VCM is greater than the 5v supply voltage? That must be why they measure current on the high side.

Above 20A, then, this current measurement is incredibly accurate; within %0.001 if your battery is at 11.5v or greater.

Oh yeah. And both Jags record a zero offset for the current ADC on power up, and then subtract that from current readings forever after. So if you end up with the worst case 300mv offset, then your readings above 20A will read 15A low. We're probably not getting this worst-case scenario, but that's obviously going to affect the accuracy of ALL the current readings. Better might be to just assume/hope that you have little absolute error in the ADC, and just use the zero offset as a linear correction below 20mv Vsense.

Except for that. They just made it measure low for the WHOLE range. So that means, if you get a reading of 5A or greater, you need to add 15A to make it accurate. XP

Wait a minute. Where did you get the 15A? I see 0.3v on the graph, which equates to 30A.

Kevin Sevcik
07-01-2011, 17:55
Wait a minute. Where did you get the 15A? I see 0.3v on the graph, which equates to 30A.300mV on the output / 20V/V = 15mV = 15A

Again, this is all kinda theoretical. I'd really like to check it all with an actual amp meter. After all, they note the 300mV on the output as a worst case.

kamocat
07-01-2011, 18:45
300mV on the output / 20V/V = 15mV = 15A

Again, this is all kinda theoretical. I'd really like to check it all with an actual amp meter. After all, they note the 300mV on the output as a worst case.
I messed up again! (I'm starting to get used to this) I mean 3A, not 30A.

You're right according to the 20V/V spec on the datasheet, but the graph shows 100V/V.
(At 20mV input, it says there's a 2V output)

It appears this datasheet conflicts with itself.

EDIT:
Would you say a Fluke 179 would work for measuring current? Or would you prefer a 0.01 ohm current shunt with analog meter?

jhersh
08-01-2011, 01:27
My only concern would be that I'll be modifying the reference firmware and this all might not apply to the FRC firmware.

The FRC firmware is directly based on the reference firmware. The only goal of the separate version is to ensure safety (DS / FMS in control). As such you can assume that other aspects of the firmware are the same as the RDK.

I'll have to see if they're willing to release that source code to interested parties.

In my experience, that's very unlikely.

Al Skierkiewicz
09-01-2011, 07:55
[QUOTE=kamocat;992566]
You're right according to the 20V/V spec on the datasheet, but the graph shows 100V/V.
(At 20mV input, it says there's a 2V output)

[QUOTE]

The graph(s) is data for three different devices. You have to be careful to look at the 193 (20v/V) graph only.