i have noticed one thing is that some times mbed controller is misbehaving.
my programs mostly based on the signals , i take some sine or phase shifted sine signals from the the adc channel ,
then i write some equation which generally multiplying some float and int number with signal. it is working very finely not doubt.
but when i tryed to multiplying the two signal to gather then it was not gives proper result.
same things i faced during the division of signal , suppose i have sine and cos signal then takes its ratio then resultant shape of signal is look like signal of tan function, . sometimes i get it properly but some times don't get . in don;t get condition i have verified all the signal many time to reduces the error but every thing is correct then after i didn't get proper signal.
please help me to understand this problems.
thankyou
sin 2(theta)=2sin(theta)*cos(theta)
so it is correct. but we are trying to do that in the controller than result is different from our expected result.so i didn't get reason of this misbehavior of controller
for that i am useing code is shown below
include the mbed library with this snippet
#include"mbed.h" #include"math.h" AnalogIn I(p17); AnalogIn I1(p19); AnalogOut aout(p18); main() { int i; double Ia,Ibeta,Ib,x; static float dif_th,tan_x,tan_b; while(1) { Ia=(I-0.5); Ib=(I1-0.5); //Ic=-Ia-Ib; Ibeta = (0.5774*Ia)+(2*0.5774*Ib); x=I*I; //x=atan2(Ibeta,Ia); tan_x=x; dif_th=(tan_x-tan_b)*2; tan_b=tan_x; aout=10*Ia*Ibeta+0.5; } }