Library for current regulation of BLDC motor.
CurrentRegulation.h@0:d8dab3dae6f2, 2015-08-20 (annotated)
- Committer:
- dfraj
- Date:
- Thu Aug 20 14:58:23 2015 +0000
- Revision:
- 0:d8dab3dae6f2
Library for current regulation of BLDC motor.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dfraj | 0:d8dab3dae6f2 | 1 | #ifndef CURRENTREGULATION_H |
dfraj | 0:d8dab3dae6f2 | 2 | #define CURRENTREGULATION_H |
dfraj | 0:d8dab3dae6f2 | 3 | |
dfraj | 0:d8dab3dae6f2 | 4 | #include "mbed.h" |
dfraj | 0:d8dab3dae6f2 | 5 | |
dfraj | 0:d8dab3dae6f2 | 6 | class CurrentRegulation{ |
dfraj | 0:d8dab3dae6f2 | 7 | public: |
dfraj | 0:d8dab3dae6f2 | 8 | CurrentRegulation(PinName I_A, PinName I_B, PinName I_C, PinName I_TOTAL); |
dfraj | 0:d8dab3dae6f2 | 9 | CurrentRegulation(PinName I_A, PinName I_B, PinName I_C, PinName I_TOTAL, double R_sh, double R_1, double R_fs, double R_ft, double V_ref); |
dfraj | 0:d8dab3dae6f2 | 10 | void setValues(double R_sh, double R_1, double R_fs, double R_ft, double V_ref); |
dfraj | 0:d8dab3dae6f2 | 11 | void calculateCurrentA(); |
dfraj | 0:d8dab3dae6f2 | 12 | void calculateCurrentB(); |
dfraj | 0:d8dab3dae6f2 | 13 | void calculateCurrentC(); |
dfraj | 0:d8dab3dae6f2 | 14 | void calculateTotalCurrent(); |
dfraj | 0:d8dab3dae6f2 | 15 | double calculateKr(); |
dfraj | 0:d8dab3dae6f2 | 16 | double showResult(); |
dfraj | 0:d8dab3dae6f2 | 17 | private: |
dfraj | 0:d8dab3dae6f2 | 18 | AnalogIn I_A, I_B, I_C, I_TOTAL; |
dfraj | 0:d8dab3dae6f2 | 19 | 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; |
dfraj | 0:d8dab3dae6f2 | 20 | Ticker measure1, measure2; |
dfraj | 0:d8dab3dae6f2 | 21 | }; |
dfraj | 0:d8dab3dae6f2 | 22 | |
dfraj | 0:d8dab3dae6f2 | 23 | #endif |