// settings for pmsm_estim.cpp

experiment={
	Ndat = 120000;
//	Ndat = 50000;
};

system= {
	class= "pmsmDSctrl";
	params = "pmsm107@./cfg/zcu.cfg";
	tstep = 1; // steps for profile in [s]
//	profileW = [0, 10, 0, 2 ];
//	profileW = [0, 500, 1000, 1500, 2000, 2500, 3000 ];	
//	profileW = [0, -10, 30, 60, 90, 60, 30, 0, -30, -60, -30];
	profileW = [1, 10, 50, 200, 200, 30, 0, 0, -30, -30, -100, -100, -40, 0, 0];
//	profileM = [0, 30, 0, 0, 30, 0, 0, 0, 0, 0, 10, 0, 0];
	profileM = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
};

UD = {class="EKFfull";
	 IM = {class="IMpmsmStat";
		params = "pmsm107@./cfg/zcu.cfg";
	 };
	 OM = {class="OMpmsm";};
	dQ=[0.1, 0.1, 0.1, 0.01]; ///???????????????
	dR=[0.05, 0.05];
	 //connect
	 log_level="logmean";
	 name = "Est0";
	 };

OT= {class="EKFfull";
	 IM = {class="IMpmsmOT";
		params = "pmsm107@./cfg/zcu.cfg";
	 };
	 name = "ekf";
	 OM = {class="OMpmsmOT";
		params = "pmsm107@./cfg/zcu.cfg";
	};
	dQ=[0.1, 0.01]; ///////// <====== OK
	dR=[0.5, 0.5];
	dP0=[0.1, 0.1];
	 //connect
	 log_level="logmean,logevidence,logbounds";
	 };

PF= {class = "PF";name="pf";
	  particle = {class ="BootstrapParticle";
		parameter_pdf = {class="mgnorm<ldmat>";
		  g={class="IMpmsmOT";
			params = "pmsm107@./cfg/zcu.cfg";
		  };
		  dR=[0.001,0.0001];
		  rv ={class="RV";names=("om","th");};
		  rvc ={class="RV";names=("om","th","o_ua","o_ub","o_ia","o_ib");times=[-1,-1,0,0,-1,-1];};
		};
		observation_pdf= {class="mgnorm<ldmat>";
		  g={class="OMpmsmOT";
			params = "pmsm107@./cfg/zcu.cfg";
		  }; 
		  dR=[0.5,0.5]; 
		  rv ={class="RV";names=("o_ia","o_ib");};
		  rvc = {class="RV";names=("om","th","o_ua","o_ub","o_ia","o_ib");times=[0,0,0,0,-1,-1];};
		};
	  };
	  n = 100;
	  log_level="logbounds,logmean";
	  prior = {class="euni";
		high = [ 0.1, 1.0];
		low = [ -0.1, -1.0];
		rv ={class="RV";names=("om","th");};
	  };
};

	 
	 
controllers=({
//		class = "PMSM_PICtrl";
//		class = "PMSM_LQCtrl_dq";
		class = "PMSM_LQCtrl_dq2";
		estim = "UD";
//		estim = "PF";
		r = 0.0001;
//		r = 0.001;
//		r = 0.04;
		h = 10;
		MAXu = 400;
		MAXuflag = 2;
		rpd = 0.0001;
	}
);
	
logger= {
	class="dirfilelog";
	maxlen = 100;
//	dirname = "exp/ctrlPI";
//	dirname = "exp/ctrlLQdq";
	dirname = "exp/ctrlLQdq2";
};
