Skip to content

Commit bfa492c

Browse files
committed
Initialize Ualpha and Ubeta
1 parent 655c099 commit bfa492c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/StepperMotor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ class StepperMotor: public FOCMotor
7373
*/
7474
void move(float target = NOT_SET) override;
7575

76-
float Ualpha,Ubeta; //!< Phase voltages U alpha and U beta used for inverse Park and Clarke transform
77-
7876
/**
7977
* Method using FOC to set Uq to the motor at the optimal angle
8078
* Heart of the FOC algorithm

src/common/base_classes/FOCMotor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ FOCMotor::FOCMotor()
3232

3333
// voltage bemf
3434
voltage_bemf = 0;
35+
36+
// Initialize phase voltages U alpha and U beta used for inverse Park and Clarke transform
37+
Ualpha = 0;
38+
Ubeta = 0;
3539

3640
//monitor_port
3741
monitor_port = nullptr;

0 commit comments

Comments
 (0)