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-F280025C: How to work with Motor control SDK

Part Number: LAUNCHXL-F280025C
Other Parts Discussed in Thread: DRV8353,

Hi,

After a lot of work due to incomplete documentation:

I have a motor spinning (sort of) with the universal project of the Motor Control SDK (V4.00) with LAUNCHXL-F280025C & DRV8353.

Motor: Allied Motion KM062 / 15-pole / 24V

Motor params:

#define USER_MOTOR1_TYPE MOTOR_TYPE_PM
#define USER_MOTOR1_NUM_POLE_PAIRS (15)
#define USER_MOTOR1_Rr_Ohm (NULL)
#define USER_MOTOR1_Rs_Ohm (0.192211851f)//meas uni lab (0.201803967)
#define USER_MOTOR1_Ls_d_H (9.02345652e-05f)//meas uni lab (8.16669053e-05)
#define USER_MOTOR1_Ls_q_H (9.02345652e-05f)//meas uni lab (8.16669053e-05)
#define USER_MOTOR1_RATED_FLUX_VpHz (0.0223167749f)//(0.0219697803) //PM motor, so always 0: stated somewhere in docs
#define USER_MOTOR1_MAGNETIZING_CURRENT_A (NULL) //PM motor, so always 0
#define USER_MOTOR1_RES_EST_CURRENT_A (1.5f)
#define USER_MOTOR1_IND_EST_CURRENT_A (-1.5f)
#define USER_MOTOR1_MAX_CURRENT_A (5.0f) //4.1 (4.1*24V =
#define USER_MOTOR1_FLUX_EXC_FREQ_Hz (90.0f) //motor=3600rpm/60sec = 60Hz*15polepare = 900 -> 10-30%
#define USER_MOTOR1_NUM_ENC_SLOTS (500) //Encoder HEDL-5540-A11, not used -> HALL used
#define USER_MOTOR1_INERTIA_Kgm2 (61.0e-06f)


#define USER_MOTOR1_FREQ_NEARZEROLIMIT_Hz (5.0f) // Hz

#define USER_MOTOR1_RATED_VOLTAGE_V (24.0f)
#define USER_MOTOR1_RATED_SPEED_KRPM (3.0f)

#define USER_MOTOR1_FREQ_MIN_HZ (1.0f) // Hz
#define USER_MOTOR1_FREQ_MAX_HZ (900.0f) // Hz

#define USER_MOTOR1_FREQ_LOW_HZ (10.0f) // Hz
#define USER_MOTOR1_FREQ_HIGH_HZ (100.0f) // Hz
#define USER_MOTOR1_VOLT_MIN_V (1.0f) // Volt
#define USER_MOTOR1_VOLT_MAX_V (24.0f) // Volt

#define USER_MOTOR1_FORCE_DELTA_A (0.05f) // A
#define USER_MOTOR1_ALIGN_DELTA_A (0.01f) // A
#define USER_MOTOR1_FLUX_CURRENT_A (0.5f) // A
#define USER_MOTOR1_ALIGN_CURRENT_A (1.5f) // A
#define USER_MOTOR1_STARTUP_CURRENT_A (3.5f) // A
#define USER_MOTOR1_TORQUE_CURRENT_A (2.0f) // A
#define USER_MOTOR1_OVER_CURRENT_A (7.5f) // A

#define USER_MOTOR1_BRAKE_CURRENT_A (1.0f) // A
#define USER_MOTOR1_BRAKE_TIME_DELAY (12000U) // 60s/5ms

#define USER_MOTOR1_SPEED_START_Hz (30.0f)
#define USER_MOTOR1_SPEED_FORCE_Hz (25.0f)
#define USER_MOTOR1_ACCEL_START_Hzps (10.0f)
#define USER_MOTOR1_ACCEL_MAX_Hzps (20.0f)

#define USER_MOTOR1_SPEED_FS_Hz (3.0f)

// only for encoder
#define USER_MOTOR1_ENC_POS_MAX (USER_MOTOR1_NUM_ENC_SLOTS * 4 - 1)
#define USER_MOTOR1_ENC_POS_OFFSET (668)

// Only for eSMO
#define USER_MOTOR1_KSLIDE_MAX (0.75f) //
#define USER_MOTOR1_KSLIDE_MIN (0.15f)

#define USER_MOTOR1_PLL_KP_MAX (6.75f) //
#define USER_MOTOR1_PLL_KP_MIN (0.75f)
#define USER_MOTOR1_PLL_KP_SF (5.0f)

