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.

kit DK-LM4F-DRV9312 with InstaSPIN project

Other Parts Discussed in Thread: MOTORWARE

I work with kit DK-LM4F-DRV9312 and use an application "InstaSPIN™-BLDC Sensor less control for the Stellaris LM4F2x" Version 1.0.2. The CCSv5 was downloaded, installed, and i running.Then the InstaSPIN project was imported.I build program in DEBUG mode, launched a debug session to load the code into the controller. The Stellaris LM4F2x device was connected. The InstaSPINWatch.js script was loaded too. After press the Run button program is running, but the motor is not spin. The variable "gDRVObj.isrTicker" is changing (interrupts works). I set the “gGUIObj.EnableFlg” to 1, but motor is not spin.

"gGUIObj.SpdMotor"            floats   1. #INF            0x20005204 

         See screenshot:

With "launcher.exe" as described in "DK-LM4F-DRV8312 READ ME FIRST" I successfully operated the motor using the GUI.

What is the problem of running debugging code to spin the motor?

 

  • Are you following the UG: C:\StellarisWare\AppNotes\sw01294\motorware_1_00_01_00\sw\solutions\instaspin_bldc\boards\drv8312kit_revD\stellaris\lm4f211\projects\ccs5\project01\docs

    To run in Duty Cycle mode, complete the following:

    1. Make sure the program is currently running on the device. If so, also assure that "gGUIObj.EnableFlg" is set to 0.

    2. Verify that "gGUIObj.CtrlType" is set to 0, for Duty Cycle Commutation Mode.

    3. Set "gGUIObj.EnableFlg" to 1.

    4. At this point, the variable "gDRVObj.isrTicker should be increasing. This confirms that the interrupt is running properly. The motor should start moving.

    The key steps can be explained as follows:

    The motor will gradually speed up and finally switch to closed loop commutation mode.

    The switch over from open loop commutation to closed loop commutation occurs when gDRVObj.rmp3Handle->ramp3DoneFlag is set to 0x7FFFFFFF indicating the end of motor speed up phase. Until this switch over occurs MOD6_CNT module is triggered by the output of IMPULSE module. After the switch over, MOD6_CNT module is triggered by the output of the InstaSPINTM

    -BLDC module.

    When the speed up phase is over, vary the motor speed by changing gGUIObj.DutyCmd. This varies the power delivered to the motor and hence it’s speed.

    Adjust gGUIObj.CommThreshold to achieve the desired commutation.

    Bring the system to a safe stop as described below by setting gGUIObj.EnableFlg to 0, taking the controller out of realtime mode and reset.

  • Hi,

    I've followed all instructions,but the motor still do not run .

    The variable gDRVObj.isrTicker changes from the start even gGUIObj.EnableFlg =0.

    And what is mean "gGUIObj.SpdMotor float 1.#INF " (INF???).

    Best  Regards,

    H.Friedman.

  • @Chris:

    Love both your detail & responsiveness - helps many - thank you.  (much appreciated)

    Appears you've performed "direct" copy/paste from unfriendly source (after "key steps" - we then note Geo. Costanza's famed/dreaded, "shrinkage")

    We find - copy first into "notepad" - then paste from notepad to forum - solves...  (Geo. could not so avail/benefit...) 

  • Haim,

    I'm sorry, I haven't run this since we released it last summer. Since that time I've re-installed CCS (*cough* multiple times *cough* ) and don't have ARM support on any of my current isntalls, so I can't try to run it right now.

    The isrTicker should run all the time as soon as the project is put into the run state, regardless of other flags. So that's working correctly.

    I also saw that the SpdMotor variable had that 1.#INF flag. I've never seen that before.all of the gGUIObj variables are defined in gui.h

    gui->SpdMotor = SPEED_MEAS_CAP_Get_Speed_Output(gDRVObj.speedHandle);

    this is defined in

    sw\modules\speed_pr\src\float32\stellaris\speed_pr.c

    _iq SPEED_MEAS_CAP_Get_Speed_Output(SPEED_MEAS_CAP_handle speedHandle)
    {
        SPEED_MEAS_CAP *speedObj = (SPEED_MEAS_CAP *)speedHandle;
        return speedObj->speed;
    }

    Everything looks ok to me.

    Did you run with the GUI and find a good Vth value for your motor to commutate?

     

    cb1,

    I copied / pasted using the little clipboard Windows icon. It looked ok in my window before I hit Post. I'll try NotePad++ next time. Speaking of Costanza, the one I use most is his simple, "was that wrong?".  Very appropriate when reading many forum posts. :)

     

  • ChrisClearman said:
    "was that wrong?". 

    Ha!  Indeed simple - fully "PC" compliant (enabling use - here) and especially appropriate during the hallowed celebration - Festivus...

  •  

    "Did you run with the GUI and find a good Vth value for your motor to commutate?"

    With the GUI kit works good.

    But when we control V in "Duty cycle" mode V,for example,  = 4000 rpm,and in "Velocity"  or "Cascade"mode  I can not achieve this V value,maximum near 3000 rpm,

    for any Kp.

    But it is not issue for me. I need work in debug mode with source code!

    Thanks.

  • Haim,

    I understand your needs. Unfortunately I'm out of the office traveling this week, so I'm hoping someone from the ARM team can pull up CCS and help you debug this issue. It seems like something to do with the compiler or real-time debug to me.