-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made class objects into unique_ptr for heap allocation.
- Loading branch information
1 parent
b70ac88
commit de2e6d7
Showing
7 changed files
with
67 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <observers/dq_update.hpp> | ||
|
||
int main() | ||
{ | ||
observers::BemfGains gains(1, 1, 1, 1e-4, 0); | ||
controllers::PIConfig config = { 0.5, 100, 1e-4, 100, -100 }; | ||
auto dq_update = observers::DQUpdate(config, gains); | ||
for (float t = 0; t < 10; t += 1e-4) | ||
{ | ||
math::FrameAlphaBeta currents(0, 0); | ||
math::FrameAlphaBeta voltages(0, 0); | ||
float angular_velocity = 0; | ||
float rotor_angle = 0; | ||
dq_update.loop(currents, voltages, angular_velocity, rotor_angle); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <observers/tracker.hpp> | ||
|
||
int main() | ||
{ | ||
controllers::PIConfig config = { 0.5, 100, 1e-4, 180, -180 }; | ||
auto tracker = observers::Tracker(config); | ||
float phase_error = 10; | ||
|
||
for (float t = 0; t < 10; t += 1e-4) | ||
{ | ||
tracker.loop(phase_error); | ||
} | ||
return 0; | ||
} |