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.

Instaspin BLDC execution time on TMS570LS12

Other Parts Discussed in Thread: MOTORWARE, TMS570LS1227, INSTASPIN-BLDC

Hello,

I have measured how many cycles does it take to run "Instaspin BLDC" on TMS570LS12 Hercules MCU.

The CPU clock is 160MHz.

The result is about 2000 cycles.

But, compared to the attached benchmark ( the used MCU and the CPU clock is different),I feel the result

is too long.

Could anyone tell me the reason why the Instaspin BLDC execution time is so long ?

I'll appriciate if someone could reply to my question.

Regards,

Hiroyasu

7444.5811.Motor Control Benchmark (1).pdf

 

  • Hiroyasu,

    Sorry, I'm not familiar with the slideset.  Maybe you can tell me where you found it.

    Also, which column are you comparing to?  One of the columns says over 2000 cycles for 80MHz so if it's this column that you are measuring at 160MHz it may not be out of line.   Remember that even though you double the frequency of the device, there are additional wait states when you access flash and that eats some of the performance gain of running faster.   Certainly not all of it but this could be part of what you are seeing.

    Also what method are you using to benchmark? 

    If it's possible to share your code even privately - we can also take a look at it to see what is going on.

    -Anthony

  • Anthony ,

    Thank you for your reply.

    The code could be shared. The project is included with "Hercules Motorware", and the location is:

    C:\ti\Hercules\MotorWare\v1.0.3.03\motorware_1_00_03_03\sw\solutions\instaspin_bldc\boards\drv8301kit_revD\hercules\tms570ls1227\projects\ccs5\project01

    If the reason why the execution time is long is "executing from flash",it becomes faster if executing on RAM.

    I tried to executing the application on RAM,but the execution time didn't become faster.

    Mr.Jiri Janacek ( who is community member) replyed to my question :

    your measurement is probably correct. Code execution time is almost identical  for both manners - running from flash or RAM. Yes, there are some presumptions to be configured in the flash controller as an activated pipeline, proper wait state timing, etc.

    The application execution time do not become faster even if it runs on RAM ?

    And, is there any reason why the application execution time is so long ?

    I mentioned about the benchmark "BLDC: Trapezoidal /InstraSPIN BLDC" , "Total Number of Cycles".

    I would appriciate if you would reply to my question.

    Regards,

    Hiroyasu

  • Hiroyasu,

    This may take me a week or so to get to -- mainly because there's a lot in my backlog.
    But I'm thinking of testing the new ProTrace receiver to see what it can show us.

    https://estore.ti.com/570lc-protrace.aspx

    I've just gotten one recently and have used it for debugging a few problems but it also gives cycle accurate trace information and so we should get good visibility on the question once we get it setup.   I need to run this example on an HDK so there will mabye be some small work invovled since I believe the motor kit uses a different card.  But this gives you the ability to measure performance non-intrusively and very accurately.

    I should be able to post some files for you to explore - even if you don't have the tool the output can be loaded in any CCS install for viewing.

    -Anthony

  • Anthony,

    Thank you for your reply.

    I'll wait for your investigating about this issue.

    I would like to ask about :

    I tried to execute the code on RAM ,by reading this post:

    http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/195611/700678.aspx

    I've modified the linker command file,and wrote the copying code from flash to RAM,and tested,

    (made UCOS section on linker command file, and checked the linker memory map the address and length of

    UCOS section,and on startup sequence,copy the UCOS codes from flash to RAM.)

    But,the execution time didn't become faster.

     

    Is there any wrong about my modifying process ?

    Or, should I do any settings about RAM for running as maximum performance ?

    Would it be helpful if I post the project I used ?


    I'll appriciate if you or other person reply to my question.

     

    Hiroyasu

     

     

     

  • Anthony,

    I've updated the CCS project which is used to try to execute code on RAM.

    The execution time(executing these function : DRV_EnableMotor and DRV_run) is 10.5 usec at Velocity mode.

    Hiroyasu

    3554.TMS570LS1227_instaspin_bldc_2014_0523.zip

  • Hi Anthony,

    Here are two points that I wish to be read.

    1.I read "sys_mpu.asm" in BLDC project,and wondered if the RAM region would be disabled (sub-region disiabled) in the function mpu_init, isn't it ?

    2. To load the text section from flash to RAM and execute on RAM, on the CCS, the ARM linker option (Advanced options - Linker Output) , "Produce a relocatable output module" should be checked, isn't it ?

    I would appriciate if you could reply to my question.

    Hiroyasu

  • Hello,

    I would ask again about this issue.

    Could anyone tell me ,how to run "Instaspin-BLDC" or "Instaspin-FOC" on Hercules(TMS570LS)

    by placing the codes on RAM ?

    Why I ask this quesiton is the execution time would become faster than placing codes on Flash,

    and I would like to run Instaspin-BLDC ( or FOC) logic as fast as possible.

    The Code Composer Studio Projects are included in "Motorware for Hercules MCU".

    (The folder location is C:\ti\Hercules\MotorWare\v1.0.3.03\sw\solutions)

    http://www.ti.com/lit/zip/spnc040

    I would appriciate if someone could reply to my question.

    Regards,

    Hiroyasu