Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: CurrentMeasurement
Fork of CurrentRegulation by
CurrentRegulation.h
00001 #ifndef CURRENTREGULATION_H 00002 #define CURRENTREGULATION_H 00003 00004 #include "mbed.h" 00005 #include "BLDCmotorDriver.h" 00006 #include "PI.h" 00007 00008 class CurrentRegulation{ 00009 public: 00010 CurrentRegulation(PinName I_A, PinName I_B, PinName I_C, PinName I_TOTAL, PinName GH_A, PinName GL_A, PinName GH_B, PinName GL_B, 00011 PinName GH_C, PinName GL_C, PinName h1, PinName h2, PinName h3, PinName Fault); 00012 void setValues(double R_sh, double R_1, double R_fs, double R_ft, double V_ref); 00013 double calculateCurrentA(); 00014 double calculateCurrentB(); 00015 double calculateCurrentC(); 00016 double calculateTotalCurrent(); 00017 double calculateKr(); 00018 double phaseCurrent(int currentSector); 00019 void measuring(); 00020 void getValue(); 00021 //void input(double in); 00022 void setOutput(double in); 00023 private: 00024 AnalogIn I_A, I_B, I_C, I_TOTAL; 00025 double R_sh, R_1, R_fs, R_ft, V_ref, I_A_, I_B_, I_C_, I_TOTAL_, zeta, T_suma, T_ch, T_pv, T_I, K_ch, K_R, K_pv, K_a, K_oR, T_d, 00026 setPoint, procesValue, I_Ar, u, output; 00027 int sector; 00028 Ticker measure; 00029 PI reg; 00030 BLDCmotorDriver m; 00031 }; 00032 00033 #endif
Generated on Wed Jul 13 2022 13:19:34 by
1.7.2
