First version of program for measuring current of three phase BLDC motor.
Dependencies: AutomationElements CurrentRegulation_ mbed
CurrentMeasurement.h@0:c499ebd23db0, 2015-07-18 (annotated)
- Committer:
- dfraj
- Date:
- Sat Jul 18 20:01:58 2015 +0000
- Revision:
- 0:c499ebd23db0
First version of program for measuring current of three phase BLDC motor.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dfraj | 0:c499ebd23db0 | 1 | #ifndef CURRENTMEASUREMENT_H |
dfraj | 0:c499ebd23db0 | 2 | #define CURRENTMEASUREMENT_H |
dfraj | 0:c499ebd23db0 | 3 | |
dfraj | 0:c499ebd23db0 | 4 | #include "mbed.h" |
dfraj | 0:c499ebd23db0 | 5 | |
dfraj | 0:c499ebd23db0 | 6 | class CurrentMeasurement{ |
dfraj | 0:c499ebd23db0 | 7 | public: |
dfraj | 0:c499ebd23db0 | 8 | CurrentMeasurement(PinName I_A, PinName I_B, PinName I_C, PinName I_TOTAL); |
dfraj | 0:c499ebd23db0 | 9 | CurrentMeasurement(PinName I_A, PinName I_B, PinName I_C, PinName I_TOTAL, float R_sh, float R_1s, float R_1t, float R_fs, float R_ft, float V_ref); |
dfraj | 0:c499ebd23db0 | 10 | void setValues(float R_sh, float R_1s, float R_1t, float R_fs, float R_ft, float V_ref); |
dfraj | 0:c499ebd23db0 | 11 | float calculateCurrentA(); |
dfraj | 0:c499ebd23db0 | 12 | float calculateCurrentB(); |
dfraj | 0:c499ebd23db0 | 13 | float calculateCurrentC(); |
dfraj | 0:c499ebd23db0 | 14 | float calculateCurrentTotal(); |
dfraj | 0:c499ebd23db0 | 15 | |
dfraj | 0:c499ebd23db0 | 16 | private: |
dfraj | 0:c499ebd23db0 | 17 | AnalogIn I_A, I_B, I_C, I_TOTAL; |
dfraj | 0:c499ebd23db0 | 18 | float R_sh, R_1s, R_1t, R_fs, R_ft, V_ref, I_A_, I_B_, I_C_, I_TOTAL_; |
dfraj | 0:c499ebd23db0 | 19 | }; |
dfraj | 0:c499ebd23db0 | 20 | |
dfraj | 0:c499ebd23db0 | 21 | #endif |
dfraj | 0:c499ebd23db0 | 22 |