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-F280049C: Launchpad for FOC application

Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: TMS320F28377S, C2000WARE, TMDXIDDK379D

Hi Team,

Our customer is looking for a LaunchPad to realize field oriented control for a hybrid stepper motor. According to our customer, the control cycle must be very quick, less than 50 microseconds. The motor driver is powerSTEP01 which is suitable for stepper motor control. 

He needs a Launchpad to realize the following function:

1. Read the motor position, through the eQEP module.

2. Convert the motor position to electrical position

3. Create some pulse to control the motor.

It seems that the LAUNCHXL-F280049C is suitable for his application. Can you please confirm? 

Regards,

Danilo

  • Hi Team,

    We received another email from our customer.

    Use TMS320F28377S LaunchPad as Controller, in connection with the driver board EVPOWERStep01, to control a 2 phase hybrid stepper motor. The driver board EVPOWERStep01 works in Step-Clock mode, which means the motor is moved one microstep at each step-clock rising edge. In essence, the stepper motor would then become a PMSM motor with the number of pole-pairs related to the step angle of the motor.

    Goal: Use Field oriented control (FOC) to maintain the load angle pi/2, so that the stepper motor output a constant torque. Torque will be proportional to the current amplitude.

    Therefore the TMS320F28377S should achieve the following task:

    1. Measure the rotor angle, use eQEP module, the absolute rotor position will be read from the Register: EQep1Regs.QPOSCNT
    2. Convert the rotor angle into electrical coordinate, marked as RP
    3. Read the actual current position through SPI commands from EVPOWERStep01, marked as CP
    4. Load angle should be always pi/2, which is expressed as microsteps, marked as LA.
    5. Calculate the incremented or decremented current position ST=LA+RP-CP
    6. Generate corresponding electrical pulse refer to ST, use ePWM module.

     

    The Problems

    1. The FOC cycle should be less than 50 microseconds. Is the TMS320F28377S LaunchPad suitable for this mission?
    2. The ePWM module is time based, it have be configured to generate continuous pwm signals with 50% duty cycle according to Frequency. How can the ePWM module generate a certain amount pwm Pulse, which drive the stepper motor rotate certain micro steps?  Now I use a system function DELAY_US(A), when the CPU run this code, the epwm clock also runs, find the relationship the delay time A and the Number of PWMs (A=amount*500000/f_pwm) , then a certain pwm pulse can be generated.  Is there other way?

    Regards,

    Danilo

  • The FOC cycle should be less than 50 microseconds. Is the TMS320F28377S LaunchPad suitable for this mission?

    That depends on how many codes of the FOC subroutine. The TMS320F28377S  is 200MHz CPU, it should be more enough for the stepper with FOC. 

    Is there other way?

    They may use the EPWM ISR as a timer to count the delay and do the commutation. They can find the example on how to configure the EPWM and its ISR in C2000Ware.

  • Hi Yanming,

    Please see the response of our customer below.

    Thank your for the Support.
    And I have some new questions.
     
    for ePWM ISR, Two questions:
     
    As your reply, I can use epwm ISR as a timer to count the delay.
     
    Which code is regarded as the entry of interrupt? In my programm, some code should be first executed, then generate some epwm signals, then repeat the control loop. In the C2000 example code, there is only a "IDLE loop" in "main function". The "IDLE loop" can be removed, the acutal exectued function is in the interrupt function. 
     
    Is there a way or a code, that can control, when the pwm signals output and when they not output?
    I make some tests, I find, epwm signals will be generated so long as the CPU clock runs, so that they may be in confilict with other codes.  
     
     for "eqep_pos_speed.c". please check the project "eqep_pos_speed_cpu01" in F2837xS"
     
    I can not understand the following codes:
    According the DESCRIPTION, theta_mech = QPOSCNT/mech_Scaler, that I am awear. 
    In code, the mech_Scaler is definited as 0.9999/4000, so the division is changed to multiplication, right?
     
    due to the data type of pos16val is unsigned int(Uint16), so is the theta_raw always a positiv Interger?
    and the calculation of the tmp
    what dose this line of code do? tmp &= 0x03FFF000; if tmp<4096, the result is always 0
    also I can understand the two lines. 
        p->theta_mech = (int)(tmp>>11);            
        p->theta_mech &= 0x7FFF;
    Regards,
    Danilo
  • You may download and install MotorControl software development kit (SDK) for C2000Tm MCUs as the link below.

    C2000WARE-MOTORCONTROL-SDK: http://www.ti.com/tool/C2000WARE-MOTORCONTROL-SDK

    And you can find the example project with ControlCard-F28004x/002x + IDDK for high voltage three-phase PMSM drive. The customer may refer to this example to design their own algorithm for stepper motor.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_<version>\solutions\tmdxiddk379d\f28004x

    C:\ti\c2000\C2000Ware_MotorControl_SDK_<version>\solutions\tmdxiddk379d\docs

    what dose this line of code do? tmp &= 0x03FFF000; if tmp<4096, the result is always 0

    The code is using IQ format and PU method to convert the data of the QEP to the position.  You might have a look at the link below to understand the _IQmath and _IQ format.

    C28x IQmath Library (https://www.ti.com/lit/sw/sprc990/sprc990.pdf)

    If you haven't had a chance to look at the workshop material, I think this will help demystify some of the terminology and architecture as well.

    https://training.ti.com/c2000-motorcontrol-training-series

    https://training.ti.com/introduction-motors-motor-control-part-1-introduction