This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMCS1101: offset and accuracy

Part Number: TMCS1101

I am using a TMCS1101A4B in this way:

The 0-3.3V signal into the ADC looks like this with no load:

And like this with a 44mA load (24VAC @ 60Hz):

With no load, I see ~85mV lower than the expected 1650mV.

  • I can simply shift the values by that much, but since I don't know where it comes from, I worry it will vary in the future.
  • Should I have my device self calibrate on startup before there is a load? Even then it could vary later. Best I can do is maybe find a time with no load once/day.
  • Is such adaptive calibration typically needed, or is something going on with my implementation?
  • Since I'm computing RMS, any offset error is amplified.

Wait, what if I used max peak-to-peak over 5-10 seconds instead? Then there's no offset/calibration needed. This seems to be working pretty OK:

float mV = (adcMax - adcMin) / 2 / 4096.0f * 3300; // 12-bit ADC.
float mA = mV / 400 * 1000; // 400 mV/A sensitivity.

With no load I'm seeing 4 to 6mA (1.61 to 2.42mV).

With a 44mA load (24VAC, 546ohm resistor) I'm seeing 38.27 to 44.31mA (15.31 to 17.72mV). This is much better than other things I've tried. I'd like it to be more accurate, but it's sufficient for the range I care about: 150 to 400mA (though I haven't tested that high yet).

Two questions then:

1) Does the approach seem good?

2) Do you have any suggestions for improvements? I could lower the RC filter cutoff, eg 1uF (159Hz) instead of 0.33uF (482Hz) and still be above my target 60Hz.

  • Hello Nathan,

    For your question:

    • I can simply shift the values by that much, but since I don't know where it comes from, I worry it will vary in the future.
    • Should I have my device self calibrate on startup before there is a load? Even then it could vary later. Best I can do is maybe find a time with no load once/day.
    • Is such adaptive calibration typically needed, or is something going on with my implementation?
    • Since I'm computing RMS, any offset error is amplified.

    No, it is not normally necessary to constantly recalibrate. My first guess is that most of this offset is coming from the voltage divider you have on the output. Normally, I would not recommend dividing the output down before putting it into an ADC. So, ideally you trade out the ADC with one that can handle 5V. Whether or not you end up changing out the ADC, you will probably want to do a one time calibration with no load to find your specific offset, and then adjust all results by that value. If you want to further calibrate, you could also do a calibration with a known current to adjust for any sensitivity errors. 

    For this question:

    what if I used max peak-to-peak over 5-10 seconds instead?
    1) Does the approach seem good?

    This is not usually recommended either, as it relies on a consistent peak-to-peak to get an accurate result. For example, if your positive peak stops reaching the max current, but your negative peak is still driving to the expected current then your center point would change and all values would be wrong.

    2) Do you have any suggestions for improvements? I could lower the RC filter cutoff, eg 1uF (159Hz) instead of 0.33uF (482Hz) and still be above my target 60Hz.

    I don't have any other suggestions than what I stated above. Let me know if you have any further questions.

    Regards,

    Mitch

  • Thanks Mitch!

    In my previous question I was using 3.3V and TMCS1101A3B and I also saw an offset, though above 1.65V rather then below. It was suggested I use an RC filter, a 5V sensor for higher sensitivity, and a voltage divider for the 3.3V ADC -- that's what I've done.

    Would changing the voltage divider values or RC filter values be likely to reduce the offset? That is easy, changing the ADC is harder.

    It makes sense a symmetric current waveform is needed to have meaning values using peak-to-peak measurements. My load is inductive, a solenoid, so should tend to be sinusoidal and symmetrical around zero.

    I would rather use an offset, so I will revisit that before deciding if peak-to-peak is good enough.

  • I measured the 4.7K resistor in the voltage divider and found 4.581K. I exchanged it for 4.701K. Everything else was close.

    I also replaced the RC filter 0.33uF with 1uF. After those 2 changes the offset changed from -71mV to -185mV. My 44ma resistive test load reads incorrectly at 24mA (was 38-44ma).

    Next I replaced the RC filter capacitor with 0.1uF. The offset is now -166mV and the 44mA load reads 46-48mA. No load readings are 6-10mA instead of 2-6mA with the 0.33uF RC filter.

    Findings: 1uF is too much. The offset seems to be primarily affected by the voltage divider, as you mentioned.

    Those offsets are the mean from the scope between the ADC input pin and ground using a witch hat and a calibrated probe. The ADC reports 1805.5 on average for no load / 4096 * 3300 = 1454mV. I don't know why the scope shows 1484mv (1650 - 166) for the same.

    Using 1454mV as zero with the 0.1uF RC filter, I take the highest and lowest values seen over 5 seconds and compute mA:

    float center = 1457.0f / 3300 * 4096;
    float high = adcMax - center;
    float low = center - adcMin;
    float mV = std::max(high, low) / 4096 * 3300;
    float mA = mV3 / 400 * 1000;

    First try, I see 10-12mA for no load. For the 44mA load I see 49-51mA. When I removed the load after 6-7 seconds, I see 25-32mA instead of the 10-12mA I saw before. It stays that way even after minutes. I rebooted the MCU and see 35-37mA with no load. More testing shows it all over the place.

    The offset isn't stable, at least with my implementation. I'm not able to use an offset/absolute zero point at all. The only workable solution I've found is using peak-to-peak, with the caveats you pointed out. At least if the AC current waveform is asymmetrical, peak-to-peak (as I described it) will report less current, never more.

    That seems to be it without changing the hardware. I wish I had have stayed with the 3.3V sensor and just added the RC filter, if the voltage divider is truly why I don't have a stable offset.

  • Hello Nathan,

    Ok, thank you for the update. Let me know if you need anything else from me.

    The A1-A3 versions of the TMCS1101 can be powered from 3.3 V, so maybe one of those would work for you? If so, then you could remove R10 and short R5 to get rid of the divider. I'm not sure if the sensitivities will work for your application, but it may be worth looking into. I would recommend starting with the TMCS1101A3B, since it will be the closest option to what you already have, and can operate at 3.3V. (Though I guess you would also need to get a 3.3V supply to the device, not sure if you can do that without a hardware change or not).

    Regards,

    Mitch

  • I was using the TMCS1101A3B and changed to A4B on your (TI, Javier Contreras4) recommendation:

    https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/1248905/tmcs1101-reading-tmcs1101-output/4726651#4726651

    The sensitivity makes sense but apparently the voltage divider doesn't. I can't be 100% sure that is the issue, but if so it'd be good to make sure that doesn't get recommended.

    Changing back to A3B would need 3.3V supply to the sensor so would be a PCB redo.

    I spent more time using 0.1uF in the RC filter and added a MAD filter in software. It works well for a resistive load. I have yet to test with a solenoid. Hopefully that works and I can move on.

  • Hey Nathan, 

    Ya, you are correct that the A4B works better for sensitivity, it's just that the divider may add some unwanted error....  

    Ok, good luck with your tests and let me know if you have any further questions.

    Regards,

    Mitch