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.

Controlling motor with foot throttle through drv8301 69M

Other Parts Discussed in Thread: DRV8301, MOTORWARE, TMS320F28069, CCSTUDIO

Hello

I am working on driving a 24V hub motor using a foot throttle through the drv8301 69M. I was able to spin the motor using InstaSPIN-FOC. However, the project requires the use of a throttle to control the motor. I have very little knowledge in programming and motor controlling. Is there a specific lab in motorware that may be able to get me started with the programming aspect of this project.

Thank you for your time

Fritz

  • Fritz,

    We have certainly used the POT on the DRV8301 board (I assume your throttle will also use a similar technique, adjusting a 0 to 3.3V signal to the ADC), but we've never released SW in MotorWare showing this.

    It is pretty straight forward.

    • -you need to get the ADC sample from his channel
      • to do this "clean" you shoul have an ADC_setup() that runs in your background (non interrupt) that handles tasks like these, running when you tell them to run; while the standard ADC runs in the main interrupt to get currents and voltages based on the PWM timer.
      • if you just want to add a single reading like this you may as well forego "clean" and add it to the main ADC setup (which is in the drv files for your board)
      • then you have to take this value and save it to a variable
      • then decode this value from the 12b ADC register value to a representation of your input
      • if you are using it as an IqRef_pu in MotorWare you basically have to decide how to normalize your reading. Is 0V -1.0pu and 3.3V 1.0pu?  Or is this a forward only controller and you want to normalize 0V to 0 pu and 3.3V to 1.0pu?  Or will you have the POT just control the magnitude and something else will control the directional sign?

    I'm sorry there isn't an example, but think of it this way: this will help you learn about the SW, which you will need to do at some point to create a product.

     

  • Thanks for the information Chris! I'm certain i'll have more questions in the future but what you've given me is a start.

  • Hi Chris,

    I ran into a couple more issues. 

    1) I am having trouble connecting to my board. I am using the drv8301 69M kit. I'm sure the device to connect to is TMS320F28069. Where I am really unsure is the connection. The board came with a USB cord so I eliminated using a blackhawk or spectrum digital emulator as an option. So I've tried connecting with TexasInstrumentsXDS100v1, TexasInstrumentsXDS100v2, TexasInstrumentsXDS100v3 USB emulator but was unsuccessful.

    I may be overlooking something. Any advice would help

    2) I wanted to I tried to import proj_lab01 from motoroware into ccs, however, I am getting an error message saying

    "Error: Import failed for project 'proj_lab01' because its compiler definition is not available. Please install the C2000v6.2 compiler before importing this project."

    (I noticed someone else was having a similar problem). As prompted, I downloaded c2000v6.2.5 from the TI website and it is still giving me the same error. Any suggestions?

    Thanks in advance

    Fritz 

  • 1. are you providing power at the Vbus on DRV8301?  Did you change any of the switches on the controlCARD?

    2. did you install into the correct location? alternatively you can just do a Help - Check for Updates and it should install automatically in the right place.

  • 1) Yes. I am providing 24V supply to the board. I don't believe any switches were changed on the control card. I'll go back and read the "READ ME FIRST" manual to double check. Would there be any other reasons why I'm not able to connect to the board?

    2) I've installed the program in ti>ccsv5>tools>compiler. This is where compiler 6.1.3 was located. I figured that would be the correct location. But i'll try the alternative.

    Thanks

    Fritz 

  • 1. you should have no problems if you have 6-60V at Vbus, controlCARD plugged in, and USB from PC to the controlCARD.  Check your windows Device Manager and make sure that when you plug in it recognizes as Texas Instruments XDS100 (it is v2 by the way).

    2. you have compilers installed in the correct location. Make sure you are running the ccstudio.exe from the same location ccsv5\eclipse

     

  • Hi chris

    I've made some progress on the project. I am taking what you mentioned earlier about running and sampling ADC into consideration. I found a code(drv8301-BLDC sensor) that you provided to another individual for a sensor project that seems like it may help. Also, would you know if any of the example projects may be able to give me a little more insight in using ADC?

    Thanks 

    Fritz

  • fritz,

    All functions and set-up for the ADC (like all peripherals) is done through the HAL files (fomeraly DRV files until MW _12 where we made this change).

    C:\ti\motorware\motorware_1_01_00_12\sw\modules\hal\boards\drv8301kit_revD\f28x\f2806x\src

    The instaspinlabs.pdf  - especially proj_lab01 discusses the use of the HAL.

    You should read though the HAL files, and then see in the proj_labXX.c files how the HAL_ commands are used.

    Inside the HAL is when the ADC_ commands are used.  The ADC_ commands are described in the ADC files for each MCU variant, ex:

    C:\ti\motorware\motorware_1_01_00_12\sw\drivers\adc\src\32b\f28x\f2806x

     

     

  • Hi Chris,

    Thank you for all the information so far on my project.

    1)I wanted to revisit what you mentioned about the pot speed control. What I've decided to do is desolder the pot off of the drv 8301board and solder the foot throttle signal wire in the pot's place and use the pedal like a pot. 

    Does this sound like a good idea? 

    2)How do I access/setup the pot on  CCS? Is there a keyword(i.e "pot" or "ADC_IntNumber_#")?  

    thanks 

    Fritz