Project

General

Profile

var first_border = -10; // first border coordinate in mm
var second_border = 10; // second border coordinate in mm
var mm_per_step = 0.005; // steps to distance translation coefficient
var delay = 100; // delay in milliseconds
var calb = new_calibration(mm_per_step, get_engine_settings().MicrostepMode); // create calibration structure
command_stop(); // send STOP command (does immediate stop)
command_zero(); // send ZERO command (sets current position and encoder value to zero)
while (1) { // infinite loop
command_move_calb(first_border, calb); // move towards one border
command_wait_for_stop(delay); // wait until controller stops moving
command_move_calb(second_border, calb); // move towards another border
command_wait_for_stop(delay); // wait until controller stops moving
}

Add picture from clipboard (Maximum size: 977 MB)