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.

TMDSSOLARCEXPKIT: _IQ( ) representation do I need it ?

Part Number: TMDSSOLARCEXPKIT
Other Parts Discussed in Thread: TMS320F28034

Hello to designers of Solar Explorer.  Could you explain me the reall neсessity  of using _IQ representation in a project.

I tried to realise project on TMS320F28034 ( it does not have floation math) , only substituted  2pole2zero on Pid Grando (TI code),

and I used only integers, and did not use floating points ( only if I need out them on some terminal program for operator).

In result we should receive integer numbers of counters of PWM  and  I do not understand correctly,

why we need to use this fractional numbers like _IQ( 0.00001).

I took  coefficients in PID controller  numbers like: kp=400000, ki=350000, took vaues from ADC  and some way it works .

But may be I am hugely wrong and it should not work properly, Could you in pair of pharse explain me my

delusion.

Michael.

  • Michael, 

    Most control applications are designed in per-unit sclaing (PU), this enables easy scaling of power rating etc.. and also keep the variables on a normalized scale.

    IQ format is one way to represent numbers with fractions (note it is purely a way to look at a number), physically the number is stored as a fixed point number on the device, it is only a way to look at a number.

    When doing math operations a special function like IQmpy is used to keep all the shifting correct,

    You don;t necessarily need IQ for control, but it makes it very easy to understand and design control code.

    The solar explorer code for F28035 uses IQ math and you should see the variables in IQ format, you can still see them as fixed numbers but if you would like to understand the design procedure you will need to see them in IQ math as they were designed with IQ format in mind. 

    Regards

    Manish Bhardwaj  

  • Thanks Manish. But if you use always the same represantation , like _IQ(24), I would understand that principle. But in the sample code you often change notation from _IQ(10) to _IQ(30) and that spoils all regularity, and I need to check out is it correct or not. And result of all transformations is in fixed point and that is tricky question how to convert them back to _IQ. So for me as I try to take in mind all chain of transformations it is not convenient. Thank, Michael.
  • Michael,

    Because of the IQmath library you do not need to worry about the IQ point maintenance,

    You are correct we use in some locations IQ9 and IQ10, these were primarily chosen because an older interface for GUI of the design used 16 bit data and we cannot fit IQ 24 easily in the GUI framework,

    Also at some locations IQ24 may not have the dynamic range , for example IQ24 max integer value is +/-128. So if the voltage that you are sensing has a range of 400V you will not be able to fit it into IQ24 and will have to use a lower Q, which will sacrifice resolution slightly,  

    What i can tell you is that using Q points actually simplifies your code and makes it more maintainable, we have used IQ based control code for power supplies to motor control for years. All our application libraries are also Q point based, but we may select a different Q in select places with the dynamic range and resoution trade off in mind. 

    -Manish 

  • Thanks Manish, again, you have drived me to dig some material more and I read very useful datasheet   and  it turned out very tutorial. And as the discussion has not finished , another question, I could not find conversion function in IQMathlib, with converts Float to _IQ,  Backward function presents, but not Float_to_IQ. May be it is called by other way ? Does  this one exist?  I need it to pass parametres from remote terminal in floating point.

    Michael.