Closed trlafleur closed 4 years ago
The order of parameters is wrong between the #define and the use of the macro, so the macro expansion is wrong.
In BasicStepperDriver.h you have..
/* * calculate the step pulse in microseconds for a given rpm value. * 60[s/min] * 1000000[us/s] / microsteps / steps / rpm */ #define STEP_PULSE(steps, microsteps, rpm) (60.0*1000000L/steps/microsteps/rpm)
But in BasicStepperDriver.cpp you use it as:
163 step_pulse = cruise_step_pulse = STEP_PULSE(rpm, motor_steps, microsteps); 238 t = steps * STEP_PULSE(rpm, motor_steps, microsteps);
The order of parameters is wrong between the #define and the use of the macro, so the macro expansion is wrong.
In BasicStepperDriver.h you have..
But in BasicStepperDriver.cpp you use it as: