Hi Folks,
Great to be here, and this is my first post!
My company Pangolin manufactures laser equipment, including servo drivers and laser scanners.
We use LM3886 as a part of our servo driver. Our servo driver is like an audio amplifier, and our scanner (motor) is like a speaker. Our laser scanners have impedance properties similar to a speaker, so the LM3886 works well for this application.
The LM3886 is incorporated into a digital servo driver. This servo driver has a multi-channel A/D, and with a high sample rate, we digitize both the voltage coming from the LM3886 output, and also the current flowing through the scanner's coil (current that is ultimately provided by the transistors in the LM3886).
Digitizing the voltage and current provides great insight towards our servo system operation. I can graph these over time, and create oscilloscope waveforms of various quantities, including this voltage and current. We can also perform "math" on these, and graph related quantities.
For example, we calculate the average power dissipated (heat generated) by our scanner (like the speaker in an audio system). To accomplish this, we simply do RMS Current squared, multiplied by the coil resistance. (One way to get Average Power is I^2R.) Since we digitize the current, it's easy to do an RMS computation on the samples and obtain that quantity.
We'd also like to calculate the actual power dissipation (i.e. heat generated) on the part of the LM3886. In other words, I'd like to calculate the average power. But for the power amplifier, I'm having trouble wrapping my head around how to do that. It seems a bit more tricky.
The question is about calculating power dissipation (watts) in real time based on data samples.
-------------------------------------------
As I mentioned, our servo driver has digitizes both the voltage that is output from the power transistors to the motor coil (we call this "Instantaneous voltage") and also the current flowing through the motor's coil (we call this "Instantaneous current"). We sample these quantities very often, so at all times the servo driver is aware of the instantaneous voltage and current.
I'd like to calculate the heat generated by the power transistors while they are supplying current to the coil.
Presently my way of calculating this is shown below.
if(InstantaneousCurrent >= 0)
{ //Current is positive -- must be coming from the positive transistor
InstantaneousTransistorVoltage = (PositiveRailVoltage - InstantaneousVoltage); //For example, 24 - 21 = 3V
InstantaneousTransistorPower = InstantaneousTransistorVoltage * InstantaneousCurrent; //For example: 3V * 3A = 9W (Power = Voltage * Current)
}
else
{ //Current is negative -- must be coming from the negative transistor
InstantaneousTransistorVoltage = (NegativeRailVoltage - InstantaneousVoltage); //In this case transistor voltage will be negative (-24V - -21V = -3V
InstantaneousTransistorPower = InstantaneousTransistorVoltage * InstantaneousCurrent; //For example: -3V * -3A = 9W (Power = Voltage * Current)
}
AverageTransistorPower += CurrentFilterConstant * (InstantaneousTransistorPower - AverageTransistorPower);
So, in other words, for each sample, I take the instantaneous voltage through either the upper transistor or lower transistor as applicable, and multiply it by the instantaneous current to obtain an "InstantaneousTransistorPower", and then average that over time.
Alternatively I could calculate the heat in the upper transistor if(InstantaneousCurrent >= 0), or heat in the lower transistor, and then sum the two together.
Either of these techniques make intuitive sense to me.
--------------------------
But then, just today, while searching for "calculating average power", I see "Average power = VRMS * IRMS". So, they're multiplying the RMS of each.
My code presented above above makes intuitive sense, but it deals only with the average. So it would be like "Average Power = Average Voltage * Average Current". For sure Average isn't the same as RMS.
So here's the question for all of you folks on DIY Audio: Should I be calculating the RMS voltage that appears across each transistors, and multiplying that by the RMS current flowing through each transistor (and then summing the upper and lower transistors)?
Note that sometimes the current flows through the positive transistors, and sometimes through the negative transistor. In the case of the LM3886, both are in the same physical package so I don't care too much, and it's all about the heat that is being generated, and thus must be dissipated by the user.
---------------------------
Best regards,
William Benner