+ Post New Thread
Results 1 to 7 of 7
  1. #1
    Newbie level 4
    Points: 62, Level: 1

    Join Date
    Apr 2019
    Posts
    9
    Helped
    0 / 0
    Points
    62
    Level
    1

    Digital phase lead in MCU

    Hi

    I have two input signals A and B , which are sinusoidal in nature. All that I have to do is to ensure that both signals are exactly in phase. I have observed that A lags B by 1 degree. How do I compensate this in MCU?

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 73,677, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,946
    Helped
    3403 / 3403
    Points
    73,677
    Level
    66

    Re: Digital phase lead in MCU

    Hi,

    sinusoidal signals are analog signals, but your MCU is a digital device. Thus I assume there is an ADConverter involved.

    --> for a detailed answer you need to provide the information about your complete signal chain.

    For now I can give only a general answer: lag signal B by 1 degree.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisment

        
       

  3. #3
    Newbie level 4
    Points: 62, Level: 1

    Join Date
    Apr 2019
    Posts
    9
    Helped
    0 / 0
    Points
    62
    Level
    1

    Re: Digital phase lead in MCU

    Hi

    I use a Simultaneous sample ADC in between the signal and MCU. How do I lag signal B by 1 degree. Any sample c code ?



    •   AltAdvertisment

        
       

  4. #4
    Super Moderator
    Points: 73,677, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,946
    Helped
    3403 / 3403
    Points
    73,677
    Level
    66

    Re: Digital phase lead in MCU

    Hi,

    No values, how can you expect a good advice?

    --> delay it by a sufficient count of ADC samples.

    Honestly. We donīt know nothing. We donīt know whether 1 degree means 1000 samples or 1/1000 of a sample.


    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  5. #5
    Newbie level 4
    Points: 62, Level: 1

    Join Date
    Apr 2019
    Posts
    9
    Helped
    0 / 0
    Points
    62
    Level
    1

    Re: Digital phase lead in MCU

    Hi
    Input signals are 50Hz, sampling frequency is 2500 Hz. How to delay the samples?



    •   AltAdvertisment

        
       

  6. #6
    Super Moderator
    Points: 73,677, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,946
    Helped
    3403 / 3403
    Points
    73,677
    Level
    66

    Re: Digital phase lead in MCU

    Hi,

    May I ask why you don't show a little effort of your own to motivate members to spend time for you?

    At least two values.
    Did you calculate the delay time?
    Td = phase_angle / ( frequency Ũ 360°)

    Or sampling period time?
    Ts = 1 / f_sample

    ..to get to know whether it is more or less of a sample period

    A bit of additional information could help also: why not using an analog filter. What's the application. How did you measure the 1°?...

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  7. #7
    Newbie level 4
    Points: 62, Level: 1

    Join Date
    Apr 2019
    Posts
    9
    Helped
    0 / 0
    Points
    62
    Level
    1

    Re: Digital phase lead in MCU

    Hi

    I measured 1 degree through the oscilloscope (phase1-phase2). Can we digitally phase shift?



--[[ ]]--