This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379D: F28379D

Part Number: TMS320F28379D


I am sensing the phase voltage in my converter. I need to give a phase delay of 120 degree to the sensed voltage (waveform attached). There is a function called US_DELAY that helps to give the delay in microseconds but it does not let me give that delay to the sensed voltage.
Please suggest how can I give delay to that sensed voltage in CCS?

  • Hi Hafsa,

    So you want to get your ADC value shifted by 120 degree instantaneous once ADC value is read?

    Please clarify your question if I misunderstood. 

    Regards,

    Chen

  • That's correct. I want to phase shift the ADC signal by 120 degree once the ADC value is read.

  • Hi Hafsa,

    You can add the delay between reading the ADC and adding values into buffer.   DEVICE_DELAY_US should help.

    Regards,

    Chen

  • Thank you for your response.
    I added the delay of 5.5ms between reading the ADC value and buffer using the following code where fVan is the Phase-A sensed voltage and fVbn is the Phase-B voltage where I have introduced a delay of 5.5ms as compared to fVan.

    fVan = ((float32)AdcbResultRegs.ADCRESULT3 * 0.0007326007326 - foffsetVan) * fgainVan;
    DELAY_US(5500);
    fVbn = fVan;

    This way of adding a delay is introducing a delay of 5.5ms in the entire code. It is making the ISR frequency as 181 Hz (corresponding to 1/5.5ms) which is making the code extremely slow. The original ISR frequency was 10 kHz.

    Please let me know if I am introducing a delay in fVbn the right way.
    Also, is there any way of introducing a delay in the sensed signal without affecting the over-all code performance?

  • Hi Hafsa,

    Without the slow ISR issue, does it fulfill your requirement?I am not clear on why you need to do this.

    If you would like to show the phase shifted value in Graph tool, the code will help. But also you need to send the FVan doing something like dVal1 = FVan. You can refer to the some sample code how to plot the curve using Graph tool. 

    But if you want to store two groups of data which are 120 degree phase shift, this will not help since it does not contain the time information.

    Regards,

    Chen 

  • Hi Chen,

    1. I need to do introduce a delay in fVan because I have one voltage sensor in a balanced three phase system that is measuring Phase-A voltage. I want to get Phase-B voltage by introducing a delay of 5.5ms (120 degree phase shift) in Phase-A voltage.

    2. I do not want this phase shifting just for plotting purpose. I want to achieve this phase shifting and then use this phase shifted data for further processing within the code continuously. Is there any way to do this without slowing down the code or reducing the ISR frequency?

  • Hi Hafsa,

    Have you tried to save your ADC value to A[1+a] to B[X+a] in the code? A/B stands for your phase and X is the # that related to 5.5ms and your sampling frequency. In that case you get two groups of data for processing.

    Regards,

    Chen