20200821_motacon_ver4
Diff: BLDCmotorDriver.h
- Revision:
- 3:a4b4a8e3f2a0
- Parent:
- 1:786897114846
- Child:
- 4:f56d1fb53d9b
- Child:
- 6:51643d078474
--- a/BLDCmotorDriver.h Sun May 24 06:46:25 2015 +0000 +++ b/BLDCmotorDriver.h Mon Jun 01 13:47:23 2015 +0000 @@ -3,23 +3,27 @@ class BLDCmotorDriver { public: - BLDCmotorDriver(PinName pGH_A, PinName pGH_B, PinName pGH_C, PinName pGL_A, PinName pGL_B, PinName pGL_C, PinName pH1, PinName pH2, PinName pH3, PinName pfault); + BLDCmotorDriver(PinName GH_A, PinName GL_A, PinName GH_B, PinName GL_B, PinName GH_C, PinName GL_C, PinName h1, PinName h2, PinName h3, PinName Fault); void configure(float sampleTime, float switchingFrequency, float rampUpSlope, float rampDownSlope); void setDutyCycle(float dutyCycle); void coast(); float getDutyCycle(); int getSector(); + void ispis(); + private: PwmOut GH_A, GH_B, GH_C; DigitalOut GL_A, GL_B, GL_C; // Low-side gates are never PWM driven InterruptIn H1; // InterruptIn can be used on all pins except p19 and p20 InterruptIn H2; InterruptIn H3; - DigitalOut fault; RateLimiter rl; Ticker ticker; float switchingPeriod, dutyCycle, tempDutyCycle, sampleTime; void commutation(); - void adjustDutyCycle(); - int currentSector, previousSector; + int currentSector, _currentSector, previousSector, difference; + DigitalOut Fault; + int h1, h2, h3; + //void adjustDutyCycle(); + }; \ No newline at end of file