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.

TMDSHVMTRINSPIN: Scalar control

Part Number: TMDSHVMTRINSPIN
Other Parts Discussed in Thread: CONTROLSUITE, TMDSCNCD28069ISO, MOTORWARE, C2000WARE, MATHLIB

I try to convert Scalar control example from ControlSuite to work with TMDSCNCD28069ISO. In general the process is going on. I decided to go from macros to functions for better debuging.

But I've encountered an error at VHZ_PROF_MACRO(v):

/* Compute slope of V/f profile */ \
v.VfSlope = _IQdiv((v.VoltMax - v.VoltMin),(v.HighFreq - v.LowFreq)); \

_IQdiv always returns 34.63...

_IQmpy works fine, _IQsin too.

Resolved this with calculating intermediate result (with simple float division) and converting the value to _IQ. Tried using mathLib.lib from ControlSuite, Motorware and C2000Ware.

Why does this happen?

Pic as an example.

  • _IQdiv(0 was tested extensively for functional integrity and has been in use for a long time now. In the example shown here, _IQdiv() is associated with numerator and denominator values that are supposed to be constant for a given test set up and therefore the result value is supposed to be same. Is it not? Did you try using it with different set of values?

  • As you can see result4 must be _IQ(2.0) divided by _IQ(1.5), yes I tried other values as well, because this behavior seems strange for me, and I decided to test a banch of values. But still can't figue out why it works this way... Tomorrow I'll continue with a clean project.
  • I've found the answer. I used 28069_RAM.cmd but IQTABLES address in 28069 is different from 28069M. Now it works as expected. Seems like _IQsin result was incorrect too, but it was not larger than -1;1 so I wasn't paying attention. By the way at page 196 Reference manual there's no info to calculate IQTABLES3 length. Bec. theres's no start adress for IQ Math Functions.