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.

flash programing of instaspin FOC with c2000 F28027f launchpad

Other Parts Discussed in Thread: DRV8301, MOTORWARE, LAUNCHXL-F28027F

HIi I am using the DRV8301 BoostXL  and C2000F28027f  launchpad.

with the help of motorware and G.U.I. I can able to spin the motor and had try all motorware lab project successfully.

but I like to run motor in stanalone mode (without any host  P.C.) , and like to interface a potentiometer for speed control of motor by external  world.

all the neccesary files like (1)codestartbranch.asm (2)user.c (3)user.h (4)Flash.c  are included in the lab project.

(already present along with the lad 5-b.)

*firstl I debug the LAB 5-b (which is present  in motorware 2014) in cc v6.

then I debug and follows the procedure as shown in bellow video.

((((    https://www.youtube.com/watch?v=lYcB1O3FpOo 

SWITCH positions are as follows;

S1=111 & S2=0(to allow flash fault LED on Boostxl DRV 8301 pad. )

but there were no effect on motor, it wont  work after pressing run button.  

please help me to resolve this problem; as i am new to c2000  familiy  and the c++ language.

  • sandesh warwadekar said:
    but there were no effect on motor, it wont  work after pressing run button.  

    Hello,

    If you say you are success when trying the Motorware labs, then you should notice that there are 2 flags that you should enable (set it as 1) after pressing the run button in the debugger.

    Did you set those two flags after pressing the run button in the debugger?

    Best regards,

    Maria

  • whenever I oped the GUI then lab_5b runs successfully,but from ccs it wont.

    This is what i exactly done as bellow.

    (1)first i had import  the Project (lab_5b) from motorware into ccs

    (2)then i build that project

    (3)then i hit the run button.

    but the  windows which shows Expression value that is gMotorvariables value does  not come.

    so I enter value as a True in the main program, that is about two flags .

    ''gMotorvars.flag_enableSys'' as a TRUE &

    ''gMotorvars.flag_Run_Indentify'' as a TRUE 

    but still no effect. motor wont spin from ccs V6  studio.

    please help ,e to sort out this problem

  • Can you give us the screenshot of you debug window?
    Click "Use rich formatting" below the reply editor to enter advanced editor so you can insert your image file.
  • there is no reason that it would work from the GUI but not CCS. There are no differences. You can even import the GUI into GUI Composer INSIDE CCS and then after loading/running/real-timemode instrument the variables just the same as you would with the standalone GUI.

    You shouldn't need to follow anything from the youtube video. The projects for the LAUNCHXL-F28027F are all set-up as program to flash already. When you load the program it will program the code correctly.

    I suggest starting with a clean MotorWare install (because I don't know what files you added).
    Import 5b
    update your user.h as you previously did
    Debug (build, connect emulation, load program)
    Enable real-time mode
    Run

    then use the Expressions menu (you can use the scripting console to load the proj_lab05b.js) or GUI Composer inside CCS.
  • as you can see in that screenshot the two flags have been set to 1(one)

    but still there were no effect on the motor its wont spin at all

    please let me know whether i have to change other flags also or not?

    and please tell me what should I have to do to avoid the repetitive procedure of motor identification?

  • the two flags are as follows which are set to one position
    ''gMotorvars.flag_enableSys=1'' &
    ''gMotorvars.flag_Run_Indentify=1''
  • you have not pressed the RUN button yet. Program needs to be running.

    "and please tell me what should I have to do to avoid the repetitive procedure of motor identification?"
    gMotorVars.Flag_enableUserParams = 1
    before
    gMotorvars.flag_Run_Indentify=1

    this is discussed on proj_lab03 when it shows you how to save USER_MOTOR and OFFSET variables.
  • first of very much thank you for giving your valuable time for answering

    now as you said earlier I just re install the motorware

    then i import the project LAB_5b in ccs V6

    then build that project.

    then i have enable real time mode feature and continues refreshing feature.

    then set gMotorvars.flag_Run_Indentify=1 & gMotorvars.flag_enableSys=1

    then motor is identified very well

    now for to  change rotor speed which flag  should be varied?

    i have change these both the parameter

    (01)speed_krpm & (2)speedRef_krpm   as  shown bellow

    also you can check that debug window

    After switching OFF the Supply and keeping the switch S1 in position as (110)(for c2000 F28027f  launchpad).

    After powering the launchpad (without opening ccsV6 ) motor again fails to spin........

    I think I have missing something to enable in the ccs v6 debug window ......

    please help me to get me out of this problem

    I have shown all the screen shot please let me know whether you need something extra information or not?

     

  • if you run the full motor ID, when it finishes it will set
    gMotorvars.flag_Run_Indentify=0
    and
    gMotorVars.Flag_MotorIdentified=1

    you need to set
    gMotorvars.flag_Run_Indentify=1
    to get the motor to run

    this is all discussed in the lab write-ups.

    also I notice that your Expressions View does not have the proper variable types cast. You should use the proj_lab###.js to load the variables and cast the types appropriately.
  • First thank you for helping me..

    Now with the help of code composer studio V.6  its possible for me to run motor and change its speed .

    I am making mistake in entering the speed reference value  (its in kilo RPM and I thought that it was in just RPM )

    Now please tell me next procedure so that the Project LAB_5_B  from motorware will remain in the  C2000  memory permanently

    i.e. whenever  switching OFF the power supply (( i.e. 24 V for motor and booster pack DRV_Boost_XL_8301 )) motor should run instantly  without  opening CCS_V_6  OR Motorware  software.

    {{{ as you said earlier reffer lab_2_b for flash programing of c2000 but after doing that same procedure mentioned in that lab its not working   OR

    may be i am missing something to add or to change.}}}

    Sooo please  I request you to explain me here in short step by step method...of flash programming of c2000 F28027f with  DRV_BoostXL_8301.

  • for the LAUNCHXL-F28027F all the projects are already built to reside in Flash.

    However, the projects are written expecting that you will instrument the variables through the debugger. So you will need to modify the code to at a minimum set the variables to the new values like you were instrumenting them (enable system, any flags, enable, setting an initial speed). If you need to send new speed/torque commands you will need a driver and SW to do this as well. Some options are discussed in the HAL guide:
    C:\ti\motorware\motorware_1_01_00_14\docs\tutorials
  • First of all thank you very much thank you to Mr Chris Clearman and Miss Maria Todorova. Now i can run the motor in standalone mode without the Computer  connection..Actually i am not changing the flags in the program of project_lad_5.c file  i.e. exactly here (gMotorVars.UserErrorCode = USER_getErrorCode(&gUserParams);

  • Now Please tell me how to connect the Potentiometer to my C2000f28027f and BoostXL_8301 kit Combination.

    There is code and hardware setup given  in the Motorware_2014  HAL Tutorial,,BUT its only for the [[[[_c2000F2806x and a drv8301kit_revD combination__]]]

    The Harware Connection for Potentiometer Adding is as follows for [[[[__c2000F2806x and a drv8301kit_revD combination__]]]]

    THE C code is like this;which  I supposed to be add in HAL.c and  HAL.h files; if i have the c2000F2806x and a drv8301kit_revD combination :::

    But I wanted it to be apply  in the c2000F28027f  and BoostXL_DRV8301  Combination.

    can you please tell me the corresponding pin number of c2000F28027f  MicroController ;which i have to be change in above program.

    Because there are ADC channels available in C2000F28027f  controller.

    Please tell me what change(that is pin number ) i have to made in that above program mentioned, and also mentioned  any other procedure  which you know.