thanks for your coments, now i am going to redesign the tool holder on the z axix, in order to make it more precise..... i will be posting codes and graphics in my blog..... http://aventgps.blogspot.com

// Get co-ordinates if required by the code type givenswitch (code) {case 0:case 1:case 2:case 3:if(abs_mode) {//we do it like this to save time. makes curves better.//eg. if only x and y are specified, we dont have to waste time looking up z.if (has_command('X', instruction, size)) fp.x = search_string('X', instruction, size);else fp.x = current_units.x;

// Make sure angleB is always greater than angleA// and if not add 2PI so that it is (this also takes// care of the special case of angleA == angleB,// ie we want a complete circle)if (angleB <= angleA) angleB += 2 * M_PI; angle = angleB - angleA;

bool can_step(byte min_pin, byte max_pin, long current, long target, bytedirection){//stop us if we're on targetif (target == current)returnfalse;//stop us if we're at home and still going elseif (read_switch(min_pin) && !direction)returnfalse;//stop us if we're at max and still goingelseif (read_switch(max_pin) && direction)returnfalse;

//calculate delay between steps in microseconds. this is sort of tricky, but not too bad.//the formula has been condensed to save space. here it is in english:// distance / feedrate * 60000000.0 = move duration in microseconds// move duration / master_steps = time between steps for master axis.