Skip to content

Commit

Permalink
config: define maxAcceleration (#135)
Browse files Browse the repository at this point in the history
Move maxAcceleration constant from StrokeEngineHelper to config file

Signed-off-by: benoit robert <[email protected]>
Co-authored-by: ptibibi <[email protected]>
  • Loading branch information
Ptibibi and ptibibi authored Nov 11, 2024
1 parent 5d7e685 commit d1c0ca1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Software/src/constants/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace Config {
// Top linear speed of the device.
constexpr float maxSpeedMmPerSecond = 900.0f;

// Top acceleration of the device.
constexpr float maxAcceleration = 10000.0f;

// This should match the step/rev of your stepper or servo.
// N.b. the iHSV57 has a table on the side for setting the DIP switches
// to your preference.
Expand Down
4 changes: 2 additions & 2 deletions Software/src/utils/StrokeEngineHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static motorProperties servoMotor{
.maxSpeed =
60 * (Config::Driver::maxSpeedMmPerSecond /
(Config::Driver::pulleyToothCount * Config::Driver::beltPitchMm)),
.maxAcceleration = 10000,
.maxAcceleration = Config::Driver::maxAcceleration,
.stepsPerMillimeter =
Config::Driver::motorStepPerRevolution /
(Config::Driver::pulleyToothCount * Config::Driver::beltPitchMm),
Expand All @@ -39,4 +39,4 @@ static float calculateSensation(float sensationPercentage) {
}


#endif
#endif

0 comments on commit d1c0ca1

Please sign in to comment.