Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Ualpha and Ubeta to FOCMotor #326

Merged
merged 6 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading