Hi,
the question is now more FreeMASTERr oriented. Because of this I would like to suggest you to continue at Freemaster specialized forum where specialist for FreeMASTER are able to provide answer.
https://community.nxp.com/t5/FreeMASTER/bd-p/freemaster
Best regards,
Ladislav
Hi SW_Park,
Could you please specify in which example the issue occurred?
Here are 3 items you can verify:
1) Freemaster variable limit.
open freemaster variable and check limit in tab modifying.
(You can find more about variables in Freemaster documentation section 4.2 Variables)
2) is proper elf flashed in MCU:
in order to be able to translate value to raw format fmScale.speed_n_m must exist in project.
3) if you want to apply a change in MCAT tab "Parameters" the project needs to be compiled and flashed.
ïn Mcat click "store data"' button
generate output file
compile and flash project from CW.
Generated constants (PMSM_appconfig.h)
are initialized in stateReset and stateInit
Freemaster scale constants are initialized in stateReset
Best regards,
Tomas Fedor
System Application Engineer
Thank you for answer. Once the problem has been resolved.
In addition, please inquire about variable setting.
1) I do not understand the reason for setting " x2: 1000 " even if I look at the manual.
2) y2: fmScale.speed_n_m = Nmax X 1000
-> Why? Multiply by 1000?
Hi SW_Park,
When you define Freemaster variable, Freemaster can do a service of "further post-processing numeric
transformation". In other words some formula can be applied before a variable is written to a microprocessor and it is also applied in the reverse direction when the variable is read from microcontroller.
In case of the ManiV mc example Freemaster variable Speed Required is linked with microprocessor variable drvFOC.pospeControl.wRotElReq. This variable is in fraction format Q0.15 <-1,1). From the GUI perspective it is better to see Speed Required in physical dimension RPM. This is where we can use "Real Type transformation" feature of Freemaster.
Linear transformation is the type useful for this usecase and we can pick out of 2 forms:
"Linear ax + b" or "Lin: two points" because in coordinate geometry of a straight line the line can be defined:
1) by gradient and offset "Linear ax + b"
2) by 2 points
in case of Speed Required:
point 1 X=0, Y=0
point 2 X=1000, Y=fmScale.speed_n_m
Best regards,
Tomas Fedor
System Application Engineer
Hi...
Nmax = 8000 [rpm] -> Application scale
Speed Required = 4000 [rpm] -> Freemaster variable
Then,
microprocessor variable
drvFOC.pospeControl.wRotElReq = FRAC16(0.4999847412);
Is that right?
If yes, does "Lin: two points" mean coordinates to convert to a float variable?
So, is the multiplication by 1000 for the compensation of decimal arithmetic?
then
point 1 X=0, Y=0
I think " point 2 X=0, Y=fmScale.speed_n_m = 8000 " can also be used.
Hi SW_Park,
Here is process of Freemaster variable Speed Required from MagniV MC example:
Linear transformation:
X1= 0 , Y1 = 0
X2= 1000, Y2 =fmScale.speed_n_m = FM_SPEED_RPM_MEC_SCALE = 4500 000
means y = x*4500 where y is what we see in the GUI (Speed Required) and X is output from the transformation.
In other words it is transformation between range <-1,1) and <-4500,4500)
Variable settings:
Variable is set as signed fraction format Q0.15 so it takes output from the transformation "range <-1,1)" and recalculates it to correct binary form of Q0.15.
Note: if output from transformation is out of range Q0.15 (for example 1.5) you get an error.
Best regards,
Tomas Fedor
System Application Engineer