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.

Can't get motor to go CCW

I am working with Motion Sequence Example Lab 6b.

I have gone through the labs to this point several times. I have a "gold" copy of user.h for motion looked over by TI engineers. (attached)

And I still can't get this motor to go CCW in the labs. It just sits there when It should go CCW, but does go CW.

Can anybody point me in the correct direction?

Much Thanks,

David

0523.user.h

  • David,

    I've seen this a couple different times.  Can you confirm which version of the compiler you are using.

    In CCS click: Help -> About Code Composer Studio -> Installation Details

    Look for the line with the name C2800 Compiler Tools, it should be at least 6.2.3.  

    There is an issue with the 6.2.0 - 6.2.2 compilers where they do no handle fixed point math correctly.  I've see where they only allow the motor to spin in one direction.

    The other thing to look at is the bandwidth that you have set for the SpinTAC controller.  In the user.h file that you attached the bandwidth is set to 1.0.  This is a really low bandwidth.  Have you tried increasing it?

  • Adam,

    Thanks for the quick reply. The 2800 compiler I have is:

     C2800 Compiler Tools    6.2.0      com.ti.cgt.c2000.6.2.win32.feature.group             Texas Instruments

    Could you tell me how to update this? and....No I have not tried to change the bandwidth, Which I will do as soon as I up date the compiler.

    Much Thanks,

    David

  • David,

    You need to click: Help -> Check for Updates.  It should step you through the process.

  • Thank you Adam,

    Sounds simple enough. Let me unplug my soldering pencil and try it. Besides I have looked on the floor

    for the SMD capacitor that slid off the board long enough. :)

    David

  • Ok, found the SMD capacitor.

    Updated software, C2800 Compiler Tools     6.2.6

    Still have same problem, won't go CCW.

    Changed bandwidth, per suggestion,to 3 just to up it a little. I don't know if that is enough on not enough.

    Oddly, enough TI has worked with the user.h file, which when returned I saved as a "gold" file.

    Been trying to get this motor to reverse for months now, any suggestions welcome.

    Thanks,

    David

  • David,

    Make sure you clean and rebuild the project.  CCS might not have detected there was a change and could still be using the code that was compiled using the old compiler.

  • Adam,

    Thanks for the reply, this has been beating me up for some time. Think I will try that in the morning.

    I hope you are not offended by my doing so.

    Is there a chance we could have a board problem that would cause this?

    Later,

    David

  • David,

    This is a compiler issue. There is a sticky on this topic right on the first page. 

  • I am working with Motion Sequence Example Lab 6b.

    I have gone through the labs to this point several times. I have a "gold" copy of user.h for motion looked over by TI engineers.

    And I still can't get this motor to go CCW in the labs. It just sits there when It should go CCW, but does go CW.

    My compiler says TI V6.2.6

    Family C2000                     Generic C28xx Device

    Much Thanks,

    David

  • David,

    Were you able to clean and build the project?

    It is possible the CCS is not using the newest compiler.  To check this, right click on the project and select properties.  Select General.  On the screen should be either a Compiler Version or an Effective Compiler Version.  Which version is listed under those?

  • Thanks Adam,

    Yes, I did the Clean and build project. No change.

    I did the right click on properties and that is where I got under "General" Ver. 6.2.6.

    It is listed as Compiler Version.

    David

  • Adam,

    Let me do some more checking....Please.

    I did a clean "again", built project.....Then had some problems, it wouldn't generate an "out" file, compiled again

    This time it sent an "out" file. Started program, Set bits, and Holy smoke it actually 

    agitated like it should and went into spin cycle.....Tried it again....worked again.

    let me check a couple of things.

    david

  • Adam,

    While you are still around, I want to change states, ex. State A to B, Which file is that located in?

    I did find it once but I am having trouble locating it today. Search only lets me look in my open files and since it is now working I am a little skitish about doing to much to fast.

    It is going CW and CCW now. Now these labs are going to mean something. :)  Wow......long time coming.

    Thanks to all the TI eng. who helped me.

    David

  • Oh, yeh, while I am asking questions. Where would I find information on the GUI and FLASHING this to the micro so my program would stay there after power loss.?

    Lots of stuff I have not been able to look up because I couldn't get it to go CCW..   WHeeeeeeeee!!!!!

    We're going to have fun now........

    David

  • David,

    You should be able to modify the state machine in the proj_lab06b.c file.  Should be in a function called ST_setupVelPlan.  

    In order to flash the micro you need to change the build configuration from Release to Flash.  This will load code into the flash of the device.  Right click on the project and select "Build Configurations" -> "Set Active" -> "Flash".  In order to boot without the debugger connected you need to change the pins on the ControlCard.  After you program the card, set SW3 position 1 to OFF.  This will boot from the flash of the device.  

    In order for a project to start running from flash you need to make sure that gMotorVars.Flag_enableSys & gMotorVars.Flag_Run_Identify are defaulted to start at 1.