Skip to content. | Skip to navigation

Personal tools

SAVTrans.cpp

SAVTrans.cpp

SAVTrans.cpp

//
// C++ Implementation: StepsArcVoltTransform
//
// Description: 
//
//
// Author: Pablo Castro <pcastro@localhost.localdomain>, (C) 2009
//
// Copyright: See COPYING file that comes with this distribution
//
//


void StepsArcVoltTransform::Initialize(){

}

void StepsArcVoltTransform::ClearVariables(){

TransformSteps[0]=0;
TransformSteps[1]=0;
TransformSteps[2]=0;
TransformLvdts[0]=0;
TransformLvdts[1]=0;
TransformLvdts[2]=0;
TransformTTPS[0]=0;
TransformTTPS[1]=0;
TransformTTPS[2]=0;

}


void StepsArcVoltTransform::PrintCoordValues(){


  printf(" \n  STEPS: \n"); 
  printf("     %4.4f %4.4f %4.4f \n",TransformSteps[0], TransformSteps[1], TransformSteps[2]); 
  printf(" \n  LVDTS: \n");
  printf("     %4.4f %4.4f %4.4f \n",TransformLvdts[0], TransformLvdts[1], TransformLvdts[2]);
  printf(" \n  TTPS: \n");
  printf("     %4.4f %4.4f %4.4f \n",TransformTTPS[0], TransformTTPS[1], TransformTTPS[2]);

}


void StepsArcVoltTransform::Steps2VoltTTPS(){

/*
%% 1.- Usando Steps de entrada
printf("1.- Usando Steps de entrada: \n")
InputSteps
for i = 1:3
  ttp(i)  = 0;
  lvdt(i) = 0;
  for j = 1:3
    % Steps a TipTiltPiston
    ttp(i)  = ttp(i)  + XInv(i,j)*InputSteps(j);
    % Steps a Voltaje LVDT
    lvdt(i) = lvdt(i) + V(i,j)*InputSteps(j);
  endfor
endfor
%Respuesta:
ttp
lvdt

 double TransformSteps[3];
    double TransformLvdts[3];
    double TransformTTPS[3];

*/

  for (int i=0; i<3; i++){
    TransformTTPS[i]=0;
    TransformLvdts[i]=0;
    for (int j=0; j<3; j++){
      TransformTTPS[i]  = TransformTTPS[i] + XSupportConfInv[i][j]*TransformSteps[j];
      TransformLvdts[i] = TransformLvdts[i] + LVDTTransferFunction[i][j]*TransformSteps[j];
    }
  }

  //PrintCoordValues(); 
}

void StepsArcVoltTransform::Volt2StepsTTPS(){

/*
%% 2.- Usando Voltajes de entrada
printf("2.- Usando Voltajes de entrada: \n")
InputVolts

for i=1:3
  stps(i)=0;
  for j=1:3
    stps(i)=  stps(i) + VInv(i,j)*InputVolts(j);
  endfor
endfor

for i=1:3
  ttp(i)=0;
  for j=1:3
    ttp(i)=   ttp(i) + XInv(i,j)*stps(j);
  endfor
endfor
*/

  for (int i=0; i<3; i++){
    TransformSteps[i]=0;
    for (int j=0; j<3; j++){
      TransformSteps[i]  = TransformSteps[i] + LVDTTransferFunctionInv[i][j]*TransformLvdts[j];
    }
  }


  for (int i=0; i<3; i++){
    TransformTTPS[i]=0;
    for (int j=0; j<3; j++){
      TransformTTPS[i]  = TransformTTPS[i] + XSupportConfInv[i][j]*TransformSteps[j];
    }
  }

  //PrintCoordValues();


}

void StepsArcVoltTransform::TTPS2VoltSteps(){

/*
%% 3.- Usando Tip/Tilt/Piston de entrada
printf("3.- Usando Tip/Tilt/Piston de entrada: \n")
InputTTP

for i=1:3
  stps(i)=0;
  for j=1:3
    stps(i)=  stps(i) + X(i,j)*InputTTP(j);
  endfor
endfor

for i=1:3
  lvdt(i)=0;
  for j=1:3
    lvdt(i)= lvdt(i) + V(i,j)*stps(j);
  endfor
endfor
*/

  for (int i=0; i<3; i++){
    TransformSteps[i]=0;
    for (int j=0; j<3; j++){
      TransformSteps[i]  = TransformSteps[i] + XSupportConf[i][j]*TransformTTPS[j];
    }
  }


  for (int i=0; i<3; i++){
    TransformLvdts[i]=0;
    for (int j=0; j<3; j++){
      TransformLvdts[i]  = TransformLvdts[i] + LVDTTransferFunction[i][j]*TransformSteps[j];
    }
  }

  //PrintCoordValues();

}

Generated by GNU Enscript 1.6.5.2.
Document Actions