SimpleFOClibrary
2.4.0
Loading...
Searching...
No Matches
BLDCDriver3PWM.h
Go to the documentation of this file.
1
#ifndef BLDCDriver3PWM_h
2
#define BLDCDriver3PWM_h
3
4
#include "../common/base_classes/BLDCDriver.h"
5
#include "../common/foc_utils.h"
6
#include "../common/time_utils.h"
7
#include "../common/defaults.h"
8
#include "
hardware_api.h
"
9
10
/**
11
3 pwm bldc driver class
12
*/
13
class
BLDCDriver3PWM
:
public
BLDCDriver
14
{
15
public
:
16
/**
17
BLDCDriver class constructor
18
@param phA A phase pwm pin
19
@param phB B phase pwm pin
20
@param phC C phase pwm pin
21
@param en1 enable pin (optional input)
22
@param en2 enable pin (optional input)
23
@param en3 enable pin (optional input)
24
*/
25
BLDCDriver3PWM
(
int
phA,
int
phB,
int
phC,
int
en1 =
NOT_SET
,
int
en2 =
NOT_SET
,
int
en3 =
NOT_SET
);
26
27
/** Motor hardware init function */
28
int
init
()
override
;
29
/** Motor disable function */
30
void
disable
()
override
;
31
/** Motor enable function */
32
void
enable
()
override
;
33
34
// hardware variables
35
int
pwmA
;
//!< phase A pwm pin number
36
int
pwmB
;
//!< phase B pwm pin number
37
int
pwmC
;
//!< phase C pwm pin number
38
int
enableA_pin
;
//!< enable pin number
39
int
enableB_pin
;
//!< enable pin number
40
int
enableC_pin
;
//!< enable pin number
41
42
/**
43
* Set phase voltages to the hardware
44
*
45
* @param Ua - phase A voltage
46
* @param Ub - phase B voltage
47
* @param Uc - phase C voltage
48
*/
49
void
setPwm
(
float
Ua,
float
Ub,
float
Uc)
override
;
50
51
/**
52
* Set phase voltages to the hardware
53
* > Only possible is the driver has separate enable pins for all phases!
54
*
55
* @param sc - phase A state : active / disabled ( high impedance )
56
* @param sb - phase B state : active / disabled ( high impedance )
57
* @param sa - phase C state : active / disabled ( high impedance )
58
*/
59
virtual
void
setPhaseState
(
PhaseState
sa,
PhaseState
sb,
PhaseState
sc)
override
;
60
private
:
61
};
62
63
64
#endif
PhaseState
PhaseState
Definition
FOCDriver.h:7
BLDCDriver3PWM
Definition
BLDCDriver3PWM.h:14
BLDCDriver3PWM::enableC_pin
int enableC_pin
enable pin number
Definition
BLDCDriver3PWM.h:40
BLDCDriver3PWM::setPhaseState
virtual void setPhaseState(PhaseState sa, PhaseState sb, PhaseState sc) override
Definition
BLDCDriver3PWM.cpp:67
BLDCDriver3PWM::enable
void enable() override
Definition
BLDCDriver3PWM.cpp:22
BLDCDriver3PWM::disable
void disable() override
Definition
BLDCDriver3PWM.cpp:32
BLDCDriver3PWM::pwmA
int pwmA
phase A pwm pin number
Definition
BLDCDriver3PWM.h:35
BLDCDriver3PWM::enableA_pin
int enableA_pin
enable pin number
Definition
BLDCDriver3PWM.h:38
BLDCDriver3PWM::pwmC
int pwmC
phase C pwm pin number
Definition
BLDCDriver3PWM.h:37
BLDCDriver3PWM::enableB_pin
int enableB_pin
enable pin number
Definition
BLDCDriver3PWM.h:39
BLDCDriver3PWM::init
int init() override
Definition
BLDCDriver3PWM.cpp:44
BLDCDriver3PWM::setPwm
void setPwm(float Ua, float Ub, float Uc) override
Definition
BLDCDriver3PWM.cpp:77
BLDCDriver3PWM::pwmB
int pwmB
phase B pwm pin number
Definition
BLDCDriver3PWM.h:36
BLDCDriver
Definition
BLDCDriver.h:7
hardware_api.h
NOT_SET
#define NOT_SET
Definition
foc_utils.h:34
src
drivers
BLDCDriver3PWM.h
Generated by
1.9.8