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.

LAUNCHXL-F28069M: lab3b VS lab5c

Part Number: LAUNCHXL-F28069M
Other Parts Discussed in Thread: DRV8305

Hi,

Fiddling with lab3b,

with the following user configuration

#define USER_MOTOR_FREQ_LOW				(10.0)		/* 10% of rated motor frequency		*/
#define USER_MOTOR_FREQ_HIGH			(150.0)		/* 100% rated motor frequency		*/
#define USER_MOTOR_FREQ_MAX				(180.0)		/* 120% of rated motor frequency	*/
#define USER_MOTOR_VOLT_MIN				(3.0)		/* 15% of rated motor voltage		*/
#define USER_MOTOR_VOLT_MAX				(36.0)		/* 100% rated motor voltage			*/

/* Lab 2c	*/
#define USER_PWM_FREQ_kHz				(100.0)
#define USER_MOTOR_FLUX_EST_FREQ_Hz 	(120.0)


#define USER_MOTOR_RES_EST_CURRENT 		(1.0)
#define USER_MOTOR_MAX_CURRENT 			(3.0)
#define USER_MOTOR_NUM_POLE_PAIRS 		(1)


/* Lab 3b, parameters from lab 3a Run */
#define USER_MOTOR_Rr					(NULL)
#define USER_MOTOR_Rs					(0.486400336)
#define USER_MOTOR_Ls_d 				(0.000118467273)
#define USER_MOTOR_Ls_q 				(0.000118467273)


#define I_A_offset						(0.9788709283)
#define I_B_offset						(0.9824429154)
#define I_C_offset						(0.9814400673)

#define V_A_offset						(0.5764682293)
#define V_B_offset						(0.5764139295)
#define V_C_offset						(0.5716812611)

The motor which can run at a maximum of 50,000 RPM, runs at 36,000RPM. Which looks like the maximum I can run ?

Issue #1. I cant seem to make it run faster than  ~ 35,000 RPM. Tried fiddling around with the PWM_FREQ and MOTOR_FLUX frequencies, but it doesn't seem want to go any further higher

With an oscilloscope the waveform shows about 360Hz.  How to push it further up.

Additionally, running the same motor with lab6a with the following user configuration

/* Lab 2c	*/
//#define USER_PWM_FREQ_kHz				(45.0)
#define USER_MOTOR_FLUX_EST_FREQ_Hz 	(120.0)


#define USER_MOTOR_NUM_POLE_PAIRS 		(1)
#define USER_MOTOR_RES_EST_CURRENT 		(1.0)
#define USER_MOTOR_IND_EST_CURRENT		(-1.0)
#define USER_MOTOR_MAX_CURRENT 			(3.0)


/* Lab 3b, parameters from lab 3a Run */
#define USER_MOTOR_Rr					(NULL)
#define USER_MOTOR_Rs					(0.486400336)
#define USER_MOTOR_Ls_d 				(0.000118467273)
#define USER_MOTOR_Ls_q 				(0.000118467273)
#define USER_MOTOR_RATED_FLUX 			(0.0564761274)

#define I_A_offset						(0.9788709283)
#define I_B_offset						(0.9824429154)
#define I_C_offset						(0.9814400673)

#define V_A_offset						(0.5764682293)
#define V_B_offset						(0.5764139295)
#define V_C_offset						(0.5716812611)

/* Lab 5c */
#define USER_MOTOR_ENCODER_LINES		(1.0)
#define USER_MOTOR_MAX_SPEED_KRPM		(50.0)
#define USER_SYSTEM_INERTIA				(0.009338378906)
#define USER_SYSTEM_FRICTION			(-0.02804970741)

The following issues I do see:

The maximum speed the motor reaches is 18,000RPM. The motor runs with more noise in comparison, the PWM is smoother in the case with lab3b in comparison

If USER_PWM_FREQ_kHz is enabled: Once the motor is Run with enableSys and Run_Identify, the motor fails to run, even with VelIdRun to stop the PWM waveform, the RESET button needs to be pressed

How to increase PWM frequency with lab6a ?

Thanks,

