Convert triangular signal

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

  1. Adam Brave

    Thread Starter New Member

    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...

    [​IMG]

    Regards
     
  2. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,764
    1,099
    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,375
    998
    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.
     
  4. Adam Brave

    Thread Starter New Member

    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:

    30 rad/ 2*pi = 4.77465
    so:
    0.77465*2pi= 4.86727 rads

    30 rads it's equivalent to 4.86727 rads (sin(30)=-0.988=sin(4.8627))

    Now, I need to do just the opposite to the triangular ramp...I know the math I just don't know how to implement it on simulink because the counter it wont work =\

    [​IMG]
    images
     
  5. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    That makes more sense. Thanks for the clarification. I'll back out and allow someone more familiar with Simulink help here. Good luck!
     
Loading...