[2.0] Fix up G33, LPC1768 + SDCARD_SORT_ALPHA (#8250)
* Update Conditionals_post.h * Add a cast to round() to convert to a unsigned int Add's a cast to round() so that it will compile properly. round() returns a float which must be cast to a integer for the following % operation. Use a unsigned int as a negative index to an array is wrong. Should never be more than 255 points allowing us to use a 8 bit cast. * Update G33.cpp
This commit is contained in:
parent
46c0b73578
commit
e0a6ee8da5
@ -155,7 +155,7 @@ static float probe_G33_points(float z_at_pt[NPP + 1], const int8_t probe_points,
|
|||||||
dy = (Y_PROBE_OFFSET_FROM_EXTRUDER);
|
dy = (Y_PROBE_OFFSET_FROM_EXTRUDER);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LOOP_CAL_ALL(axis) z_at_pt[axis] = 0.0;
|
LOOP_CAL_ALL(axis) z_at_pt[axis] = 0.0;
|
||||||
|
|
||||||
if (!_0p_calibration) {
|
if (!_0p_calibration) {
|
||||||
|
|
||||||
@ -199,30 +199,23 @@ static float probe_G33_points(float z_at_pt[NPP + 1], const int8_t probe_points,
|
|||||||
for (int8_t circle = -offset; circle <= offset; circle++) {
|
for (int8_t circle = -offset; circle <= offset; circle++) {
|
||||||
const float a = RADIANS(210 + (360 / NPP) * (axis - 1)),
|
const float a = RADIANS(210 + (360 / NPP) * (axis - 1)),
|
||||||
r = delta_calibration_radius * (1 + 0.1 * (zig_zag ? circle : - circle)),
|
r = delta_calibration_radius * (1 + 0.1 * (zig_zag ? circle : - circle)),
|
||||||
interpol = fmod(axis, 1);
|
interpol = FMOD(axis, 1);
|
||||||
#if ENABLED(PROBE_MANUALLY)
|
const float z_temp =
|
||||||
float z_temp = lcd_probe_pt(cos(a) * r, sin(a) * r);
|
#if ENABLED(PROBE_MANUALLY)
|
||||||
#else
|
lcd_probe_pt(cos(a) * r, sin(a) * r)
|
||||||
float z_temp = probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1);
|
#else
|
||||||
#endif
|
probe_pt(cos(a) * r + dx, sin(a) * r + dy, stow_after_each, 1)
|
||||||
|
#endif
|
||||||
|
;
|
||||||
// split probe point to neighbouring calibration points
|
// split probe point to neighbouring calibration points
|
||||||
z_at_pt[round(axis - interpol + NPP - 1) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90)));
|
z_at_pt[uint8_t(round(axis - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90)));
|
||||||
z_at_pt[round(axis - interpol) % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90)));
|
z_at_pt[uint8_t(round(axis - interpol)) % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90)));
|
||||||
}
|
}
|
||||||
zig_zag = !zig_zag;
|
zig_zag = !zig_zag;
|
||||||
}
|
}
|
||||||
if (_7p_intermed_points)
|
if (_7p_intermed_points)
|
||||||
LOOP_CAL_RAD(axis) {
|
LOOP_CAL_RAD(axis)
|
||||||
/*
|
z_at_pt[axis] /= _7P_STEP / steps;
|
||||||
// average intermediate points to towers and opposites - only required with _7P_STEP >= 2
|
|
||||||
for (int8_t i = 1; i < _7P_STEP; i++) {
|
|
||||||
const float interpol = i * (1.0 / _7P_STEP);
|
|
||||||
z_at_pt[axis] += (z_at_pt[(axis + NPP - i - 1) % NPP + 1]
|
|
||||||
+ z_at_pt[axis + i]) * sq(cos(RADIANS(interpol * 90)));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
z_at_pt[axis] /= _7P_STEP / steps;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -342,14 +335,14 @@ static float probe_G33_points(float z_at_pt[NPP + 1], const int8_t probe_points,
|
|||||||
recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
|
recalc_delta_settings(delta_radius, delta_diagonal_rod, delta_tower_angle_trim);
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
case A_AXIS :
|
case A_AXIS :
|
||||||
a_fac += 4.0 / ( Z06(__B) -Z06(__C) +Z06(_CA) -Z06(_AB)); // Offset by alpha tower angle
|
a_fac += 4.0 / ( Z06(__B) -Z06(__C) +Z06(_CA) -Z06(_AB)); // Offset by alpha tower angle
|
||||||
break;
|
break;
|
||||||
case B_AXIS :
|
case B_AXIS :
|
||||||
a_fac += 4.0 / (-Z06(__A) +Z06(__C) -Z06(_BC) +Z06(_AB)); // Offset by beta tower angle
|
a_fac += 4.0 / (-Z06(__A) +Z06(__C) -Z06(_BC) +Z06(_AB)); // Offset by beta tower angle
|
||||||
break;
|
break;
|
||||||
case C_AXIS :
|
case C_AXIS :
|
||||||
a_fac += 4.0 / (Z06(__A) -Z06(__B) +Z06(_BC) -Z06(_CA) ); // Offset by gamma tower angle
|
a_fac += 4.0 / (Z06(__A) -Z06(__B) +Z06(_BC) -Z06(_CA) ); // Offset by gamma tower angle
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
a_fac /= 3.0;
|
a_fac /= 3.0;
|
||||||
|
@ -1079,10 +1079,6 @@
|
|||||||
#undef MOTOR_CURRENT
|
#undef MOTOR_CURRENT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(SDCARD_SORT_ALPHA)
|
|
||||||
#define HAS_FOLDER_SORTING (FOLDER_SORTING || ENABLED(SDSORT_GCODE))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Updated G92 behavior shifts the workspace
|
// Updated G92 behavior shifts the workspace
|
||||||
#define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS)
|
#define HAS_POSITION_SHIFT DISABLED(NO_WORKSPACE_OFFSETS)
|
||||||
// The home offset also shifts the coordinate space
|
// The home offset also shifts the coordinate space
|
||||||
@ -1197,4 +1193,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// needs to be here so that we catch the above changes to our defines
|
||||||
|
#if ENABLED(SDCARD_SORT_ALPHA)
|
||||||
|
#define HAS_FOLDER_SORTING (FOLDER_SORTING || ENABLED(SDSORT_GCODE))
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // CONDITIONALS_POST_H
|
#endif // CONDITIONALS_POST_H
|
||||||
|
Loading…
Reference in New Issue
Block a user