Demo entry 6680079

//haha

   

Submitted by anonymous on Dec 06, 2017 at 18:54
Language: C. Code size: 1.9 kB.

// Output and update for atomic system: '<S23>/PLL'  
void Fun_PLL(real32_T arg_x, Struct_DW_PLL *localDW, real32_T rtp_Kp, real32_T  
             rtp_F0, real32_T rtp_Ki_Omega, real32_T rtp_Ki)  
{  
    real32_T Gain1_p;  
  
    // Sum: '<S41>/Sum6' incorporates:  
    //   UnitDelay: '<S41>/Unit Delay3'  
    //   UnitDelay: '<S41>/Unit Delay4'  
  
    localDW->UnitDelay3_DSTATE += localDW->UnitDelay4_DSTATE;  
  
    // Gain: '<S41>/Gain1' incorporates:  
    //   Constant: '<S41>/Constant'  
    //   Gain: '<S41>/Gain'  
    //   Gain: '<S41>/Proportional Gain'  
    //   Sum: '<S41>/Sum1'  
    //   Sum: '<S41>/Sum4'  
  
    Gain1_p = rtp_Ki_Omega * (6.28318548F * rtp_F0 * ((rtp_Kp * arg_x +  
        localDW->UnitDelay3_DSTATE) + 1.0F));  
  
    // Sum: '<S41>/Sum3' incorporates:  
    //   UnitDelay: '<S41>/Unit Delay2'  
    //   UnitDelay: '<S41>/Unit Delay5'  
  
    localDW->theta += Gain1_p + localDW->UnitDelay2_DSTATE;  
  
    // Switch: '<S41>/Switch1' incorporates:  
    //   Constant: '<S41>/Constant2'  
    //   Sum: '<S41>/Sum5'  
  
    if (localDW->theta >= 0.0F)  
    {  
    }  
    else  
    {  
        localDW->theta += 6.28318548F;  
    }  
  
    // End of Switch: '<S41>/Switch1'  
  
    // Switch: '<S41>/Switch' incorporates:  
    //   Constant: '<S41>/Constant1'  
    //   Constant: '<S42>/Constant'  
    //   RelationalOperator: '<S42>/Compare'  
    //   Sum: '<S41>/Sum2'  
  
    if (localDW->theta > 6.28318548F)  
    {  
        localDW->theta -= 6.28318548F;  
    }  
  
    // End of Switch: '<S41>/Switch'  
  
    // Update for UnitDelay: '<S41>/Unit Delay4' incorporates:  
    //   Gain: '<S41>/Integral Gain'  
  
    localDW->UnitDelay4_DSTATE = rtp_Ki * arg_x;  
  
    // Update for UnitDelay: '<S41>/Unit Delay2'  
    localDW->UnitDelay2_DSTATE = Gain1_p;  
}  

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).