problem in multiplication of the signals

17 Mar 2013

/media/uploads/tejaspanchal/tek0000.gif as shown in above figure we have two signals. both having the 90deg phase shift to each other. if we are multiplying them result signal as shown in fig we

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

/media/uploads/tejaspanchal/tek0001.gif

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;
      
      
      }
     }
17 Mar 2013

In that code you don't output Ia*Ib, but Ia*Ibeta, which is something else than Ib.

18 Mar 2013

Erik - wrote:

In that code you don't output Ia*Ib, but Ia*Ibeta, which is something else than Ib.

ia and ibeta are having the phase shift of 90 to each other.

ib and ibeta are not same it was my mistake ,i have written Ib in place of Ibeta in FIGURE .

PLEASE CONSIDER IBETA IN PLACE of IB FOR FIGURE .

in first figure i have taken ia and ibeta but i have made mistake to write in the figure.

Ia and Ibeta nothing but the Ia is sine signal and Ibeta is cos signal.

20 Mar 2013

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

21 Mar 2013

[deleted].