infineon4engi@twitter twitter

infineon4engineers Facebook

infineon@linkedin linkedin

infineon@youtube youtube


+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Beginner Beginner muratrazi is on a distinguished road
    Join Date
    Aug 2019
    Posts
    18
    Points
    185

    Tle987x evalboard BEMF Motor running and stopping problem in a loop

    Hello everyone,

    I am using tle987x evalboard with the example code that is names " BLDC_BC_BEMF_EXAMPLE_TLE987X". I want to run motor and after sometime i want to stop it later then i want to run it again
    in a loop . My code is below. it runs the motor and afte some time it stops the motor. But the motor never runs again in the loop. What can be the problem?


    static void Main_lStartMotor(void);
    static void Main_lStopMotor(void);
    uint32 Error;
    /************************************************** *****************************
    ** Globale Variable Definitions **
    ************************************************** *****************************/

    /************************************************** *****************************
    ** Private Variable Definitions **
    ************************************************** *****************************/
    static uint8 bMotorRun;
    static uint32 count;
    uint32 Error;
    /************************************************** *****************************
    ** Private Constant Definitions **
    ************************************************** *****************************/

    /************************************************** *****************************
    ** Global Function Definitions **
    ************************************************** *****************************/
    /** \brief Executes main test code.
    *
    * \param None
    * \return None
    *
    */
    bool b;
    int i=0;
    int main(void)
    {
    /************************************************** ***************************
    ** initialization of the hardware modules based on the configuration done **
    ** by using the IFXConfigWizard **
    ************************************************** ***************************/

    TLE_Init();
    Emo_Init();
    b=true;
    count=0;


    Emo_setspeedreferenz(2000);



    for(;{
    /* Service watch-dog */
    (void)WDT1_Service();

    /* Start motor to run up to the desired speed */

    count++;

    if(b)
    {
    Error = Emo_StartMotor();
    PORT_ChangePin(LED1, PORT_ACTION_SET);
    }

    if(count>345000 )
    {
    Error = Emo_StopMotor();
    b=false;
    if(count>(2*345000))
    {
    count=0;
    b=true;
    }
    }

    }
    }



    /* End of main() */


    void Main_HandleSysTick(void)
    {

    } /* End of Main_HandleSysTick */


    /************************************************** *****************************
    ** Private Function Definitions **
    ************************************************** *****************************/
    static void Main_lStartMotor(void)
    {


    Error = EMO_ERROR_NONE;

    if (Error == EMO_ERROR_NONE)
    {

    }

    if (Error == EMO_ERROR_NONE)
    {
    }
    else /* Error */
    {
    }
    } /* End of Main_lStartMotor */


    static void Main_lStopMotor(void)
    {

    Error = Emo_StopMotor();

    if (Error != EMO_ERROR_NONE)
    {
    }
    } /* End of Main_lStopMotor */


    Kind Regards
    Murat.

  2. #2
    Moderator
    Infineon Employee
    Infineon Employee
    Fiz is on a distinguished road
    Join Date
    Jun 2019
    Posts
    50
    Hi Murat,

    we will try to take a deeper look into your software.

    Best,
    Fiz
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.