Added option to set a delay after enabeling stepper driver, to allow the driver to enable (time needed according to datasheet)
This commit is contained in:
parent
439f339f74
commit
e7fb583df9
1 changed files with 23 additions and 0 deletions
|
|
@ -1284,10 +1284,33 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov
|
||||||
//Only enable axis that are moving. If the axis doesn't need to move then it can stay disabled depending on configuration.
|
//Only enable axis that are moving. If the axis doesn't need to move then it can stay disabled depending on configuration.
|
||||||
// TODO: maybe it's better to refactor into a generic enable(int axis) function, that will probably take more ram,
|
// TODO: maybe it's better to refactor into a generic enable(int axis) function, that will probably take more ram,
|
||||||
// but will reduce code size
|
// but will reduce code size
|
||||||
|
#ifdef DELAY_ENABLE
|
||||||
|
if(axis_steps_remaining[0])
|
||||||
|
{
|
||||||
|
enable_x();
|
||||||
|
delayMicroseconds(DELAY_ENABLE);
|
||||||
|
}
|
||||||
|
if(axis_steps_remaining[1])
|
||||||
|
{
|
||||||
|
enable_y();
|
||||||
|
delayMicroseconds(DELAY_ENABLE);
|
||||||
|
}
|
||||||
|
if(axis_steps_remaining[2])
|
||||||
|
{
|
||||||
|
enable_z();
|
||||||
|
delayMicroseconds(DELAY_ENABLE);
|
||||||
|
}
|
||||||
|
if(axis_steps_remaining[3])
|
||||||
|
{
|
||||||
|
enable_e();
|
||||||
|
delayMicroseconds(DELAY_ENABLE);
|
||||||
|
}
|
||||||
|
#else
|
||||||
if(axis_steps_remaining[0]) enable_x();
|
if(axis_steps_remaining[0]) enable_x();
|
||||||
if(axis_steps_remaining[1]) enable_y();
|
if(axis_steps_remaining[1]) enable_y();
|
||||||
if(axis_steps_remaining[2]) enable_z();
|
if(axis_steps_remaining[2]) enable_z();
|
||||||
if(axis_steps_remaining[3]) enable_e();
|
if(axis_steps_remaining[3]) enable_e();
|
||||||
|
#endif
|
||||||
|
|
||||||
//Define variables that are needed for the Bresenham algorithm. Please note that Z is not currently included in the Bresenham algorithm.
|
//Define variables that are needed for the Bresenham algorithm. Please note that Z is not currently included in the Bresenham algorithm.
|
||||||
unsigned long delta[] = {axis_steps_remaining[0], axis_steps_remaining[1], axis_steps_remaining[2], axis_steps_remaining[3]}; //TODO: implement a "for" to support N axes
|
unsigned long delta[] = {axis_steps_remaining[0], axis_steps_remaining[1], axis_steps_remaining[2], axis_steps_remaining[3]}; //TODO: implement a "for" to support N axes
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue