Compare PWM signals

Thread Starter

V.Rossi

Joined May 16, 2023
7
Hello all,
I want to compare a PWM signal (IN+) with another signal (OUTH). To do this, I need to detect both and, if possible, output a digital signal if the OUTH signal no longer matches the IN+ signal.
One idea was an op-amp (integrator), but I'm not that familiar with signals yet, which made me fail until now. Unfortunately, as a beginner, I am totally lacking ideas on where to start.

I would appreciate helpful answers.

With kind regards

V.Rossi
IN+_OUTH.png
 

Thread Starter

V.Rossi

Joined May 16, 2023
7
Try feeding the signals into the inputs of an XOR gate. The output will be low if the signals are identical.

Les.
Thank you for your answer. However, I would have a peak every period at the point where the one PWM is low and the other is high. This would not work because the digital signal is supposed to act as an error message.
In addition, a small deviation of the two signals should be allowed and not return a digital signal.

V.Rossi
 

Ya’akov

Joined Jan 27, 2019
9,170
If you invert one signal and combine them you will get an error signal proportional to the difference between the two which you can use with a threshold to do whatever you want.
 

Thread Starter

V.Rossi

Joined May 16, 2023
7
Before more solutions are generated, what else can you tell us about your requirements?
I need to compare input with output and if the output signal no longer matches the input signal, I need a digital signal with which I can switch off the input. However, small deviations should be allowed so that the input is not switched off every time there is a small voltage drop.
In addition, I intend to enable the input manually only after the digital signal has been applied.
Furthermore, the output signal is delayed compared to the input signal. The delay time is a maximum of 130 ns.

Thank you!
 

Ian0

Joined Aug 7, 2020
9,835
If you EX-OR the two signals (as @LesJones and @MrChips suggested) then integrate the output (an RC filter will do), then the output voltage will be proportional to the correlation between the two signals.
0V = completely in phase
5V = completely out of phase
2.5V = in phase half the time
 

Thread Starter

V.Rossi

Joined May 16, 2023
7
If you EX-OR the two signals (as @LesJones and @MrChips suggested) then integrate the output (an RC filter will do), then the output voltage will be proportional to the correlation between the two signals.
0V = completely in phase
5V = completely out of phase
2.5V = in phase half the time
That doesn't sound bad, but I don't get any reaction at the output when the IN+ signal is 5V and the OUTH drops to 2.5V.
 

LesJones

Joined Jan 8, 2017
4,190
In your first post you did not specify that you also needed to check the level of the output signal. It would help if you told us EXACTLY what you are trying to achieve including the frequency of the PWM signal. Do you need to log the exact level of the output signal ?
If we understood the purpose of your project we would be able to provide better help.

Les.
 
Top