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.

LAUNCHXL-F28379D: 3 Phase PLL on LAUNCHXL-F28379D

Part Number: LAUNCHXL-F28379D

Looking for some help with a 3 Phase PLL coded into LAUNCHXL-F28379D using Matlab/Simulink environment.

Used model similar to one shown below in Matlab/Simulink to program a LAUNCHXL-F28379D MCU. 

The actual model I used had ADC's where sine wave blocks are shown and there was  math function before the abc to dq block.  The added math function subtracted the DC offset used in adc.

Also not shown is, a DAC, am using DAC_A (12-bit) on the LAUNCHXL-F28379D to monitor the theta signal.  DAC_A is attached to output of "mod" block.

Anyway, code was successfully loaded onto MCU and ran successfully with exception.

At startup the theta waveform , monitored via DAC_A, looked good. (see below, magenta trace)

But then after a while the theta waveform starts to degrade, see below.

So my question is why is theta waveform degrading?

It seems that the resolution of the DAC is degrading.

Is it possible that the DC reference to the DAC is drifting over time?

Or is this a PLL issue?

Best,

Colin

  • Hi Colin,

    1. Is there any parameter change happening at degrade case (2nd waveform)?

    2. For PLL: Also could you add a scope for theta in simulink to validate the PLL case and then compare the scoped value and DAC values. 

    If PLL is clean, then we can look into the DAC concern. 

    Thanks & Regards,

    Uttam

  • Hello Uttam,

    Sorry for late response, was out of office last 2 days.

    Thank you for getting back to me!

    Regarding question 1:  There is no parameter change during running code on MCU, only change was time.. at initiation of code run, theta looks good, as time goes on theta via DAC monitor starts to degrade.

    Regarding question 2:  When running the simulation alone in Simulink environment (not on MCU) theta looks good using Simulink scope.  If running coded simulation on MCU in simulink via Monitor & Tune mode I have not looked at simulink scope output.. will do and get back to you soon.

    Best Regards,

    Colin

  • Hello Again Uttam,

    We think we figured it out..  

    Think it is related to the "Integrator" block we were using and the step time mode used in solver.

              - Continuous Mode - Variable-Step Solver 

              -      Discrete Mode - Fixed Time Steps 

    The original integrator block used was "continuous time" integrator.

    We switched to an integrator that could use continuous or discrete time.  Also, added a "powergui" block running in discrete mode.

    This seemed to correct the "degrading" theta over time issue.   Makes sense.. Your thoughts?

    We tried looking at the Simulink Scope (theta signal) while running in "Monitor & Tune mode" for the LAUNCHXL-F28379D.  The Simulink scope signal looked severely under-sampled.  Do you know what would cause this or how to correct? Do we need some type of data conversion or transition rate post theta but pre scope?  Our wt / theta signal is running at 400 Hz, I think our sample time (Ts) is running around 25 us (40 kHz).

    Best,

    Colin

  • Colin,

    Thats good to hear, this seems more like a simulink based query. You need to check regarding this with MATLAB- simulink support. DAC seems okay to me based on first waveform. Can you share the waveform from scope which is observed.

    If this doesnt get resolved, I can loop you with a DAC expert.

    Thanks & Regards,

    Uttam

  • Hello Uttam,

    Just for a  point of clarification for you or others who may be reading this post; a model was generated in Simulink of  a 3 phase PLL.  We used a small 3 output DDS signal generator to provide a 3 phase analog signal as inputs to 3 ADC's on the LAUNCHXL-F28379D.  The 3 ADC output signals then were used to drive a 3 phase PLL.  Used an abc to dq0 transform block (Park Transform) then used the dq signal as drive to a PI controller, summing block, and integrator to produce a locked theta signal.  Then used the Simulink Model w/embedded coder to program a LAUNCHXL-F28379D MCU in Monitor & Tune mode which allows user to change some parameters and observe Simulink scope outputs live as code runs on MCU..  To look at the theta signal DAC_A on MCU was used, this DAC output signal was available on one of the header pins of LAUNCHXL eval brd.

    Below are new screenshots.

    First one is O-scope on DAC output of F28379D.

    Magenta trace is the DAC_A output; much more stable using discrete mode blocks and does not degrade over time.

    The theta output amplitude is 0 to 2pi so we added again block in front of DAC_A (12 bit) to get signal up to like 2800 dac count (adc_vref = 3V) so we got like a 2 V output from DAC_A. (2800/4096)*3.. I am not sure what the exact Vref value is to the DAC but 3V is very close.

    The light blue trace is just output of a CMPSS block we set to trigger on count of like 1400.(used DAC_A as input to cmpss +in)

    Below is theta output of Simulink scope of Simulink model used to program the F28379.  This is live, as run on MCU in Monitor & Tune mode. So screenshot above was taken at same time as signal below.  Signal below has amplitude of 0 to 2pi.  Will inquire with Mathworks about this.

    Best,

    Colin

  • Hi Colin,

    I don't see any issue with DAC here as you can see clean waveform in first figure.

    I recommend you contact Mathworks support team to help you with the issue.

    Regards,

    Hadi