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.

TMS320F28069F: [TMS320F28069F] CTRL_runTraj() is not opened as source code ?

Part Number: TMS320F28069F

Dear TI members,

I am wondering update logic of intValue of trajHandle_Id, but I cannot find by searching source.

I guess it is included at  CTRL_runTraj(), and update intValue of trajHandle_Id in it

If so, would you please let me know how to update intValue manually

Best Regards,

Hae Ryong

  • You are right, the function is called in CTRL_runTraj() to update the Id intValue. You may call TRAJ_setIntValue(obj->trajHandle_Id, Id_int_Ref) to set the intValue manually, where obj is the ctrl object handle in project.
  • Thanks for your answer.

    I think I need to know how to calculate Id intValue not to conflict manual setting and set by CTRL_runTraj().
    would you please let me know how to calculate Id intValue in CTRL_runTraj() ?

    Best Regards,
    Hae Ryong
  • The code for Id control is similar to a ramp control as TRAJ_run() which can be found in traj.h. ou can use TRAJ_setIntValue to change the intValue without any conflict, CTRL_runTraj() has some states control besides TRAJ_run().
  • I have tried to set intValue as follows to limit refValue.

             // when appropriate, run the PID Id and Iq controllers
             if(CTRL_doCurrentCtrl(ctrlHandle))
               {
                 _iq refValue;
                 _iq fbackValue;
                 _iq outMin,outMax;
    
                 // read max voltage vector to set proper limits to current controllers
                 _iq maxVsMag = CTRL_getMaxVsMag_pu(ctrlHandle);
    
                 // reset the current count
                 CTRL_resetCounter_current(ctrlHandle);
    
                 // ***********************************
                 // configure and run the Id controller
                 // compute the reference value
                 refValue = TRAJ_getIntValue(controller_obj->trajHandle_Id) + CTRL_getId_ref_pu(ctrlHandle);
                 if(refValue > _IQ(1.4))
                 {
                	 refValue = _IQ(1.4);
                	 TRAJ_setIntValue(controller_obj->trajHandle_Id, _IQ(1.4))
                 }
    
                 // update the Id reference value
                 EST_updateId_ref_pu(controller_obj->estHandle,&refValue);
    
                 // get the feedback value
                 fbackValue = CTRL_getId_in_pu(ctrlHandle);

    However refValue is returned to its original value 1.88, not 1.4

    I don't think it is good idea of using TRAJ_setIntValue() to modify refValue to small one.

    Do you have any idea to reduce refValue from 1.88 to 1.4 or lower value ?