Skip to content

Commit 72cdd21

Browse files
authored
Update CurrentSense.cpp
Fix Clarke transform for dual shunt
1 parent 7374f7a commit 72cdd21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/common/base_classes/CurrentSense.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ ABCurrent_s CurrentSense::getABCurrents(PhaseCurrent_s current){
5555
// if only two measured currents
5656
i_alpha = current.a;
5757
i_beta = _1_SQRT3 * current.a + _2_SQRT3 * current.b;
58-
}if(!current.a){
58+
}else if(!current.a){
5959
// if only two measured currents
6060
float a = -current.c - current.b;
6161
i_alpha = a;
6262
i_beta = _1_SQRT3 * a + _2_SQRT3 * current.b;
63-
}if(!current.b){
63+
}else if(!current.b){
6464
// if only two measured currents
6565
float b = -current.a - current.c;
6666
i_alpha = current.a;
@@ -99,4 +99,4 @@ DQCurrent_s CurrentSense::getDQCurrents(ABCurrent_s current, float angle_el){
9999
*/
100100
void CurrentSense::linkDriver(BLDCDriver* _driver) {
101101
driver = _driver;
102-
}
102+
}

0 commit comments

Comments
 (0)