FOC Implementation for putting multirotor motors in robots

Dependencies:   FastPWM3 mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Inverter.h Source File

Inverter.h

00001 #ifndef INVERTER_H
00002 #define INVERTER_H
00003 #include "FastPWM.h"
00004 #include "mbed.h"
00005 
00006 
00007 class Inverter{
00008     public:
00009         Inverter(PinName PinA, PinName PinB, PinName PinC, PinName PinEnable, float I_Scale, float Period);
00010         void SetDTC(float DTC_A, float DTC_B, float DTC_C);
00011         void EnableInverter();
00012         void DisableInverter();
00013         void InitCurrentSense();
00014         void SampleCurrent(); 
00015         void GetCurrent(float *A, float *B, float *C);
00016         float I_A, I_B, I_C, _I_Scale;
00017 
00018     private:
00019         float I_B_Offset, I_C_Offset;
00020         void ZeroCurrent(void);
00021         FastPWM *PWM_A, *PWM_B, *PWM_C;  
00022         DigitalOut *Enable, *Dbg; 
00023         AnalogIn *Current_B, *Current_C;
00024     };
00025 
00026 #endif