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 can I use EST API?

Other Parts Discussed in Thread: MOTORWARE, CONTROLSUITE

Hi all:

I want add DATA_DLOG to watch some EST values. I saw Chris had posted document follow:

  • in the GUI project we do this:

//init

int16_t DlogCh1 = 0;
DLOG_4CH dlog = DLOG_4CH_DEFAULTS;
int16_t *dlogptr1;
int16_t DLOG_4CH_buff1[ANGLE_BUFFER_SIZE];
int16_t gGraphPrescaler = 1;

   dlog.iptr1 = &DlogCh1;
   dlog.trig_value = 0x5;
   dlog.size = ANGLE_BUFFER_SIZE;
   dlog.prescalar = gGraphPrescaler;
   dlog.init(&dlog);

 

//background

               if(Gui.gDirection>0)
                 {
                   dlog.trig_value = 0x5;
                 }
               else
                 {
                   dlog.trig_value = -0x5;
                 }

               if(gGraphPrescaler<1)
                 {
                   gGraphPrescaler = 1;
                 }

               dlog.prescalar = gGraphPrescaler;

//inside main ISR

  Gui.gRotorFluxAngle = EST_getAngle_pu(obj->estHandle);
  DlogCh1 = (int16_t)_IQtoIQ15(Gui.gRotorFluxAngle);
  dlog.update(&dlog);

 

I move these coder into lab5e,but there is a wrong appear,like this:

I have add this sentence:

there is a error on" EST_Obj *obj = (Est_Obj *)  estHandle."

I don't know why , please help .

Best regard!

thanks !

  • I have done!

    I use this:

    CTRL_Obj *obj = (CTRL_Obj *)ctrlHandle;

     

    but something about struct DLOG_4CH's components I dont understand, such as "trig_value","prescalar","skip_cntr","cntr""write_ptr"etc.

    I search "dlog4chc.asm", but that is useing assemble language,.difficult to me .... how can i set these parameter.?

  • yanzhen fu,

    using the datalog feature is a bit tricky, and unfortunately we haven't brought the modules fully into MotorWare with a nice example.  It's on our to-do list.

    There is a structure that we set-up in the dlog4ch.h, but no proper dlog4ch.c yet with APIs

    typedef struct _DLOG_4CH_
    {
    int32_t task; //!< Variable: Task address pointer
    int16_t *iptr1; //!< Input: First input pointer
    int16_t *iptr2; //!< Input: Second input pointer
    int16_t *iptr3; //!< Input: Third input pointer
    int16_t *iptr4; //!< Input: Fourth input pointer
    int16_t trig_value; //!< Input: Trigger point
    int16_t prescalar; //!< Parameter: Data log prescale
    int16_t skip_cntr; //!< Variable: Data log skip counter
    int16_t cntr; //!< Variable: Data log counter
    int32_t write_ptr; //!< Variable: Graph address pointer
    int16_t size; //!< Parameter: Maximum data buffer
    int16_t (*init)(); //!< Pointer to init function
    int16_t (*update)(); //!< Pointer to update function
    } DLOG_4CH;

    There are several examples in the controlSUITE style of software in multiple projects such as

    C:\ti\controlSUITE\development_kits\DRV8312-C2-KIT_v128

    and

    C:\ti\controlSUITE\development_kits\DRV830x-HC-C2-KIT_v104

    Probably the better alternative is to look at the instaspin_motion proj_lab05f.c 

    and do a search for "graph".  this lab uses a similar approach for setting up a structure and updating the elements for graphing.