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.

dual motor labs 6(e) and labs 11(d) - doesnt run

Other Parts Discussed in Thread: DRV8301, DRV8305

I was trying to test the dual motor labs

The lab manual says refer to comments in the code. I dont see any directions in the comments on how to run the code and what variables to set in the expressions tab based on the .js files.

I tried running both 6(e) and 11(d) but they seem to get stuck. Usually my best way to know that instaspin code is running is to observe VdcBus_kV in the expressions tab , it should turn yellow because vbus doesn't ever stay exactly the same.  In this case, the VdcBus_kV just stayed at 0.0 

I tried to put in some global test variables to see if control is going into main or is it getting stuck inside some loop. 

I tracked it down, 

looks like control does go into main

then it runs and exits the for(mtrNum=HAL_MTR1;mtrNum<=HAL_MTR2;mtrNum++)

it also runs and exits the for(cnt=0;cnt<6;cnt++)

but then i saw it executed line : HAL_enableAdcInts(halHandle);

but it got stuck some where inside : HAL_enableGlobalInts(halHandle); 

when i went furhter in, it seems to be stuck inside : CPU_enableGlobalInts(obj->cpuHandle);

Any suggestions on how to get labs 6(e) and 11(d) running. 

Where these labs tested on real hardware ie 2 x drv301 boards on top of launchpad with 2 motors hooked in? 

  • yes, they are tested and run

    I would think that perhaps your timing / TICKS are off, causing the interrupt to overflow. check your effective loop rates.
  • Subrat,

    The code for lab 06e is based on lab 06b.  In order to exercise the lab you can use the same variables as lab 06b except the array index corresponds to the boosterpack.  J1 is motor 0 and J5 is motor 1.  

    The key difference is that gMotorVars[0].Flag_enableSys operates on both motors.

    Make sure that when you wire up the two boosterpacks that you only use the jumpers for power and ground from either J1 OR J5 and that you connect the boosterpack Vdc terminals together so that they share a DC bus.

    This lab has been tested on both 2x drv8301 & drv8305 booster packs.