20 lines
625 B
C++
20 lines
625 B
C++
#pragma once
|
|
#include <cmath>
|
|
#include <numbers>
|
|
|
|
struct StepperConfig {
|
|
StepperConfig(float stepDeg, int microsteps)
|
|
: step(stepDeg), resolution(microsteps), resolutionQuad(resolution / 4) {}
|
|
|
|
/// @brief Step-size in degree (e.g. 1.8 deg)
|
|
float step;
|
|
/// @brief Step-size in radiant (e.g. 1.8 deg)
|
|
float stepRad{(float)(std::numbers::pi * step / 180)};
|
|
/// @brief Number of microsteps for four steps
|
|
int resolution;
|
|
/// @brief Number of microsteps for four steps
|
|
int resolutionQuad;
|
|
/// @brief Number of Steps for full revolution
|
|
int steps{std::lround(360.0F / step)};
|
|
};
|