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.

TMS320F280049C: LAB-05 Open Source

Guru 56073 points
Part Number: TMS320F280049C
Other Parts Discussed in Thread: BOOSTXL-DRV8320RS, C2000WARE

InstaSpin's Project and Drives User's Guide V1.00.00.00

is05_motor_id – Motor Parameters Identification
InstaSPIN does not have to be executed completely out of ROM. Actually, most of the InstaSPIN code is provided as open source. The only closed source code is the FAST observer. This lab will show how to run the sensor less field oriented controller as open source in user RAM. The only function calls to ROM will be to update and to pull information from the FAST observer.

The is no source code found in latest download control suite SDK inside folder FOC. The FOC folder *.h and *.c files are handles for accessing closed source embedded ROM.

Where is the open source kept of for the Clarke/Park embedded ROM transforms? We would like to review the open source of these two routines also stored in ROM.

  • You should find all open-source codes through the project, the module files are in the libraries or lab files in the solutions folders except FAST estimator functions that are in ROM.

  • Getting started PDF suggest they are in the imported project folder FOC. The files are not in the SDK download under boostxl-drv8320rs or  x49c source folders. They should be part of the project import FOC folder and only excluded from the build!

     

  • Under libraries folder are source files but the C file does not have the functions and only the handle call to embedded ROM.

    //#############################################################################
    //
    // FILE:   clarke.c
    //
    // TITLE:  C28x Clarke transform library
    //
    //#############################################################################
    // $TI Release: MotorControl SDK v2.01.00.00 $
    // $Release Date: Mon Nov 11 15:18:09 CST 2019 $
    // $Copyright:
    // Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without
    // modification, are permitted provided that the following conditions
    // are met:
    //
    //   Redistributions of source code must retain the above copyright
    //   notice, this list of conditions and the following disclaimer.
    //
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the
    //   documentation and/or other materials provided with the
    //   distribution.
    //
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    //
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //#############################################################################
    #ifdef __TMS320C28XX_CLA__
    #pragma CODE_SECTION(CLARKE_init,"Cla1Prog2");
    #endif
    
    #include "clarke.h"
    
    // ****************************************************************************
    //
    // CLARKE_init
    //
    // ****************************************************************************
    CLARKE_Handle
    CLARKE_init(void *pMemory, const size_t numBytes)
    {
        CLARKE_Handle handle;
    
        if((int16_t)numBytes < (int16_t)sizeof(CLARKE_Obj))
        {
            //
            /*LDRA_INSPECTED 95 S MR12 11.3 "Below typecasting has no issues"
            */
            return((CLARKE_Handle)NULL);
        }
    
        //
        // assign the handle
        /* LDRA_INSPECTED 94 S MR12 11.3 "Below typecasting has no issues"
        // LDRA_INSPECTED 95 S MR12 11.3 "Below typecasting has no issues"
        */
        handle = (CLARKE_Handle)pMemory;
    
        //
        /* LDRA_INSPECTED 71 S MR12 11.3 "Always, address of a static object is
        // passed, so ok for wider scope"
        */
        return(handle);
    } // end of CLARKE_init() function
    //
    // end of file
    //
    

  • You might have a look at the lab01 chapter in lab guide about how to open and link the functions/variables in the .c/.h. The guide can be found in the below folder of MCSDK. BTW, most functions are defined in .h file if they are called in ISR.

    \ti\c2000\C2000Ware_MotorControl_SDK_2_01_00_00\solutions\common\sensorless_foc\docs\labs