Hello,
Now,I recevied the data which is changed from 0 to 2pi.
But I want the value from -pi to pi.
So I set the program " if data > pi, data = data-2*pi"
When the data <pi , the data is correct in the freemaster.
But if the data >pi , the data is big negative numbers.
Can you tell me why? how to change the data to [-pi pi]?
Any help will be appreciated.
best regards
hao
Hello @haoxue1027 ,
Have you tried to check the data type? Maybe the FreeMaster tries to display as integer and you stores in the MCU like float.
Hope this helps,
Marius
@mariuslucianand hello,
I have found the reason.
Beacuse in the sincon block , the input theta is set to [-pi,pi].
But in my simulink, the input is 0 to 2pi.
Therefore, when the data is greater than pi, an abnormal data is displayed.
best regards
hao