• Resolved

CCS/TMS320F28035: Voltage offset between COMP output and PWM tripzone

Prodigy 50 points

Replies: 9

Views: 134

Part Number: TMS320F28035

Tool/software: Code Composer Studio

Hello,

I try to detect when a voltage go down a level, and I cut off the PWM output when it occure.

To do that, I configure the COMP2 and I compare it to the DAVAL register which is configure with the good value.

I invert the output of the comparator to detecte when the voltage go down instead of voltage go up.

This part works very fine. I test it with a variable voltage on the input. when the voltage go under the voltage threshold, the COMP out is set to high level.

Next I try to route the COMP out signal on the tripzone (TZ) of the PWM. To do that I configure le Digital Compare module and the tripzone module.

I would like to say that I already did all of this config with the COMP1 and the tripzone and it works fine, I transpose all of the config with the COMP2 but it didn't work.

Let me explain the behavior I have :

1/ I configure the DACVAL threshold to fire at 11V on my input.
2/ I start the test with 15V on the input.
3/ I go down the voltage on the input, and when I cross the 13V level, the tripzone fire, but the comparator output didn't.
4/ I continue to go down the voltage, when I cross the 11V level, le COMP out is set.

The behavior I expect is :

1/ I start at 15V on voltage input.
2/ I go down the voltage until I cross the 11V level, and the COMP out and the tripzone fire simultaneously.

I precise that I didn't have othe comparator enabled.

How to explain this behavior, it seems there is an offset between the tripzone and the comparator ? And how it is possible for the tripzone to be set BEFORE the comparator ??

Thanks,

Julien.

  • Julien
    This part works very fine. I test it with a variable voltage on the input. when the voltage go under the voltage threshold, the COMP out is set to high level.

    Next I try to route the COMP out signal on the tripzone (TZ) of the PWM. To do that I configure le Digital Compare module and the tripzone module.

    I would like to say that I already did all of this config with the COMP1 and the tripzone and it works fine

    This is good news because it means that your desired configuration will work.

    Julien
    I transpose all of the config with the COMP2 but it didn't work.

    Can you attach your comparator and epwm configuration code as a file?  Pasted code is not easy to read.  A text file is best for me.

  • In reply to tlee:

    Hello Tlee,

    Thank you for your answer.

    Here you can find a screenshot of the registers configurations.

    It's complicated for me to paste the entiere config beacause it is splitted into many files, and some files are confidential.

    Is it ok for you ?

    For your information I compare all of the ADC/PWM/COMP/PIE register between the working configuration with COMP1 and the not working configuration with COMP2, and didn't see significative difference.

    Thank you !

  • In reply to gfds gfdsq:

    Julien,

    It looks like you have multiple trip sources enabled in TZSEL. Try disabling all trip signals except for the COMP2 output (DCAEVT1).

    It looks like you have DCB/TZB actions enabled in TZCTL.  Try setting all actions to Do Nothing except for either DCAEVT1 or TZA.

    It looks like the flags for DCAEVT1 and OST are set in TZFLG.  Make sure to clear those using TZCLR before trying any experiments.

    -Tommy

  • In reply to tlee:

    Hello Tommy,

    Thank you for your detailed answer.

    I now have TZSEL set to 0x4000, and TZCTL set to 0x0FFE.

    For the TZFLG register, the screenshot was made when the tripzone detection was triggered. I use an HMI to reset errors and this flag before every experiment.

    The behaviour is still the same and not working like expected.

  • In reply to gfds gfdsq:

    Julien,

    Do you think that it is possible that COMP2 might have spuriously tripped the PWM, but resolved back to an untripped state by the time you tried to observe the status?

    Can you try to enable the COMP2 qualification filter through COMPCTL?

    Are you able to monitor the COMP2OUT signal on an oscilloscope using a one-shot, single sequence trigger?

    -Tommy

  • In reply to tlee:

    Hello Tommy,

    I don't think the PWM is spuriously tripped by the COMP2 because even with a conditionnal breakpoint on COMP2.COMPSTS=1, the PWM tripped and the debugguer don't break.

    Maybe the JTAG probe is not able to see it ? I use an XDS100V3 but I also try with a XDS200.

    I try to enable the COMP2 qual filter without success.

    I can't monitor the COMP2OUT on an oscillo because this is an internal signal in the chip isn't it ?

    Julien

  • In reply to gfds gfdsq:

    Julien,

    You can refer to the F2803x TRM for details, but COMP2OUT is available on these GPIO signals:

    The block diagram may help some:

    -Tommy

  • In reply to tlee:

    Hello Tommy,

    I can see COMP2OUT on an oscillo. And you were right !

    The COMPOUT signal is at low level when the entry signal on the comparator is high (2.67V).

    When the entry signal go down (2.35v) some spikes begin to appear on COMPOUT, this correspond with the tripzone threshold.

    My board emit some very bad noise on the entry signal and when the noise on this signal cross the DACVAL threshold, the COMPOUT is triggered.

    Thanks for the help, I will see with hardware engineers how to solve the problem.

    Thanks !

    Julien.

  • In reply to gfds gfdsq:

    Julien,

    I'm glad that you were able to observe the signals directly.

    Here are a couple of thoughts that may help:

    • The comparator includes hysteresis using feedback through a series resistor so you can vary the influence of the feedback path by changing the source impedance of your input signal. This should be considered if taking an RC filter approach.
    • Even clean input signals are prone to producing spurious trips when the input level is close to the comparator trip threshold. This is typically not a problem in systems where the input signal crosses the comparator threshold quickly or where the tripped state is latched.

    -Tommy