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.

How to implement the braking fuction of motor control on F28027?

Hi All,

The following code was used to implement the motor control braking function on F2812. Does anyone know whether or not it can be done on F28027?

Thank you very much.

Luke Zhou

//
//      OSU PEEM RELEASE
//      Intended for evaluation purposes
//
//###########################################################################
//
// FILE: shutdown.c
//
// TITLE: DSP28 Emergency Shutdown Functions.
//
//###########################################################################
//
//  Ver | dd mmm yyyy | Who  | Description of changes
// =====|=============|======|===============================================
//  1.00| 06 Jan 2005 | S.C. | EzDSP Alpha Release
//###########################################################################

#include "DSP28_Device.h"

//---------------------------------------------------------------------------
// shutdown: Disable all PWM functions and all output pins
//---------------------------------------------------------------------------

void shutdown(int mode, int *enable_flg)
{

//    EALLOW;   // This is needed to write to EALLOW protected registers
//    EDIS;   // This is needed to disable write to EALLOW protected registers

 
// User specific functions, Reassign vectors (optional), Enable Interrupts:
 
// Initialize EVA Timer 1:
    // Setup Timer 1 Registers (EV A)

    if (mode == 0)
    {
     EvaRegs.COMCONA.all = 0;
  *enable_flg = 0;
    }
    else if (mode ==1)
    {
     EvaRegs.ACTRA.all=0x0ccc;  // Enforced to braking mode    
    }

  • Hi,

    Yes, you can do something like that on the 28027. I'm pretty sure the registers won't be the same though (you'll likely want to use AQCTL registers), so you should refer to the appropriate ePWM documentation for more information.

    Regards.