Hi,
I am testing HVPM_Sensored project on F28035 + PMSM hardware platform in real-time debug mode and observe qep1.ElecThet waveform through CCS , the graph is as shown in image1.png. The stable saw-tooth wave shape indicates the motor is running smoothly.
However when I try to display (_IQ(1.0) - qep1.ElecThet ) through the graph tool by the code:
DlogCh3 = (int16)_IQtoIQ15(_IQ(1.0) - qep1.ElecTheta);
I got a strange result as the wave shown in image2.png, that is sometimes I got a negative value( -1) from above calculation. This is quite hard to understand as qep1.ElecThet falls in 0-1 and (_IQ(1.0) - qep1.ElecThet ) should also be in the range of 0-1.
What is wrong with it or is there anything missed here? The version of ccs I am using is 4.2.2.

