20200821_motacon_ver4
Diff: BLDCmotorDriver.h
- Revision:
- 0:5602fba2a7f7
- Child:
- 1:786897114846
- Child:
- 2:7aae78b85e1d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BLDCmotorDriver.h Fri May 22 22:43:39 2015 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +#include "RateLimiter.h" + +class BLDCmotorDriver { + public: + 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 Led1); + void configure(float sampleTime, float switchingFrequency, float rampUpSlope, float rampDownSlope); + void setDutyCycle(float dutyCycle); + void coast(); + float getDutyCycle(); + int HallRead(); + private: + DigitalIn H1; + DigitalIn H2; + DigitalIn H3; + PwmOut GH_A, GL_A, GH_B, GL_B, GH_C, GL_C; + RateLimiter rl; + Ticker ticker; + float switchingPeriod, dutyCycle, tempDutyCycle, sampleTime; + void komutacijaBLDC(); + int sektor; + DigitalOut Led1; +}; \ No newline at end of file