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.

DRV8301-HC-C2-KIT motor phase current lower threshold.

Other Parts Discussed in Thread: DRV8312, DRV8301, TMS320F28033

Greetings,

I have a 3A lower motor current threshold limit on the motor phase, which means i cannot regulate the current <3A. I use sensored control with hall sensors on the DRV8301-HC-C2-KIT. Is there a away to remove this current offset of 3A, so it will be possible to regulate the motor phase current under this 3A limit? If so is it a software or hardware issue and how could i remove it? When i worked with the DRV8312 kit it was possible to regulate the current below 3A and almost up to 0A.

Yours sincerly,

Pavel Ruban

 

  • Pavel,

     

    For starters, I think you would want to swap out the sense resistors with something larger to get more dynamic range on the current sense...the current EVM is designed for 85A!!!

    The gain of the op amp would then need to be adjusted to cover a 0-3.3V range and center the bias point at 1.65V.  You could actually copy the values over from the DRV8312 kit and use the code from the 8312 kit as well for the scale factors as you seem to be familiar with that kit already.

    In 1Q12, we plan to release a much smaller version of the EVM that will support <10A currents and be much more optimized for your application.

     

     

     

  • Hello,

    I have changed the sense resistors to 20mOhm instead of old values of 2mOhm. Gain of the opamp is 10, like before. This should give me a dynamic range of up to 8.5A, but i still cannot regulate the current under 3A.

    I use the offset adjustment for the PID regulator from the sensorless project:

    IDCfdbk=-((_IQ15toIQ(AdcResult.ADCRESULT4<<3)-IDC_offset)<<1);                (DRV8301)

     Is it in this code the motor phase offset current needs to be adjusted, or is it in another place? Are there some settings for sensorless control that affect this motor phase current offset, compared to sensored control?

     

     

     

     

  • Pavel,

    Are you using the InstaSpin GUI? All of the code released so far for the DRV8301 EVM is sensorless so there should be no Hall sensor hooked up, as long as the motor is between 8 and 60 volts and less then 60A it will run. If your adjusting the sense resistor in the InstaSpin GUI under the Settings tab you would change the Current loop and the line of code you have written above would not need to be changed.

    If you are taking the sensored code from the DRV8312 EVM and applying it to the DRV8301 then you would need to incoporate the SPI and Register changes that are made in the InstaSpin GUI code and change the BASE_CURRENT & BASE_VOLTAGE on line 645 of DRV8312GUI_Main.c along with modifying the Current loop.

    Let me know which method you are using above and if you need more help,

    LT

  • Hi Thomas,

    I started the project as sensorless, an example project called BLDC_Int. I have modified the project to run hall sensor control by changing hall_gpio_BLDC.h so I could read from the right GPIO pins. My build level is inspired by the one from DRV8312-KIT, BLDC-sensored project BUILDLEVEL5.

    I have attached my buildlevel code for hall sensor control using the BLDC_Int project:

    0336.BLDC_Int_hallsensor.txt
    	_iq IDCfdbk;
    
    	_iq IRef1;
    
    // ------------------------------------------------------------------------------
    //    ADC conversion and offset adjustment 
    // ------------------------------------------------------------------------------
    
       
    #if defined(DRV8301) || defined(DRV8302)
        IDCfdbk=-((_IQ15toIQ(AdcResult.ADCRESULT4<<3)-IDC_offset)<<1);
    #endif
    
    // ------------------------------------------------------------------------------
    //    Connect inputs of the MOD6 module and call the Modulo 6 counter macro.
    // ------------------------------------------------------------------------------   
    	if(IRef > _IQ(0.0))
    	{
    		mod_dir1.CntDirection = _IQ(1.0);
    	}
    	else
    	{
    		mod_dir1.CntDirection = _IQ(-1.0);
    	}
    	PreviousState = mod_dir1.Counter; 
    	MOD6CNTDIR_MACRO(mod_dir1)
    
    
    
    // ------------------------------------------------------------------------------
    //    Connect inputs of the HALL module and call the Hall sensor read macro.
    // ------------------------------------------------------------------------------
          hall1.HallMapPointer = (int16)mod_dir1.Counter; 
    	  HALL3_READ_MACRO(hall1)
          if (hall1.Revolutions>=0)
          	ClosedFlag=TRUE;
          	
          // ------------------------------------------------------------------------------
    //    Connect inputs of the MOD6 module and call the Modulo 6 counter macro.
    // ------------------------------------------------------------------------------      
       if (ClosedFlag==FALSE) 
       {
          mod_dir1.TrigInput = impl1.Out;
          mod_dir1.Counter = (int32)hall1.HallMapPointer; 
       }
    	
       else 
          mod_dir1.TrigInput = (int32)hall1.CmtnTrigHall;
    
    	 MOD6CNTDIR_MACRO(mod_dir1)
    
    // ------------------------------------------------------------------------------
    //    Connect inputs of the RMP3 module and call the Ramp control 3 macro.
    // ------------------------------------------------------------------------------
    		rmp3.DesiredInput = CmtnPeriodTarget;
    		rmp3.Ramp3Delay = RampDelay;
    		RC3_MACRO(rmp3)	
    
    // ------------------------------------------------------------------------------
    //    Connect inputs of the IMPULSE module and call the Impulse macro.
    // ------------------------------------------------------------------------------      
    		impl1.Period = rmp3.Out;
    		IMPULSE_MACRO(impl1)	
    
    
    // ------------------------------------------------------------------------------
    //    Connect inputs of the PID_REG3 module and call the PID current controller
    //	  macro.
    //------------------------------------------------------------------------------  
    	pid1_idc.term.Ref = IRef1;
    	pid1_idc.term.Fbk = _IQmpy(IDCfdbk,mod_dir1.CntDirection);
    	PID_GR_MACRO(pid1_idc)
    	
    	// ------------------------------------------------------------------------------
    //    Connect inputs of the PWM_DRV module and call the PWM signal generation
    //    update macro.
    // ------------------------------------------------------------------------------
    
        pwmcntl1.Duty = pid1_idc.term.Out;
    
    		
    	   if (ClosedFlag==TRUE)  {
         if (hall1.CmtnTrigHall==0x7FFF) {
    
          PreviousState = pwmcntl1.State;
    
    
    // inverted Hall logics for commutation states. 
          if (hall1.HallGpioAccepted==5) 
            pwmcntl1.State = 0;
    
          else if (hall1.HallGpioAccepted==1) 
            pwmcntl1.State = 1;
    
          else if (hall1.HallGpioAccepted==3) 
            pwmcntl1.State = 2;
    
          else if (hall1.HallGpioAccepted==2)
            pwmcntl1.State = 3;
    
          else if (hall1.HallGpioAccepted==6)
            pwmcntl1.State = 4; 
    
          else if (hall1.HallGpioAccepted==4) 
            pwmcntl1.State = 5;
    
    
    
        }    //hall1.CmtnTrigHall == 0x7FFF   
      } // ClosedFlag==TRUE
      
      else
          pwmcntl1.State = (int16)mod_dir1.Counter;
          PWM_CNTL_MACRO(pwmcntl1)

     

     

     

     

  • I would also like to mention one thing around the ADC conversion.

    When i look at the AdcResult.ADCRESULT4 in CCS watch window, which has a bias point around 2048, the number keeps on dropping down and back to the bias point  when current is running in the motor phase. Ideally the ADCRESULT4 should always show 2048 - measured_current, without jumping back and forth ( constant without much variation during a given current ).

    Im thinking this could also be some issue with ADC configuration?

  • Pavel,

    I am confused on what you mean with ADCRESULT4 should always show 2048. ADCRESULT4 is measuring the current draw seen by the motor, so when the motor is running this number will jump back and forth from the bias point, but ADCRESULT4 should be set to sample the peak amount being drawn. The ADC configuration should be set up as seen in the graph below.

     

    LT

  • Hi Thomas,

    The problem i had for controlling very low currents, was due to that i was measuring a very weak analog signal with a lot of noise. So my sampled signal had a low of unwanted information (that was when measuring with U13 opamp, I-Total signal). The I-TOTAL signal also had information of the difference between two of the Rsense voltages, and that made it even more difficult, where sampling time had to be very accurate.

    Therefore i changed my strategy by sensing at different sense resistors, dependent on the commutation State i was (using the two current opamps in the DRV8301). By doing this the analog signal was much more pure, and not as distorted as the I-Total (by knowing what Rsense to measure at a given State). This solved my problem and now I'am able to regulate very low current (<100mA) in the motor phase.

    I would like to ask a question about how the ADCResult data is saved. As an example from the BLDC_int sensorless code, the ADCRESULT is shifted 3 times and then 1 time. Could you explain me the reason for this:

     IDCfdbk=-((_IQ15toIQ(AdcResult.ADCRESULT4<<3)-IDC_offset)<<1);

    Thank you,

    Pavel

  • Pavel,

    I am glad you were able to come up with this solution.  So the first 3 shift to the left is convert the 12 bit ADC reading to a 15bit signed Value, this is done just so we can have more precision when multiplying numbers together in the IQ (Signed Fixed point) Library. The shift 1 at the end is to times the current signal by 2, this is needed because we are moving from an unsigned number to a signed number.

    LT

  • Dear Ryan,

    I'm a new one of Piccolo motor control, Now I'm testing the eval.8301, it's ok.

    I have some question about it.

    1. If I need to use sense resistor 0.003 ohm, how do I modify the code? the phase current is <20A

    2. In my schematic, I use TMS320F28033 64 pins (cost reasonable), Can we convert the GUI sample code to 28033?

    Thank

     

    Pariyet S.

  • Pariyet,

    Yes the code will work on the 28033, the only difference between that and the 28035 is the amount of memory and InstaSPIN takes less then 6K so theres plenty of room. And the 64 pin package has all the necessary peripherals.

    In the code you do not need to change anything as long as your sense resistor is scaled to have a range of 3.3v  or less.

    L%

  • Pariyet,

    Yes the code will work on the 28033, the only difference between that and the 28035 is the amount of memory and InstaSPIN takes less then 6K so theres plenty of room. And the 64 pin package has all the necessary peripherals.

    In the code you do not need to change anything as long as your sense resistor is scaled to have a range of 3.3v  or less.

    LT

  • For a motor phase current of 2 amps max, what resistor value is suggested on drv8312evm and resistor id number. Gain formula also appreciated with all suggested board modifications.

    Jonathan

  • Also are any c code changes needed for picolo 6 step commutation sensorless bldc project and sensorless field oriented control sfoc code composer projects on picolo & concerto?

    My motor is bldc with rotating magnets at 30000 rpm. Faster pwm reduced ripple currents  and I need to log 30KiBytes/sec to flash plus do ethernet or usb so leaning towards concerto or an fpga soc like zynq.

  • Jonathan,

    I am going to move this post to the C2000 forum that can better support your questions in terms of MCU device selection.