#define USER_MOTOR1_BEMF_THRESHOLD (0.5f)
#define USER_MOTOR1_BEMF_KSLF_FC_Hz (1.0f)
#define USER_MOTOR1_THETA_OFFSET_SF (1.0f)
#define USER_MOTOR1_SPEED_LPF_FC_Hz (200.0f)

// for IS-BLDC
#define USER_MOTOR1_RAMP_START_Hz (3.0f)
#define USER_MOTOR1_RAMP_END_Hz (30.0f)
#define USER_MOTOR1_RAMP_DELAY (5)

#define USER_MOTOR1_ISBLDC_INT_MAX (0.015f)
#define USER_MOTOR1_ISBLDC_INT_MIN (0.010f)

// for Rs online calibration
#define USER_MOTOR1_RSONLINE_WAIT_TIME (60000U) // 5min/300s at 5ms base
#define USER_MOTOR1_RSONLINE_WORK_TIME (24000U) //2min/120s at 5ms base

HALL sensors calibrated according documenatation.

Motor tests:

####################

In DMC_LEVEL_3 (FAST & HALL enabled):

Spinning up the motor to 100Hz takes about 4 seconds (after Enable via CANbus). First 3 seconds motor spins very slow.

Spinning up the motor from ag. 100Hz to 400Hz is pretty resonsive, from 10Hz to 100Hz takes 3-4 seconds.

The motor is/can spin(ning) at low speeds, but in higher speeds it will go in moduleOverCurrent.

In DMC_LEVEL_3 (Only HALL enabled):

Same as above.

When disconnecting the HALL wires from the board the motor will run to the correct speed (although speed_Hz == 0), but ramps very slow.

How? FAST is disabled...

####################

In DMC_LEVEL_4 (FAST & HALL enabled):

Spinning up the motor to 100Hz takes about 4 seconds (after Enable via CANbus). First 3 seconds motor spins very slow.

Spinning up the motor from ag. 100Hz to 400Hz is pretty resonsive, from 10Hz to 100Hz takes 3-4 seconds.

The motor can spin at high speeds without moduleOverCurrent, but low speeds are not so good (wobbely, noisy motor).

Edit:

Sometimes when stopping the motor (via CANbus) and starting again, takes up to 10 secs.

In DMC_LEVEL_4 (Only HALL enabled):

Motor shakes a little bit, then revs up fast (1 sec) and stops due to moduleOverCurrent.

No normal control possible. 

When disconnecting the HALL wires, the motor makes a bit of spound, but no is not revving up (also no moduleOverCurrent).

####################

I started this project clean according to what the manual says (spruj26.pdf). Then I copied all files needed to a directory for a stand alone project. (Or else -> change 1 file you will change all your projects, and there is no going back). That being said: there is no difference in behaviour between the freshly installed MC SDK and the standalone project I distilled from it (so it is usable in SVN and there IS a going back).

---

So, what must I do to get this motor spinning nicely?

The hardware seems okay (motor+HALL wires, triple checked), I think.

Also, how to set all the dipswiches LAUNCHXL-F280025C? The documentation shows only a 'new fresh unset' board, it is not clear how to set all the dipswitches (also another board is hiding the dipswitches).

Given the above, there are issues with the code (did not change code except for the CANbus control).

Please guide me, or give me hints where to look. There are very few comments in code and the documentation is lacking of enough parameter explanation. 

Has anyone used this universal project with a motor+FAST+HALL and is able to succesfully spin the motor, as advertised?

I can provide more information if needed.

BR,

