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.

  • Resolved

CCS/CCSTUDIO-C2000: How to give filtered signal to PID controller as reference ?

Prodigy 50 points

Replies: 9

Views: 205

Part Number: CCSTUDIO-C2000

Tool/software: Code Composer Studio

I need to give filtered signal to my pid1 controller as my reference rk. AdcBufFiltered is my filtered signal.i'm using CCSv6.LPF.c

  • Hello Ananda,

    You should take a look at the DCL - Digital Control Library - www.ti.com/.../C2000-DIGITAL-CONTROL-LIBRARY .

    HTH,
    John W.
  • In reply to John Westmoreland43:

    My filtered signal is in the array format of length 50.And i want that signal convert into float rk ,which is my reference to pid. I can't write rk=AdcBufFiltered[index]. then rk is choose any value from the array.how to resolve that problem.
  • In reply to Ananda Hange:

    It looks like the filtered signal is in IQ format, so you can use the IQ to float conversion from that library:

    rk=_IQtoF(AdcBufFiltered[index]);

    You should also typecast the ADC results to float. Your first assignment, the current sensor reading, would look like this:

    I_sensor_FC =(float) SampleTable[i] * 7.326007326e-4 - IDC_offset;

    On last thing; where you are assigning float constants it's better to place an 'f' at the end to make it unambiguous to the compiler. For example:

    float IDC_offset=0.0f, ...

    Regards,

    Richard
  • In reply to Richard Poley:

    Filter.cLPF2.cLPF2.cIQmathLib.hwhen i use this line rk = _IQtoF(AdcBufFilter[index]); i got errors as follows,

    Description Resource Path Location Type

    unresolved symbol __IQ24toF, first referenced in ./LPF1.obj EV1 C/C++ Problem

    Description Resource Path Location Type

    <a href="file:/c:/ti/ccsv7/tools/compiler/dmed/HTML/10234.html">#10234-D</a>  unresolved symbols remain EV1 C/C++ Problem

    Description Resource Path Location Type

    #10010 errors encountered during linking; "EV1.out" not built EV1 C/C++ Problem

    I attached file LPF2.c which is main file and filter.c and IQmathlib.h file .

  • In reply to Ananda Hange:

    It sounds like you haven't linked IQmath.lib. Check section 3.5 of the IQ math Quick Start guide.

    Which device are you using?

    Regards,

    Richard
  • In reply to Richard Poley:

    Yeah I hadn't link that IQmath.lib .Even if i link that I got some new error as follows,

    Description Resource Path Location Type
    <a href="file:/c:/ti/ccsv7/tools/compiler/dmed/HTML/16008.html">#16008-D</a> file "../IQmath.lib<IQ24toF.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C28FPU32" specified in a previous file or on the command line EV1 C/C++ Problem.

    I'm using Delfino f28335 of c2000 famiy.

  • In reply to Ananda Hange:

    I think this is because you've built for the FPU32 but are linking the fixed point version of IQmath.  Try linking "IQmath_fpu32.lib" instead of "IQmath.lib".  Both are in the \lib sub-directory in C2000Ware.

    Regards,

    Richard

  • In reply to Richard Poley:

    Hello Ananda,

    Just wondering - were you able to resolve your issue?

    Did Richard's last reply do the trick for you?

    Thanks,
    John W.
  • In reply to John Westmoreland43:

    yeah problem is resolve.

    Thanks.

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.