Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in #define #86

Closed
trlafleur opened this issue Dec 18, 2019 · 0 comments
Closed

Error in #define #86

trlafleur opened this issue Dec 18, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@trlafleur
Copy link

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);
@trlafleur trlafleur added the bug label Dec 18, 2019
@laurb9 laurb9 added this to the 1.2.1 milestone May 13, 2020
laurb9 added a commit that referenced this issue May 13, 2020
This didn't affect calculations because all the parameters are divisors.
@laurb9 laurb9 closed this as completed Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants