Motacon_20200317
Dependents: HelloWorld_MotorKaisei
BLDCmotorDriver.h@0:5602fba2a7f7, 2015-05-22 (annotated)
- Committer:
- mslovic
- Date:
- Fri May 22 22:43:39 2015 +0000
- Revision:
- 0:5602fba2a7f7
- Child:
- 1:786897114846
- Child:
- 2:7aae78b85e1d
Library for driving a 3-phase brushless DC motor.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mslovic | 0:5602fba2a7f7 | 1 | #include "mbed.h" |
mslovic | 0:5602fba2a7f7 | 2 | #include "RateLimiter.h" |
mslovic | 0:5602fba2a7f7 | 3 | |
mslovic | 0:5602fba2a7f7 | 4 | class BLDCmotorDriver { |
mslovic | 0:5602fba2a7f7 | 5 | public: |
mslovic | 0:5602fba2a7f7 | 6 | 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); |
mslovic | 0:5602fba2a7f7 | 7 | void configure(float sampleTime, float switchingFrequency, float rampUpSlope, float rampDownSlope); |
mslovic | 0:5602fba2a7f7 | 8 | void setDutyCycle(float dutyCycle); |
mslovic | 0:5602fba2a7f7 | 9 | void coast(); |
mslovic | 0:5602fba2a7f7 | 10 | float getDutyCycle(); |
mslovic | 0:5602fba2a7f7 | 11 | int HallRead(); |
mslovic | 0:5602fba2a7f7 | 12 | private: |
mslovic | 0:5602fba2a7f7 | 13 | DigitalIn H1; |
mslovic | 0:5602fba2a7f7 | 14 | DigitalIn H2; |
mslovic | 0:5602fba2a7f7 | 15 | DigitalIn H3; |
mslovic | 0:5602fba2a7f7 | 16 | PwmOut GH_A, GL_A, GH_B, GL_B, GH_C, GL_C; |
mslovic | 0:5602fba2a7f7 | 17 | RateLimiter rl; |
mslovic | 0:5602fba2a7f7 | 18 | Ticker ticker; |
mslovic | 0:5602fba2a7f7 | 19 | float switchingPeriod, dutyCycle, tempDutyCycle, sampleTime; |
mslovic | 0:5602fba2a7f7 | 20 | void komutacijaBLDC(); |
mslovic | 0:5602fba2a7f7 | 21 | int sektor; |
mslovic | 0:5602fba2a7f7 | 22 | DigitalOut Led1; |
mslovic | 0:5602fba2a7f7 | 23 | }; |