Manu

  • Hi Manu,

    First, you should make the following three parameter match your motor (especially USER_MOTOR_FREQ_MAX):

    #define USER_MOTOR_FREQ_LOW (10.0) /* 10% of rated motor frequency */

    #define USER_MOTOR_FREQ_HIGH (150.0) /* 100% rated motor frequency */

    #define USER_MOTOR_FREQ_MAX (180.0) /* 120% of rated motor frequency */

    They are in electrical frequency Hz. The setting you have above looks way too small. Also what is the rated voltage when your motor run at 50 kRPM? Please make sure that your BUS voltage is high enough and the USER_MOTOR_VOLT_MAX and USER_MOTOR_VOLT_MIN parameters are set properly.

    For the USER_PWM_FREQ_kHz, you shouldn't need to change the value between labs. This value is limited by your switching device. If your switching device cannot handle such high switching frequency, you wouldn't want to make it super high.

    If you have made all the above correct and rerun the motor identification (lab03a), you may want to look at field weakening (lab09) which will let your motor run at higher speed. Thanks.

    Best regards,
    Han Zhang
  • Hi Han Zhang,

    Thanks for the help!
    Updated the Motor frequency, with lab3b which helped

    #define USER_MOTOR_FREQ_LOW (100.0) /* 10% of rated motor frequency */
    #define USER_MOTOR_FREQ_HIGH (500.0) /* 100% rated motor frequency */
    #define USER_MOTOR_FREQ_MAX (800.0) /* 120% of rated motor frequency */

    With this, I see a significant change from 35,000 - 39,000RPM
    The motor is rated at 50,000RPM @24V, but I have about 19V.
    This might probably explain, the speed not ramping up to 50,000RPM.
    That's great. I will get the bus voltage fixed with another power supply

    That said, for instaspin motion, lab6a; I am still at a loss how to increase the PWM frequency.
    The speed goes up to a maximum of 18,000RPM. Any thoughts ?

    Thanks,
    Manu
  • Hi Manu,

    In order to use InstaSPIN motion (SpinTAC), you should first run the Inertia ID (lab 05c) and do test run and tuning of the speed loop controller with lab05d and lab05e. You should be able to achieve the fast speed with lab05e.

    Since you are running at 100 kHz PWM frequency, I assume you have a low inductance motor. However, the control ISR is triggered by the PWM time base and we normally don't want to run the controller at 100 kHz. You may run into issues like interrupt overrun and cause the program fail to fun. Especially with the overhead of speed loop and trajectory generation.

    You can change the ISR, current loop, FAST estimator and speed loop frequency by changing the USER_NUM_ISR_TICKS_PER_CTRL_TICK, USER_NUM_CTRL_TICKS_PER_CURRENT_TICK, USER_NUM_CTRL_TICKS_PER_EST_TICK and USER_NUM_CTRL_TICKS_PER_SPEED_TICK in user.h file. I will recommend increase the USER_NUM_PWM_TICKS_PER_ISR_TICK to 2 or 3 to decrease the ISR frequency and set the other numbers as needed. Thanks.

    Best regards,
    Han Zhang
  • Hi Han Zhang,

    The driver that I have is a DRV8035. The user configuration that I have is the following for lab5c:

    #define MY_MOTOR						113
    #define USER_MOTOR						MY_MOTOR
    
    #elif (USER_MOTOR == MY_MOTOR)
    #define USER_MOTOR_TYPE					MOTOR_Type_Pm
    #define USER_MOTOR_NUM_POLE_PAIRS 		(1)
    #define USER_MOTOR_Rr					(NULL)
    #define USER_MOTOR_Rs					(0.486400336)
    #define USER_MOTOR_Ls_d 				(0.000118467273)
    #define USER_MOTOR_Ls_q 				(0.000118467273)
    #define USER_MOTOR_RATED_FLUX 			(0.0564761274)
    #define USER_MOTOR_MAGNETIZING_CURRENT	(NULL)
    #define USER_MOTOR_RES_EST_CURRENT 		(1.0)
    #define USER_MOTOR_IND_EST_CURRENT		(-1.0)
    #define USER_MOTOR_MAX_CURRENT 			(3.0)
    #define USER_MOTOR_FLUX_EST_FREQ_Hz 	(200.0)
    
    #define USER_MOTOR_ENCODER_LINES		(1.0)
    #define USER_MOTOR_MAX_SPEED_KRPM		(50.0)
    #define USER_SYSTEM_INERTIA				(0.01319819689)
    #define USER_SYSTEM_FRICTION			(-0.01226323843)
    
    #define USER_SYSTEM_BANDWIDTH_SCALE		(1.0)

    As you said, the motor is indeed a low inductance motor.

    As you can see, I am not running the PWM frequency of my choice. As you can see from the previous post. The PWM frequency of 100kHz is used in lab3b.

    If I were to enable the parameter "USER_PWM_FREQ_kHz    " the motor would not run at all. So I cannot see any way how to increase the PWM frequency at all!

    That was my first question, if that was not obvious. Sorry, if I was not clear enough.

    The second part, does the USER_NUM_ params to be applied still valid if the USER_PWM_FREQ_kHz still does not apply ?

    Slightly confused.

    Thanks,

    Manu

  • Hi Han Zhang,

    Running lab5e after lab5d, with the following user configuration:

    //--- Micromotor
    /* lab 5c */
    #define MY_MOTOR								113
    #define USER_MOTOR								MY_MOTOR
    
    #elif (USER_MOTOR == MY_MOTOR)
    #define USER_MOTOR_TYPE							MOTOR_Type_Pm
    #define USER_MOTOR_NUM_POLE_PAIRS 				(1)
    #define USER_MOTOR_Rr							(NULL)
    #define USER_MOTOR_Rs							(0.473050356)
    #define USER_MOTOR_Ls_d 						(0.000118467258)
    #define USER_MOTOR_Ls_q 						(0.000118467258)
    #define USER_MOTOR_RATED_FLUX 					(0.0564761274)
    #define USER_MOTOR_MAGNETIZING_CURRENT			(NULL)
    #define USER_MOTOR_RES_EST_CURRENT 				(1.0)
    #define USER_MOTOR_IND_EST_CURRENT				(-1.0)
    #define USER_MOTOR_MAX_CURRENT 					(3.0)
    #define USER_MOTOR_FLUX_EST_FREQ_Hz 			(200.0)
    
    #define USER_MOTOR_ENCODER_LINES				(1.0)
    #define USER_MOTOR_MAX_SPEED_KRPM				(50.0)
    #define USER_SYSTEM_INERTIA						(0.01319819689)
    #define USER_SYSTEM_FRICTION					(-0.01226323843)
    
    #define USER_SYSTEM_BANDWIDTH_SCALE				(65.0)
    //--- End Micromotor
    
    
    #define USER_NUM_PWM_TICKS_PER_ISR_TICK			(3)
    #define USER_NUM_ISR_TICKS_PER_CTRL_TICK		(1)
    #define USER_NUM_CTRL_TICKS_PER_CURRENT_TICK	(1)
    #define USER_NUM_CTRL_TICKS_PER_EST_TICK		(1)

    The motor is run at 10,000RPM. All is well, the motor runs smoothly, no noise at all. The motor frequency is between 163-170Hz

    The motor can be run at a maximum of  ~ 19,500RPM and no more. The motor frequency is now between 318-331Hz. The motor runs with a chattering noise. Also the PWM waveform is not as stable as when run at 10,000RPM. I thought the motor bearings were at issue, but running lab3b at 39,000RPM, the chattering sound does not exist.

    Lab3b looks the most promising, but would be interested in getting instaspin motion also going.

    It appears to me as though the USER_NUM_* parameters do not make any difference at all.

    Any thoughts/suggestions ?

    Thanks,

    Manu

  • Hi Mamu,

    Based on the user configuration, I have the following observations:

    1. Since your motor has a fairly low inductance, you can try to run lab02c for the motor ID.
    2. The USER_SYSTEM_FRICTION is normally a positive value. Negative value suggests negative friction, which is not realistic.
    3. The USER_SYSTEM_BANDWIDTH_SCALE doesn't seem to be a standard parameter in InstaSPIN. Do you mean to change the USER_SYSTEM_BANDWIDTH somehow?

    I also have some suggestions:

    1. The lab05c Inertia ID of InstaSPIN-Motion is meant to identify the load characteristic of the motion system. You should run the Inertia ID and tuning with load.
    2. The noise in the motor may suggest your USER_SYSTEM_BANDWIDTH is too high. Please try to reduce this number and see if the noise goes away.

    Also, can you please provide some further information about your motor (type, rated voltage, rated current, etc.), board and end application to support further discussion in your next reply after doing all above? Thanks.

    Best regards,
    Han Zhang
  • Hi Han Zhang,

    Based on  previous labs , came up with the user configuration, as you can see in my previous post as well, but adding in here for making it easier:

     
    //--- Micromotor
    
    #define USER_MOTOR_FREQ_LOW				(10.0)		/* 10% of rated motor frequency		*/
    #define USER_MOTOR_FREQ_HIGH			(150.0)		/* 100% rated motor frequency		*/
    #define USER_MOTOR_FREQ_MAX				(180.0)		/* 120% of rated motor frequency	*/
    #define USER_MOTOR_VOLT_MIN				(3.0)		/* 15% of rated motor voltage		*/
    #define USER_MOTOR_VOLT_MAX				(36.0)		/* 100% rated motor voltage			*/
    
    /* Lab 2c	*/
    #define USER_PWM_FREQ_kHz				(100.0)
    #define USER_MOTOR_FLUX_EST_FREQ_Hz 	(120.0)
    
    
    #define USER_MOTOR_RES_EST_CURRENT 		(1.0)
    #define USER_MOTOR_MAX_CURRENT 			(3.0)
    #define USER_MOTOR_NUM_POLE_PAIRS 		(1)
    
    
    /* Lab 3b, parameters from lab 3a Run */
    #define USER_MOTOR_Rr					(NULL)
    #define USER_MOTOR_Rs					(0.486400336)
    #define USER_MOTOR_Ls_d 				(0.000118467273)
    #define USER_MOTOR_Ls_q 				(0.000118467273)
    //#define USER_MOTOR_RATED_FLUX 			(0.0564761274)
    
    #define I_A_offset						(0.9788709283)
    #define I_B_offset						(0.9824429154)
    #define I_C_offset						(0.9814400673)
    
    #define V_A_offset						(0.5764682293)
    #define V_B_offset						(0.5764139295)
    #define V_C_offset						(0.5716812611)
    
    //--- End Micromotor

    with this alone, I changed the FREQ_HIGH, _MAX parameters to make the motor run at a higher RPM with your help. With the change, the motor runs at a maximum of 39,500RPM which is a good sign, but less than 50,000RPM due to the lower bus voltage. The motor needs 30V, but I have about 24V.

    That said, have been trying to get it functioning properly with instaspin-motion lab5c, lab5e, lab6a. Based on your suggestion tried lab5e as you said that would be the best to get the motor running at maximum possible RPM.

    This is the user configuration, that I have been using with lab5e:

    //--- Micromotor
    /* lab 5c */
    #define MY_MOTOR								113
    #define USER_MOTOR								MY_MOTOR
    
    #elif (USER_MOTOR == MY_MOTOR)
    #define USER_MOTOR_TYPE							MOTOR_Type_Pm
    #define USER_MOTOR_NUM_POLE_PAIRS 				(1)
    #define USER_MOTOR_Rr							(NULL)
    #define USER_MOTOR_Rs							(0.473050356)
    #define USER_MOTOR_Ls_d 						(0.000118467258)
    #define USER_MOTOR_Ls_q 						(0.000118467258)
    #define USER_MOTOR_RATED_FLUX 					(0.0564761274)
    #define USER_MOTOR_MAGNETIZING_CURRENT			(NULL)
    #define USER_MOTOR_RES_EST_CURRENT 				(1.0)
    #define USER_MOTOR_IND_EST_CURRENT				(-1.0)
    #define USER_MOTOR_MAX_CURRENT 					(6.0)
    #define USER_MOTOR_FLUX_EST_FREQ_Hz 			(150.0)
    
    #define USER_MOTOR_ENCODER_LINES				(1.0)
    #define USER_MOTOR_MAX_SPEED_KRPM				(50.0)
    #define USER_SYSTEM_INERTIA						(0.01319819689)
    #define USER_SYSTEM_FRICTION					(-0.01226323843)
    
    #define USER_SYSTEM_BANDWIDTH_SCALE				(20.0)
    //--- End Micromotor
    
    #define USER_NUM_PWM_TICKS_PER_ISR_TICK			(3)
    #define USER_NUM_ISR_TICKS_PER_CTRL_TICK		(1)
    #define USER_NUM_CTRL_TICKS_PER_CURRENT_TICK	(1)
    #define USER_NUM_CTRL_TICKS_PER_EST_TICK		(1)
    

    1. With lab5c, I dont have any load. the motor is running free. The only load is a drill chuck is connected to the motor. But I guess the drill chuck alone is a small load. Isn't it ?

    2. Initially I tried the USER_SYSTEM_BANDWIDTH (described in lab5c) with 1.0, later tried increasing the value in accordance to what is stated in lab5e, which is why you see the value as 65. So when I had this parameter set to 1.0, the noise still existed. The noise kicks in at about 18,000RPM. Till then everything is fine.

    I am using a LAUNCHXL-F28069M with a DRV8305 (my own board, but very similar to BOOSTXL, except for the FET's). The Motor is rated at 30V, 50,000RPM, No. of pole pairs=1, No.of phase=3, nominal torque=27mNm. These are the only info that I have regarding the motor. As of now, my bus voltage is limited to 24V. This slotless high speed motor motor is definitely a low inductance motor for sure.

    Regards,

    Manu

  • Forgot to mention that the motor draws about 4A max.
  • Additionally, forgot to mention that I am calculating bandwidth based on this thread.
    e2e.ti.com/.../690629
  • Hi Manu,

    As you are doing drill motor, the motor shaft plus drill chuck is sufficient for USER_SYSTEM_INERTIA ID. To support the high bandwidth of your speed loop, you can try to increase the USER_SPEED_POLE_rps parameter. Please if there are any changes to the noise.

    Re-identify of the motor using low inductance mode with lab02c is still recommended as well. You can also try to run on our BOOSTXL to see if it make any difference as well. Thanks.

    Best regards,
    Han
  • Hi Han,

    Did a rerun of lab2c. It shoved slightly lower inductance and resistance for the motor.

    Previously they were according to lab3,

    #define USER_MOTOR_Rs (0.473050356)

    #define USER_MOTOR_Ls_d (0.000118467258)

    #define USER_MOTOR_Ls_q (0.000118467258)

    The results with lab2c:

    #define USER_MOTOR_Rs (0.470550358)

    #define USER_MOTOR_Ls_d (0.0000912074902)

    #define USER_MOTOR_Ls_q (0.0000912074902)

    With this change in lab5e:

    /* lab 5c */
    #define MY_MOTOR								113
    #define USER_MOTOR								MY_MOTOR
    
    #elif (USER_MOTOR == MY_MOTOR)
    #define USER_MOTOR_TYPE							MOTOR_Type_Pm
    #define USER_MOTOR_NUM_POLE_PAIRS 				(1)
    #define USER_MOTOR_Rr							(NULL)
    
    //#define USER_MOTOR_Rs							(0.473050356)
    //#define USER_MOTOR_Ls_d 						(0.000118467258)
    //#define USER_MOTOR_Ls_q 						(0.000118467258)
    
    // these 3 values from lab 2c
    #define USER_MOTOR_Rs							(0.470550358)
    #define USER_MOTOR_Ls_d 						(0.0000912074902)
    #define USER_MOTOR_Ls_q 						(0.0000912074902)
    
    
    #define USER_MOTOR_RATED_FLUX 					(0.0564761274)
    #define USER_MOTOR_MAGNETIZING_CURRENT			(NULL)
    #define USER_MOTOR_RES_EST_CURRENT 				(1.0)
    #define USER_MOTOR_IND_EST_CURRENT				(-1.0)
    #define USER_MOTOR_MAX_CURRENT 					(6.0)
    #define USER_MOTOR_FLUX_EST_FREQ_Hz 			(150.0)
    
    #define USER_MOTOR_ENCODER_LINES				(1.0)
    #define USER_MOTOR_MAX_SPEED_KRPM				(50.0)
    #define USER_SYSTEM_INERTIA						(0.01319819689)
    #define USER_SYSTEM_FRICTION					(-0.01226323843)
    
    #define USER_SYSTEM_BANDWIDTH_SCALE				(20.0)

    The motor now runs to a maximum of 20,000RPM instead of 18,000RPM, so does the chattering sound.

    Tried changing from 100 to 200 and eventually 400

    //! \brief Defines the software pole location for the speed control filter, rad/s
    #define USER_SPEED_POLE_rps           (400.0)   // 100.0 Default, do not change

    But that does not seem to make any difference.

    Thanks,

    Manu