Skip to content

Commit

Permalink
Merge pull request #326 from Candas1/flux_observer_sensor
Browse files Browse the repository at this point in the history
Move Ualpha and Ubeta to FOCMotor
  • Loading branch information
askuric authored Apr 19, 2024
2 parents 977b141 + 1cd3479 commit 1425dff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/BLDCMotor.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ class BLDCMotor: public FOCMotor
void move(float target = NOT_SET) override;

float Ua, Ub, Uc;//!< Current phase voltages Ua,Ub and Uc set to motor
float Ualpha, Ubeta; //!< Phase voltages U alpha and U beta used for inverse Park and Clarke transform


/**
* Method using FOC to set Uq to the motor at the optimal angle
* Heart of the FOC algorithm
Expand Down
2 changes: 0 additions & 2 deletions src/StepperMotor.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ class StepperMotor: public FOCMotor
*/
void move(float target = NOT_SET) override;

float Ualpha,Ubeta; //!< Phase voltages U alpha and U beta used for inverse Park and Clarke transform

/**
* Method using FOC to set Uq to the motor at the optimal angle
* Heart of the FOC algorithm
Expand Down
4 changes: 4 additions & 0 deletions src/common/base_classes/FOCMotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ FOCMotor::FOCMotor()

// voltage bemf
voltage_bemf = 0;

// Initialize phase voltages U alpha and U beta used for inverse Park and Clarke transform
Ualpha = 0;
Ubeta = 0;

//monitor_port
monitor_port = nullptr;
Expand Down
2 changes: 2 additions & 0 deletions src/common/base_classes/FOCMotor.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ class FOCMotor
DQVoltage_s voltage;//!< current d and q voltage set to the motor
DQCurrent_s current;//!< current d and q current measured
float voltage_bemf; //!< estimated backemf voltage (if provided KV constant)
float Ualpha, Ubeta; //!< Phase voltages U alpha and U beta used for inverse Park and Clarke transform


// motor configuration parameters
float voltage_sensor_align;//!< sensor and motor align voltage parameter
Expand Down

0 comments on commit 1425dff

Please sign in to comment.