// we also here check if the move is finished etc ...
void StepperMotor::step()
{
+ if(this->is_move_finished) return; // we can't do anything until the next move has been processed, but we will be able to offset the time by shortening the next step
+
// output to pins 37t
this->step_pin.set( 1 );
THEKERNEL->step_ticker->reset_step_pins = true;
// This is so we don't call that before all the steps have been generated for this tick()
this->is_move_finished = true;
THEKERNEL->step_ticker->a_move_finished = true;
+ this->fx_counter = 0; // set this to zero here so we don't miss any for next move
}
}
// Instruct the StepperMotor to move a certain number of steps
void StepperMotor::move( bool direction, unsigned int steps, float initial_speed)
{
- // INCORRECT: We do not set the direction directly, we will set the pin just before the step pin on the next tick
- // FIXME really? looks a lot like the pin is set here not in the next step
this->dir_pin.set(direction);
this->direction = direction;
this->steps_to_move = steps;
// Zero our tool counters
- this->fx_counter = 0; // Bresenheim counter
this->stepped = 0;
// Do not signal steps until we get instructed to
arm_solution->set_optional(options);
}
- // set delta segments per second, not saved by M500
- if(gcode->has_letter('S')) {
+
+ if(gcode->has_letter('S')) { // set delta segments per second, not saved by M500
this->delta_segments_per_second = gcode->get_value('S');
+ gcode->stream->printf("Delta segments set to %8.4f segs/sec\n", this->delta_segments_per_second);
+
+ }else if(gcode->has_letter('U')) { // or set mm_per_line_segment, not saved by M500
+ this->mm_per_line_segment = gcode->get_value('U');
+ this->delta_segments_per_second = 0;
+ gcode->stream->printf("mm per line segment set to %8.4f\n", this->mm_per_line_segment);
}
+
break;
}
}