|
@@ -252,7 +252,7 @@ bool xyzcal_lineXYZ_to(int16_t x, int16_t y, int16_t z, uint16_t delay_us, int8_
|
|
|
sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0;
|
|
|
xyzcal_sm4_delay = delay_us;
|
|
|
// uint32_t u = _micros();
|
|
|
- bool ret = sm4_line_xyze_ui(abs(x), abs(y), abs(z), 0) ? true : false;
|
|
|
+ bool ret = sm4_line_xyz_ui(abs(x), abs(y), abs(z)) ? true : false;
|
|
|
// u = _micros() - u;
|
|
|
return ret;
|
|
|
}
|
|
@@ -689,25 +689,6 @@ uint8_t xyzcal_find_pattern_12x12_in_32x32(uint8_t* pixels, uint16_t* pattern, u
|
|
|
return max_match;
|
|
|
}
|
|
|
|
|
|
-uint8_t xyzcal_xycoords2point(int16_t x, int16_t y)
|
|
|
-{
|
|
|
- uint8_t ix = (x > 10000)?1:0;
|
|
|
- uint8_t iy = (y > 10000)?1:0;
|
|
|
- return iy?(3-ix):ix;
|
|
|
-}
|
|
|
-
|
|
|
-//MK3
|
|
|
-#if ((MOTHERBOARD == BOARD_EINSY_1_0a))
|
|
|
-const int16_t xyzcal_point_xcoords[4] PROGMEM = {1200, 22000, 22000, 1200};
|
|
|
-const int16_t xyzcal_point_ycoords[4] PROGMEM = {600, 600, 19800, 19800};
|
|
|
-#endif //((MOTHERBOARD == BOARD_EINSY_1_0a))
|
|
|
-
|
|
|
-//MK2.5
|
|
|
-#if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
|
|
|
-const int16_t xyzcal_point_xcoords[4] PROGMEM = {1200, 22000, 22000, 1200};
|
|
|
-const int16_t xyzcal_point_ycoords[4] PROGMEM = {700, 700, 19800, 19800};
|
|
|
-#endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3))
|
|
|
-
|
|
|
const uint16_t xyzcal_point_pattern_10[12] PROGMEM = {0x000, 0x0f0, 0x1f8, 0x3fc, 0x7fe, 0x7fe, 0x7fe, 0x7fe, 0x3fc, 0x1f8, 0x0f0, 0x000};
|
|
|
const uint16_t xyzcal_point_pattern_08[12] PROGMEM = {0x000, 0x000, 0x0f0, 0x1f8, 0x3fc, 0x3fc, 0x3fc, 0x3fc, 0x1f8, 0x0f0, 0x000, 0x000};
|
|
|
|
|
@@ -939,8 +920,7 @@ bool xyzcal_scan_and_process(void){
|
|
|
float radius = 4.5f; ///< default radius
|
|
|
const uint8_t iterations = 20;
|
|
|
dynamic_circle(matrix32, xf, yf, radius, iterations);
|
|
|
- if (ABS(xf - (uc + 5.5f)) > 3 || ABS(yf - (ur + 5.5f)) > 3 || ABS(radius - 5) > 3)
|
|
|
- {
|
|
|
+ if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){
|
|
|
DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5);
|
|
|
/// dynamic algorithm diverged, use original position instead
|
|
|
xf = uc + 5.5f;
|
|
@@ -974,13 +954,7 @@ bool xyzcal_find_bed_induction_sensor_point_xy(void){
|
|
|
///< magic constant, lowers min_z after searchZ to obtain more dense data in scan
|
|
|
const pos_i16_t lower_z = 72;
|
|
|
|
|
|
- uint8_t point = xyzcal_xycoords2point(x, y);
|
|
|
- x = pgm_read_word((uint16_t *)(xyzcal_point_xcoords + point));
|
|
|
- y = pgm_read_word((uint16_t *)(xyzcal_point_ycoords + point));
|
|
|
- DBG(_n("point=%d x=%d y=%d z=%d\n"), point, x, y, z);
|
|
|
xyzcal_meassure_enter();
|
|
|
- xyzcal_lineXYZ_to(x, y, z, 200, 0);
|
|
|
-
|
|
|
if (xyzcal_searchZ()){
|
|
|
xyzcal_lineXYZ_to(_X, _Y, _Z - lower_z, 200, 0);
|
|
|
ret = xyzcal_scan_and_process();
|