# Convert triangular signal

Discussion in 'Programmer's Corner' started by Adam Brave, Jun 19, 2014.

Mar 26, 2014
13
0
Hi,

I'm using a 3 phase pll block to track the phase of a voltage signal on Matlab/Simulink. The output "wt" of this block it's a triangular ramp varying between 0 and 2pi and I need a continuos signal not limited to 2pi. I need to convert this signal in order to get a continuos growing signal. How do I do this?

This is the output of the pll block (varying between 0 and 2pi). How can I get this signal, not limited in the 2*pi? I thought to make a counter that counts every time that the signal reach the value 2*pi but as u can see in the image sometimes the signal doesn't reach the 2*pi value so the results of the counter would be erroneous...

Regards

2. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,127
1,488
I'm not clear what you want. Can you just integrate the signal? To integrate digitally you could clock a counter whenever the waveform crosses a fixed level, say 3V.

3. ### Brownout Well-Known Member

Jan 10, 2012
2,374
999
I second that sentiment. The requirement isn't clear at all. Please be explicit. Now is not the time to save words. Also, a diagram of the desired output might help.

Mar 26, 2014
13
0
This signal is the phase of a voltage, so this block gives it in a triangular format which it's comprise between 0 and 2pi. This signal represent an angle in radians that's why it's limited between 0 and 2pi. But I need the value of this angle without being in this format, for example in my circuit I've an asynchronous machine wich gives me the rotor angle also in radianos but in a normal format like the image bellow. In this picture you can see that the angle reach almost 30 radians in the end, if I wanted to convert this angle to a similar angle between 0 and 2*pi, like the triangular ramp does, it would be easy. It would be just:

so: