Show
Ignore:
Timestamp:
10/12/09 19:38:57 (15 years ago)
Author:
smidl
Message:

PMSM compiles again

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • applications/pmsm/pmsmDS.h

    r384 r654  
    1111*/ 
    1212 
    13 #include <stat/loggers.h> 
     13#include <base/loggers.h> 
    1414#include <estim/kalman.h> 
    1515#include "simulator_zdenek/simulator.h" 
     
    7171            ind++; 
    7272            // check omega profile and set dW 
    73             if ( ind<profileWw.length() ) 
     73                        if ( ind <2 && profileWw.length() ==1 ) 
     74                        { 
     75                                Ww=profileWw ( 0 ); 
     76                                dW=0.0; 
     77                        } 
     78                        if ( ind<profileWw.length() ) 
    7479            { 
    75                 //linear increase 
    76                 if ( profileWw.length() ==1 ) 
    77                 { 
    78                     Ww=profileWw ( 0 ); 
    79                     dW=0.0; 
    80                 } 
    81                 else 
    82                 { 
    8380                    dW = profileWw ( ind )-profileWw ( ind-1 ); 
    8481                    dW *=125e-6/dt_prof; 
    85                 } 
    8682            } 
    8783            else 
     
    167163    void from_setting( const Setting &root ) 
    168164    { 
    169                 UI::SettingResolver params_exp(root["params"]); 
    170                 const Setting& params=params_exp.result; 
    171  
     165                const SettingResolver& params_l(root["params"]); 
     166                const Setting &params = params_l.result; 
    172167        set_parameters ( params["Rs"], params["Ls"], params["Fmag"], \ 
    173168                         params["Bf"], params["p"], params["kp"], \ 
     
    214209    { 
    215210        static vec umin(2); 
    216         vec u(2); 
    217         //assume we know state exactly: 
     211                vec u(2); 
     212                vec &mu = est->_mu(); 
     213                //assume we know state exactly: 
    218214        vec true_state=vec(x,4); // read from pmsm 
    219         E.set_mu(true_state); 
    220215        mu=true_state; 
    221216 
     
    228223 
    229224        //second derivative 
    230         IMpmsm2o* pf = dynamic_cast<IMpmsm2o*>(pfxu); 
     225        IMpmsm2o* pf = dynamic_cast<IMpmsm2o*>(pfxu.get()); 
    231226        if (pf) 
    232227        { 
     
    254249    void from_setting( const Setting &root ) 
    255250    { 
    256         diffbifn* IM = UI::build<diffbifn>(root, "IM"); 
    257         diffbifn* OM = UI::build<diffbifn>(root, "OM"); 
     251        shared_ptr<diffbifn> IM = UI::build<diffbifn>(root, "IM"); 
     252        shared_ptr<diffbifn> OM = UI::build<diffbifn>(root, "OM"); 
    258253 
    259254        //parameters 
     
    289284 
    290285        //connect 
    291         RV* drv = UI::build<RV>(root, "drv"); 
     286        shared_ptr<RV> drv = UI::build<RV>(root, "drv"); 
    292287        set_drv(*drv); 
    293         RV* rv = UI::build<RV>(root, "rv"); 
     288        shared_ptr<RV> rv = UI::build<RV>(root, "rv"); 
    294289        set_rv(*rv); 
    295290    } 
     
    317312        true_state(4)=x[8]; 
    318313 
    319         E.set_mu(true_state); 
     314        vec &mu = est->_mu(); 
    320315        mu = true_state; 
    321316        //hack for ut 
     
    334329    void from_setting( const Setting &root ) 
    335330    { 
    336         diffbifn* IM = UI::build<diffbifn>(root,"IM"); 
    337         diffbifn* OM = UI::build<diffbifn>(root,"OM"); 
     331        shared_ptr<diffbifn> IM = UI::build<diffbifn>(root,"IM"); 
     332                shared_ptr<diffbifn> OM = UI::build<diffbifn>(root,"OM"); 
    338333 
    339334        //statistics 
     
    367362 
    368363        //connect 
    369         RV* drv = UI::build<RV>(root, "drv"); 
     364                shared_ptr<RV> drv = UI::build<RV>(root, "drv"); 
    370365        set_drv(*drv); 
    371         RV* rv = UI::build<RV>(root, "rv"); 
     366                shared_ptr<RV> rv = UI::build<RV>(root, "rv"); 
    372367        set_rv(*rv); 
    373368    }