Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Embed:
(wiki syntax)
Show/hide line numbers
CurrentModel.cpp
00001 #include "CurrentModel.h" 00002 00003 CurrentModel::CurrentModel(float Lr, float Rr, float fsw) { 00004 _tauinv = Rr / Lr; 00005 _tsw = 1.0f / fsw; 00006 00007 _im = 0.0f; 00008 _theta = 0.0f; 00009 } 00010 00011 float CurrentModel::getFluxPosition(float id, float iq, float w) { 00012 _im = _im + _tsw * _tauinv * (id - _im); 00013 float wf = w + _tauinv * iq / _im; 00014 _theta = _theta + _tsw * wf; 00015 return _theta; 00016 }
Generated on Tue Jul 12 2022 17:58:39 by 1.7.2