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.

INSTASPIN-BLDC: false value of SpeedKrpm when performing project Lab11e motorware18

Part Number: INSTASPIN-BLDC
Other Parts Discussed in Thread: DRV8301, MOTORWARE

Hello there,

I am trying to spin a bldc with medium inductance on LAUNCHXLF28069M  and  DRV8301(developed on boostxl reference).

I tried with the previous motorware lab11e(motorware16) which didn't work on the transition ; I was able to run only on the Trapezoidal commutation mode.

But It wasn't transiting to FAST .

So, I went on to motorware18 ; but here I followed the instaspin_labs manual.pdf

The following were the steps I performed:

-> Updated the ADC channels corresponding to the Current and Voltage feedback according to the hardware developed.

-> Updated the User Motor Parameters


Step 2.
In user.h, make sure motor parameters are known and correctly set. Lab 11e only works on PM motors with 3 hall sensors.
Step 3.
In Code Composer, build proj_lab11e, connect to the target and load the .out file.
 Open the command file “sw\solutions\instaspin_foc\src\proj_lab11e.js” via the Scripting Console
o This will add the variables that we will be using for this project into the watch window
271
 Enable the realtime debugger
o This will let the debugger update the watch window variables
 Click the run button.
o This will run the program on the microcontroller
 Enable continuous refresh on the watch window.
o This will continuously update the variables in the watch window
Step 4.
To run the motor with Hall sensors
 To start the project, set the variable “gMotorVars.Flag_enableSys” equal to 1.
 Set low and high speed for changing the control method in “gHall_speed_FastToBldc_low_pu” and “gHall_speed_BldcToFast_high_pu”.
 To turn on the pwms to the motor, set the variable “gMotorVars.Flag_Run_Identify” equal to 1.
 The acceleration can be modified by adjusting the value in “gMotorVars.MaxAccel_krpmps”.
 Set a reference speed to “gMotorVars.SpeedRef_krpm” in order to run the motor at a target speed.
Step 5.
When finished experimenting to stop the motor
 Set the variable “gMotorVars.Flag_Run_Identify” to 0 to shut down the motor.
 Turn off real-time control and stop the debugger.
 Turn off power supply of drive kit.

The results were:

After I enable the gMotorVars.Flag_enableSys,

I enable the gMotorVars.Flag_enableRsRecalc ; after it is calculated the flag turns false.

Now setting gHall_speed_FastToBldc_low_pu = 0.007999956608

and gHall_speed_BldcToFast_high_pu = 0.02499997616

Then I enable gMotorVars.Flag_Run_Identify and set the gMotorVars.SpeedRef_krpm =0.60-2.0 (varying the values)

also found that 0.60 is the minimum value in which my motor spins

& gMotorVars.MaxAccel_krpmps =1.0

The motor spins but shows wrong Krpm values.

Also It dont start at zero speed ; I need to move the rotor a bit for startup.

Looking forward for a guidance.

  • What's the scale frequency in your project? What krpm are the gHall_speed_FastToBldc_low_pu and gHall_speed_BldcToFast_high_pu?
    Make sure the connection of motor line and hall signal lines is right which need to be corresponded to the order in gHall_PwmIndex, that will cause the motor can't run well with hall sensor if not right.
  • Sir, I have got the machine with  parameters as :
      RPM = 380; Poles = 40 ;

    Hence, I've set the below parameters :
      USER_IQ_FULL_SCALE_FREQ_Hz           (150.0)         //Hz =(RPM * Poles) / 120 ;
      USER_VOLTAGE_FILTER_POLE_Hz       (335.93)
      USER_MOTOR_TYPE                                          MOTOR_Type_Pm
      USER_MOTOR_NUM_POLE_PAIRS                   (20)
      USER_MOTOR_Rr                                               (NULL)
      USER_MOTOR_Rs                                               (0.5543705)
      USER_MOTOR_Ls_d                                            (0.001015453)
      USER_MOTOR_Ls_q                                            (0.001015453)
      USER_MOTOR_RATED_FLUX                            (0.1954807)
      USER_MOTOR_MAGNETIZING_CURRENT       (NULL)
      USER_MOTOR_RES_EST_CURRENT               (5.0)
      USER_MOTOR_IND_EST_CURRENT                (-5.0)
      USER_MOTOR_MAX_CURRENT                        (20.0)
      USER_MOTOR_FLUX_EST_FREQ_Hz               (20.0)
      IPD_HFI_EXC_FREQ_HZ                                    (100.0)       // excitation frequency, Hz
      IPD_HFI_LP_SPD_FILT_HZ                              (10.0)        // lowpass filter cutoff frequency, Hz
      IPD_HFI_HP_IQ_FILT_HZ                                   (20.0)        // highpass filter cutoff frequency, Hz
      IPD_HFI_KSPD                                                     (31.4)        // the speed gain value
      IPD_HFI_EXC_MAG_COARSE_PU                     (0.2)         // coarse IPD excitation magnitude, pu
      IPD_HFI_EXC_MAG_FINE_PU                            (0.2)         // fine IPD excitation magnitude, pu
      IPD_HFI_EXC_TIME_COARSE_S                       (0.2)         // coarse wait time, sec max 0.64
      IPD_HFI_EXC_TIME_FINE_S                              (0.1)         // fine wait time, sec max 0.4
      AFSEL_FREQ_HIGH_PU                                     (_IQ(20.0 / USER_IQ_FULL_SCALE_FREQ_Hz))
      AFSEL_FREQ_LOW_PU                                      (_IQ(10.0 / USER_IQ_FULL_SCALE_FREQ_Hz))
      AFSEL_IQ_SLOPE_EST                                      (_IQ((float)(1.0/0.1/USER_ISR_FREQ_Hz)))
      AFSEL_IQ_SLOPE_HFI                                       (_IQ((float)(1.0/1.0/USER_ISR_FREQ_Hz)))
      AFSEL_IQ_SLOPE_THROTTLE_DWN               (_IQ((float)(1.0/0.05/USER_ISR_FREQ_Hz)))
      AFSEL_MAX_IQ_REF_EST                                (_IQ(0.4))
      AFSEL_MAX_IQ_REF_HFI                                 (_IQ(0.4))

    _iq gHall_speed_FastToBldc_low_pu  = _IQ(0.400*USER_MOTOR_NUM_POLE_PAIRS*1000.0/(USER_IQ_FULL_SCALE_FREQ_Hz * 60.0));        // 400rpm
    _iq gHall_speed_BldcToFast_high_pu = _IQ(0.750*USER_MOTOR_NUM_POLE_PAIRS*1000.0/(USER_IQ_FULL_SCALE_FREQ_Hz * 60.0));        // 750rpm

    Also I can spin the motor with the following procedure:

    Checked the Hall sensors with the phase sequences.
    gMotorVars.Flag_enableSys = 1;
    gMotorVars.Flag_enableRsRecalc = 1;
    wait for the calculations to complete untill gMotorVars.Flag_enableRsRecalc =0;
    gMotorVars.Flag_Run_Identify = 1;
    gHall_speed_FastToBldc_low_pu  = 0.0001;
    gHall_speed_BldcToFast_high_pu = 0.0080;
    gHall_Flag_CurrentCtrl =1;
    gMotorVars.SpeedRef_krpm = 0.060; (minimum value where the motor spins with a force start by hand) ; but the speedKrpm shows value near to 0.060 ;
    The mechanical speed of the machine is not 60rpm as seen;
    Also when I vary the gMotorVars.SpeedRef_krpm to 2.25 (2250rpm) the speedKrpm value is near to 2.20 (2200rpm). Here the mechanical speed of the Machine is 290rpm.