Ruud

  • As described in the lab guide, you can refer to the user's guide of the LAUNCHXL-F280025C to set the other switches/jumpers if you need. Actually, you just need to set the related switches as shown in the lab guide (spruj26.pdf).

    F28002x Series LaunchPadTm Development Kit(https://www.ti.com/lit/pdf/spruiw8)

    The lab just uses either FAST or HALL to run the motor at the same time, you may try to use the FAST first. Please set the correct motor parameters or identify the motor parameters for running the motor in BUILD LEVEL 4. 

    You may try to run the motor and set the speed/acceleration within CCS, not the commination data with CANbus, so it's easy to know the issues are from the control algorithm or the communication delay.

  • As described in the lab guide, you can refer to the user's guide of the LAUNCHXL-F280025C to set the other switches/jumpers if you need. Actually, you just need to set the related switches as shown in the lab guide (spruj26.pdf).

    Yes, the documentation shows only a 'new fresh unset' board, it is not clear how to set all the dipswitches (also another board is hiding the dipswitches).

    The document also states, which worries me: 

    S3, position GPIO24->0, position GPIO32->1 to put F280025C into wait boot mode for reducing the risk of connectivity issues or a previous loaded code execution.

    (picture dip switch doesn't match text)

    But how to set S2?

    The lab just uses either FAST or HALL to run the motor at the same time, you may try to use the FAST first. 

    So, if I understand this correctly: you can build it together (HALL&FAST enabled), but which one is used then, when both enabled? I am/was expecting it uses both, so the motor control firmware can 'knows' its position after a minor rotation.

    Please set the correct motor parameters or identify the motor parameters for running the motor in BUILD LEVEL 4. 

    These are the parameter given by the manufacterer Allied Motion:

    Nominal supply voltage DC bus: 24V

    Rated Output power: 120W

    Rated speed: 3600 RPM

    Rated torque:0.318 NM

    Peak Torque: 1.43 Nm

    Rated current RMS (phase): 4.1 A

    No load speed: 3659 RPM

    Rotor inertia (x10-6): 61

    Pole pairs: 15

    How to fit it in these parameters?

    #define USER_MOTOR1_TYPE MOTOR_TYPE_PM
    #define USER_MOTOR1_NUM_POLE_PAIRS (15)
    #define USER_MOTOR1_Rr_Ohm (NULL)
    #define USER_MOTOR1_Rs_Ohm (0.192211851f)//meas uni lab (0.201803967)
    #define USER_MOTOR1_Ls_d_H (9.02345652e-05f)//meas uni lab (8.16669053e-05)
    #define USER_MOTOR1_Ls_q_H (9.02345652e-05f)//meas uni lab (8.16669053e-05)
    #define USER_MOTOR1_RATED_FLUX_VpHz (0.0223167749f)//(0.0219697803) //PM motor, so always 0: stated somewhere in docs
    #define USER_MOTOR1_MAGNETIZING_CURRENT_A (NULL) //PM motor, so always 0
    #define USER_MOTOR1_RES_EST_CURRENT_A (1.5f)
    #define USER_MOTOR1_IND_EST_CURRENT_A (-1.5f)
    #define USER_MOTOR1_MAX_CURRENT_A (5.0f) //4.1 (4.1*24V =
    #define USER_MOTOR1_FLUX_EXC_FREQ_Hz (90.0f) //motor=3600rpm/60sec = 60Hz*15polepare = 900 -> 10-30%
    #define USER_MOTOR1_NUM_ENC_SLOTS (500) //Encoder HEDL-5540-A11, not used -> HALL used
    #define USER_MOTOR1_INERTIA_Kgm2 (61.0e-06f)


    #define USER_MOTOR1_FREQ_NEARZEROLIMIT_Hz (5.0f) // Hz

    #define USER_MOTOR1_RATED_VOLTAGE_V (24.0f)
    #define USER_MOTOR1_RATED_SPEED_KRPM (3.0f)

    #define USER_MOTOR1_FREQ_MIN_HZ (1.0f) // Hz
    #define USER_MOTOR1_FREQ_MAX_HZ (900.0f) // Hz

    #define USER_MOTOR1_FREQ_LOW_HZ (10.0f) // Hz
    #define USER_MOTOR1_FREQ_HIGH_HZ (100.0f) // Hz
    #define USER_MOTOR1_VOLT_MIN_V (1.0f) // Volt
    #define USER_MOTOR1_VOLT_MAX_V (24.0f) // Volt

    #define USER_MOTOR1_FORCE_DELTA_A (0.05f) // A
    #define USER_MOTOR1_ALIGN_DELTA_A (0.01f) // A
    #define USER_MOTOR1_FLUX_CURRENT_A (0.5f) // A
    #define USER_MOTOR1_ALIGN_CURRENT_A (1.5f) // A
    #define USER_MOTOR1_STARTUP_CURRENT_A (3.5f) // A
    #define USER_MOTOR1_TORQUE_CURRENT_A (2.0f) // A
    #define USER_MOTOR1_OVER_CURRENT_A (7.5f) // A

    #define USER_MOTOR1_BRAKE_CURRENT_A (1.0f) // A
    #define USER_MOTOR1_BRAKE_TIME_DELAY (12000U) // 60s/5ms

    #define USER_MOTOR1_SPEED_START_Hz (30.0f)
    #define USER_MOTOR1_SPEED_FORCE_Hz (25.0f)
    #define USER_MOTOR1_ACCEL_START_Hzps (10.0f)
    #define USER_MOTOR1_ACCEL_MAX_Hzps (20.0f)

    #define USER_MOTOR1_SPEED_FS_Hz (3.0f)

    // only for encoder
    #define USER_MOTOR1_ENC_POS_MAX (USER_MOTOR1_NUM_ENC_SLOTS * 4 - 1)
    #define USER_MOTOR1_ENC_POS_OFFSET (668)

    // Only for eSMO
    #define USER_MOTOR1_KSLIDE_MAX (0.75f) //
    #define USER_MOTOR1_KSLIDE_MIN (0.15f)

    #define USER_MOTOR1_PLL_KP_MAX (6.75f) //
    #define USER_MOTOR1_PLL_KP_MIN (0.75f)
    #define USER_MOTOR1_PLL_KP_SF (5.0f)

    #define USER_MOTOR1_BEMF_THRESHOLD (0.5f)
    #define USER_MOTOR1_BEMF_KSLF_FC_Hz (1.0f)
    #define USER_MOTOR1_THETA_OFFSET_SF (1.0f)
    #define USER_MOTOR1_SPEED_LPF_FC_Hz (200.0f)

    // for IS-BLDC
    #define USER_MOTOR1_RAMP_START_Hz (3.0f)
    #define USER_MOTOR1_RAMP_END_Hz (30.0f)
    #define USER_MOTOR1_RAMP_DELAY (5)

    #define USER_MOTOR1_ISBLDC_INT_MAX (0.015f)
    #define USER_MOTOR1_ISBLDC_INT_MIN (0.010f)

    // for Rs online calibration
    #define USER_MOTOR1_RSONLINE_WAIT_TIME (60000U) // 5min/300s at 5ms base
    #define USER_MOTOR1_RSONLINE_WORK_TIME (24000U) //2min/120s at 5ms base

    ------------

    I did the identifying part multiple times. And should be correct.

    You may try to run the motor and set the speed/acceleration within CCS, not the commination data with CANbus, so it's easy to know the issues are from the control algorithm or the communication delay.

    I modified the (CANbus) code, so I can send 1 message to give a speed (and acceleration). There are no eg. communication delays.

  • But how to set S2?

    It doesn't matter if you run the lab within CCS debug, it's better to set to (0/GOIO24, 1/GPIO32) as described in the user's guide you mentioned above. You need to set the S2 to (1/GPIO24, 1/GPIO32) as Boot from Flash if you want to run the lab standalone without the debug emulator.

    How to fit it in these parameters?

    You only need to set the motor parameters, and a few parameters for FAST. A lot of parameters you listed above as the comments or name are for the eSMO and ISBLDC algorithms. So you just need to set the parameters according to the spec. of the motor, and the motor parameters (Rs, LS and Flux) can be identified if the datasheet doesn't have.

    #define USER_MOTOR1_TYPE MOTOR_TYPE_PM
    #define USER_MOTOR1_NUM_POLE_PAIRS (15)
    #define USER_MOTOR1_Rs_Ohm (0.192211851f)//meas uni lab (0.201803967)
    #define USER_MOTOR1_Ls_d_H (9.02345652e-05f)//meas uni lab (8.16669053e-05)
    #define USER_MOTOR1_Ls_q_H (9.02345652e-05f)//meas uni lab (8.16669053e-05)
    #define USER_MOTOR1_RATED_FLUX_VpHz (0.0223167749f)//(0.0219697803) //PM motor, so always 0: stated somewhere in docs
    #define USER_MOTOR1_RES_EST_CURRENT_A (1.5f)
    #define USER_MOTOR1_IND_EST_CURRENT_A (-1.5f)
    #define USER_MOTOR1_MAX_CURRENT_A (5.0f) //4.1 (4.1*24V =
    #define USER_MOTOR1_FLUX_EXC_FREQ_Hz (90.0f) //motor=3600rpm/60sec = 60Hz*15polepare = 900 -> 10-30%
    #define USER_MOTOR1_INERTIA_Kgm2 (61.0e-06f)

    #define USER_MOTOR1_RATED_VOLTAGE_V (24.0f)
    #define USER_MOTOR1_RATED_SPEED_KRPM (3.0f)

    #define USER_MOTOR1_FREQ_MIN_HZ (1.0f) // Hz
    #define USER_MOTOR1_FREQ_MAX_HZ (900.0f) // Hz

    Please capture some current waveforms and post them to help us to understand the issues. Thanks!

  • Ok, will do. Please do not close topic yet.

  • Sorry, we have to close this thread first if you don't have any further questions in a few days.