diff --git a/src/Groundstation/RotatingPlatform/Actuators/Actuators.cpp b/src/Groundstation/RotatingPlatform/Actuators/Actuators.cpp index 6210a7718b6c2939e2c924ca3a5de8b0b456105d..63a2ccc9ffc9bd478b3635dcb14018dae032bfa2 100644 --- a/src/Groundstation/RotatingPlatform/Actuators/Actuators.cpp +++ b/src/Groundstation/RotatingPlatform/Actuators/Actuators.cpp @@ -70,17 +70,22 @@ Actuators::Actuators(StepperConfig config) void Actuators::run() { + int logNr = Logger::getInstance().getCurrentLogNumber(); while (true) { + std::cout << "Log nr " << logNr << std::endl; + std::cout << "Speed limit is " << configX.MAX_SPEED << std::endl; { miosix::Lock<FastMutex> lock(rotationMutex); - float stepSpeed = ACCELERATION * (TIME_WAIT_MS / 1000); + float stepSpeed = ACCELERATION * (TIME_WAIT_MS / 1000); + float multiplier = 2.2; // Acceleration/stable phase if (stepperX.isEnabled() && isRotating) { - if (speed < configX.MAX_SPEED && speed < MAX_MAX_SPEED) + if (speed < configX.MAX_SPEED / multiplier && + speed < MAX_MAX_SPEED) speed += stepSpeed; if (speed > configX.MAX_SPEED) speed = configX.MAX_SPEED; @@ -104,7 +109,7 @@ void Actuators::run() setSpeed(StepperList::STEPPER_X, 0.0); } } - moveDeg(StepperList::STEPPER_X, 20); + moveDeg(StepperList::STEPPER_X, -20); Thread::sleep(TIME_WAIT_MS); } } diff --git a/src/Groundstation/RotatingPlatform/Actuators/Actuators.h b/src/Groundstation/RotatingPlatform/Actuators/Actuators.h index 9102e8a50bd320d4d98171a66e57a69d61071e7e..1a5259c198a98d75cd4161975997f73f967713be 100644 --- a/src/Groundstation/RotatingPlatform/Actuators/Actuators.h +++ b/src/Groundstation/RotatingPlatform/Actuators/Actuators.h @@ -38,9 +38,9 @@ namespace RotatingPlatform { static constexpr float MAX_MAX_SPEED = - 0.03; // Structurally not go more than this + 0.5 * 2.2; // Structurally not go more than this static constexpr float ACCELERATION = 0.01; //[RPS^2] -static constexpr float TIME_WAIT_MS = 100; //[MS] +static constexpr float TIME_WAIT_MS = 100; //[MS] /** * @brief Error handling enum for the stepper movement diff --git a/src/Groundstation/RotatingPlatform/Actuators/ActuatorsConfig.h b/src/Groundstation/RotatingPlatform/Actuators/ActuatorsConfig.h index f076a8f01a4e9418d19552d80d4355fb659e79f4..eb0f958cb897009295f809f1ec736e57da201155 100644 --- a/src/Groundstation/RotatingPlatform/Actuators/ActuatorsConfig.h +++ b/src/Groundstation/RotatingPlatform/Actuators/ActuatorsConfig.h @@ -37,7 +37,7 @@ static const RotatingPlatform::StepperConfig stepperXConfig{ .HAS_ANGLE_LIMITS = false, .MIN_ANGLE = 0, .MAX_ANGLE = 0, - .MAX_SPEED = 0.1, //<[RPS] + .MAX_SPEED = 0.105 * 2.2, //<[RPS] * multiplier (transmission) }; namespace StepperSettings