support for helical motion

This commit is contained in:
Simen Svale Skogsrud
2009-02-11 00:37:33 +01:00
parent 8f3a69b37e
commit e257fc195c
6 changed files with 164 additions and 117 deletions

View File

@ -24,6 +24,7 @@
#include "stepper.h"
#include "config.h"
#include <math.h>
#include "nuts_bolts.h"
#include <avr/interrupt.h>
@ -286,3 +287,13 @@ void st_set_echo(int value)
{
echo_steps = value;
}
// Convert from millimeters to step-counts along the designated axis
int32_t st_millimeters_to_steps(double millimeters, int axis) {
switch(axis) {
case X_AXIS: return(round(millimeters*X_STEPS_PER_MM));
case Y_AXIS: return(round(millimeters*Y_STEPS_PER_MM));
case Z_AXIS: return(round(millimeters*Z_STEPS_PER_MM));
}
return(0);
}