Skip to content

Commit

Permalink
Update CurrentSense.cpp
Browse files Browse the repository at this point in the history
Fix Clarke transform for dual shunt
  • Loading branch information
Candas1 committed Nov 19, 2023
1 parent 7374f7a commit 72cdd21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/base_classes/CurrentSense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ ABCurrent_s CurrentSense::getABCurrents(PhaseCurrent_s current){
// if only two measured currents
i_alpha = current.a;
i_beta = _1_SQRT3 * current.a + _2_SQRT3 * current.b;
}if(!current.a){
}else if(!current.a){
// if only two measured currents
float a = -current.c - current.b;
i_alpha = a;
i_beta = _1_SQRT3 * a + _2_SQRT3 * current.b;
}if(!current.b){
}else if(!current.b){
// if only two measured currents
float b = -current.a - current.c;
i_alpha = current.a;
Expand Down Expand Up @@ -99,4 +99,4 @@ DQCurrent_s CurrentSense::getDQCurrents(ABCurrent_s current, float angle_el){
*/
void CurrentSense::linkDriver(BLDCDriver* _driver) {
driver = _driver;
}
}

0 comments on commit 72cdd21

Please sign in to comment.